com.amazonaws.services.qconnect.model.RecommendationTrigger Maven / Gradle / Ivy
Show all versions of aws-java-sdk-qconnect Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.qconnect.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A recommendation trigger provides context on the event that produced the referenced recommendations. Recommendations
* are only referenced in recommendationIds
by a single RecommendationTrigger.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RecommendationTrigger implements Serializable, Cloneable, StructuredPojo {
/**
*
* A union type containing information related to the trigger.
*
*/
private RecommendationTriggerData data;
/**
*
* The identifier of the recommendation trigger.
*
*/
private String id;
/**
*
* The identifiers of the recommendations.
*
*/
private java.util.List recommendationIds;
/**
*
* The source of the recommendation trigger.
*
*
* -
*
* ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
*
*
* -
*
* RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
*
*
*
*/
private String source;
/**
*
* The type of recommendation trigger.
*
*/
private String type;
/**
*
* A union type containing information related to the trigger.
*
*
* @param data
* A union type containing information related to the trigger.
*/
public void setData(RecommendationTriggerData data) {
this.data = data;
}
/**
*
* A union type containing information related to the trigger.
*
*
* @return A union type containing information related to the trigger.
*/
public RecommendationTriggerData getData() {
return this.data;
}
/**
*
* A union type containing information related to the trigger.
*
*
* @param data
* A union type containing information related to the trigger.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RecommendationTrigger withData(RecommendationTriggerData data) {
setData(data);
return this;
}
/**
*
* The identifier of the recommendation trigger.
*
*
* @param id
* The identifier of the recommendation trigger.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* The identifier of the recommendation trigger.
*
*
* @return The identifier of the recommendation trigger.
*/
public String getId() {
return this.id;
}
/**
*
* The identifier of the recommendation trigger.
*
*
* @param id
* The identifier of the recommendation trigger.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RecommendationTrigger withId(String id) {
setId(id);
return this;
}
/**
*
* The identifiers of the recommendations.
*
*
* @return The identifiers of the recommendations.
*/
public java.util.List getRecommendationIds() {
return recommendationIds;
}
/**
*
* The identifiers of the recommendations.
*
*
* @param recommendationIds
* The identifiers of the recommendations.
*/
public void setRecommendationIds(java.util.Collection recommendationIds) {
if (recommendationIds == null) {
this.recommendationIds = null;
return;
}
this.recommendationIds = new java.util.ArrayList(recommendationIds);
}
/**
*
* The identifiers of the recommendations.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRecommendationIds(java.util.Collection)} or {@link #withRecommendationIds(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param recommendationIds
* The identifiers of the recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RecommendationTrigger withRecommendationIds(String... recommendationIds) {
if (this.recommendationIds == null) {
setRecommendationIds(new java.util.ArrayList(recommendationIds.length));
}
for (String ele : recommendationIds) {
this.recommendationIds.add(ele);
}
return this;
}
/**
*
* The identifiers of the recommendations.
*
*
* @param recommendationIds
* The identifiers of the recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RecommendationTrigger withRecommendationIds(java.util.Collection recommendationIds) {
setRecommendationIds(recommendationIds);
return this;
}
/**
*
* The source of the recommendation trigger.
*
*
* -
*
* ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
*
*
* -
*
* RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
*
*
*
*
* @param source
* The source of the recommendation trigger.
*
* -
*
* ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
*
*
* -
*
* RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
*
*
* @see RecommendationSourceType
*/
public void setSource(String source) {
this.source = source;
}
/**
*
* The source of the recommendation trigger.
*
*
* -
*
* ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
*
*
* -
*
* RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
*
*
*
*
* @return The source of the recommendation trigger.
*
* -
*
* ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
*
*
* -
*
* RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
*
*
* @see RecommendationSourceType
*/
public String getSource() {
return this.source;
}
/**
*
* The source of the recommendation trigger.
*
*
* -
*
* ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
*
*
* -
*
* RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
*
*
*
*
* @param source
* The source of the recommendation trigger.
*
* -
*
* ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
*
*
* -
*
* RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see RecommendationSourceType
*/
public RecommendationTrigger withSource(String source) {
setSource(source);
return this;
}
/**
*
* The source of the recommendation trigger.
*
*
* -
*
* ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
*
*
* -
*
* RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
*
*
*
*
* @param source
* The source of the recommendation trigger.
*
* -
*
* ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
*
*
* -
*
* RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see RecommendationSourceType
*/
public RecommendationTrigger withSource(RecommendationSourceType source) {
this.source = source.toString();
return this;
}
/**
*
* The type of recommendation trigger.
*
*
* @param type
* The type of recommendation trigger.
* @see RecommendationTriggerType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of recommendation trigger.
*
*
* @return The type of recommendation trigger.
* @see RecommendationTriggerType
*/
public String getType() {
return this.type;
}
/**
*
* The type of recommendation trigger.
*
*
* @param type
* The type of recommendation trigger.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RecommendationTriggerType
*/
public RecommendationTrigger withType(String type) {
setType(type);
return this;
}
/**
*
* The type of recommendation trigger.
*
*
* @param type
* The type of recommendation trigger.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RecommendationTriggerType
*/
public RecommendationTrigger withType(RecommendationTriggerType type) {
this.type = type.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getData() != null)
sb.append("Data: ").append(getData()).append(",");
if (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getRecommendationIds() != null)
sb.append("RecommendationIds: ").append(getRecommendationIds()).append(",");
if (getSource() != null)
sb.append("Source: ").append(getSource()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RecommendationTrigger == false)
return false;
RecommendationTrigger other = (RecommendationTrigger) obj;
if (other.getData() == null ^ this.getData() == null)
return false;
if (other.getData() != null && other.getData().equals(this.getData()) == false)
return false;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getRecommendationIds() == null ^ this.getRecommendationIds() == null)
return false;
if (other.getRecommendationIds() != null && other.getRecommendationIds().equals(this.getRecommendationIds()) == false)
return false;
if (other.getSource() == null ^ this.getSource() == null)
return false;
if (other.getSource() != null && other.getSource().equals(this.getSource()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getData() == null) ? 0 : getData().hashCode());
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getRecommendationIds() == null) ? 0 : getRecommendationIds().hashCode());
hashCode = prime * hashCode + ((getSource() == null) ? 0 : getSource().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
return hashCode;
}
@Override
public RecommendationTrigger clone() {
try {
return (RecommendationTrigger) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.qconnect.model.transform.RecommendationTriggerMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}