com.amazonaws.services.frauddetector.model.RuleDetail Maven / Gradle / Ivy
Show all versions of aws-java-sdk-frauddetector 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.frauddetector.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The details of the rule.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RuleDetail implements Serializable, Cloneable, StructuredPojo {
/**
*
* The rule ID.
*
*/
private String ruleId;
/**
*
* The rule description.
*
*/
private String description;
/**
*
* The detector for which the rule is associated.
*
*/
private String detectorId;
/**
*
* The rule version.
*
*/
private String ruleVersion;
/**
*
* The rule expression.
*
*/
private String expression;
/**
*
* The rule language.
*
*/
private String language;
/**
*
* The rule outcomes.
*
*/
private java.util.List outcomes;
/**
*
* Timestamp of the last time the rule was updated.
*
*/
private String lastUpdatedTime;
/**
*
* The timestamp of when the rule was created.
*
*/
private String createdTime;
/**
*
* The rule ARN.
*
*/
private String arn;
/**
*
* The rule ID.
*
*
* @param ruleId
* The rule ID.
*/
public void setRuleId(String ruleId) {
this.ruleId = ruleId;
}
/**
*
* The rule ID.
*
*
* @return The rule ID.
*/
public String getRuleId() {
return this.ruleId;
}
/**
*
* The rule ID.
*
*
* @param ruleId
* The rule ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withRuleId(String ruleId) {
setRuleId(ruleId);
return this;
}
/**
*
* The rule description.
*
*
* @param description
* The rule description.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The rule description.
*
*
* @return The rule description.
*/
public String getDescription() {
return this.description;
}
/**
*
* The rule description.
*
*
* @param description
* The rule description.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The detector for which the rule is associated.
*
*
* @param detectorId
* The detector for which the rule is associated.
*/
public void setDetectorId(String detectorId) {
this.detectorId = detectorId;
}
/**
*
* The detector for which the rule is associated.
*
*
* @return The detector for which the rule is associated.
*/
public String getDetectorId() {
return this.detectorId;
}
/**
*
* The detector for which the rule is associated.
*
*
* @param detectorId
* The detector for which the rule is associated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withDetectorId(String detectorId) {
setDetectorId(detectorId);
return this;
}
/**
*
* The rule version.
*
*
* @param ruleVersion
* The rule version.
*/
public void setRuleVersion(String ruleVersion) {
this.ruleVersion = ruleVersion;
}
/**
*
* The rule version.
*
*
* @return The rule version.
*/
public String getRuleVersion() {
return this.ruleVersion;
}
/**
*
* The rule version.
*
*
* @param ruleVersion
* The rule version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withRuleVersion(String ruleVersion) {
setRuleVersion(ruleVersion);
return this;
}
/**
*
* The rule expression.
*
*
* @param expression
* The rule expression.
*/
public void setExpression(String expression) {
this.expression = expression;
}
/**
*
* The rule expression.
*
*
* @return The rule expression.
*/
public String getExpression() {
return this.expression;
}
/**
*
* The rule expression.
*
*
* @param expression
* The rule expression.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withExpression(String expression) {
setExpression(expression);
return this;
}
/**
*
* The rule language.
*
*
* @param language
* The rule language.
* @see Language
*/
public void setLanguage(String language) {
this.language = language;
}
/**
*
* The rule language.
*
*
* @return The rule language.
* @see Language
*/
public String getLanguage() {
return this.language;
}
/**
*
* The rule language.
*
*
* @param language
* The rule language.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Language
*/
public RuleDetail withLanguage(String language) {
setLanguage(language);
return this;
}
/**
*
* The rule language.
*
*
* @param language
* The rule language.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Language
*/
public RuleDetail withLanguage(Language language) {
this.language = language.toString();
return this;
}
/**
*
* The rule outcomes.
*
*
* @return The rule outcomes.
*/
public java.util.List getOutcomes() {
return outcomes;
}
/**
*
* The rule outcomes.
*
*
* @param outcomes
* The rule outcomes.
*/
public void setOutcomes(java.util.Collection outcomes) {
if (outcomes == null) {
this.outcomes = null;
return;
}
this.outcomes = new java.util.ArrayList(outcomes);
}
/**
*
* The rule outcomes.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setOutcomes(java.util.Collection)} or {@link #withOutcomes(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param outcomes
* The rule outcomes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withOutcomes(String... outcomes) {
if (this.outcomes == null) {
setOutcomes(new java.util.ArrayList(outcomes.length));
}
for (String ele : outcomes) {
this.outcomes.add(ele);
}
return this;
}
/**
*
* The rule outcomes.
*
*
* @param outcomes
* The rule outcomes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withOutcomes(java.util.Collection outcomes) {
setOutcomes(outcomes);
return this;
}
/**
*
* Timestamp of the last time the rule was updated.
*
*
* @param lastUpdatedTime
* Timestamp of the last time the rule was updated.
*/
public void setLastUpdatedTime(String lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}
/**
*
* Timestamp of the last time the rule was updated.
*
*
* @return Timestamp of the last time the rule was updated.
*/
public String getLastUpdatedTime() {
return this.lastUpdatedTime;
}
/**
*
* Timestamp of the last time the rule was updated.
*
*
* @param lastUpdatedTime
* Timestamp of the last time the rule was updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withLastUpdatedTime(String lastUpdatedTime) {
setLastUpdatedTime(lastUpdatedTime);
return this;
}
/**
*
* The timestamp of when the rule was created.
*
*
* @param createdTime
* The timestamp of when the rule was created.
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
*
* The timestamp of when the rule was created.
*
*
* @return The timestamp of when the rule was created.
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
*
* The timestamp of when the rule was created.
*
*
* @param createdTime
* The timestamp of when the rule was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withCreatedTime(String createdTime) {
setCreatedTime(createdTime);
return this;
}
/**
*
* The rule ARN.
*
*
* @param arn
* The rule ARN.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The rule ARN.
*
*
* @return The rule ARN.
*/
public String getArn() {
return this.arn;
}
/**
*
* The rule ARN.
*
*
* @param arn
* The rule ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleDetail withArn(String arn) {
setArn(arn);
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 (getRuleId() != null)
sb.append("RuleId: ").append(getRuleId()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getDetectorId() != null)
sb.append("DetectorId: ").append(getDetectorId()).append(",");
if (getRuleVersion() != null)
sb.append("RuleVersion: ").append(getRuleVersion()).append(",");
if (getExpression() != null)
sb.append("Expression: ").append("***Sensitive Data Redacted***").append(",");
if (getLanguage() != null)
sb.append("Language: ").append(getLanguage()).append(",");
if (getOutcomes() != null)
sb.append("Outcomes: ").append(getOutcomes()).append(",");
if (getLastUpdatedTime() != null)
sb.append("LastUpdatedTime: ").append(getLastUpdatedTime()).append(",");
if (getCreatedTime() != null)
sb.append("CreatedTime: ").append(getCreatedTime()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RuleDetail == false)
return false;
RuleDetail other = (RuleDetail) obj;
if (other.getRuleId() == null ^ this.getRuleId() == null)
return false;
if (other.getRuleId() != null && other.getRuleId().equals(this.getRuleId()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getDetectorId() == null ^ this.getDetectorId() == null)
return false;
if (other.getDetectorId() != null && other.getDetectorId().equals(this.getDetectorId()) == false)
return false;
if (other.getRuleVersion() == null ^ this.getRuleVersion() == null)
return false;
if (other.getRuleVersion() != null && other.getRuleVersion().equals(this.getRuleVersion()) == false)
return false;
if (other.getExpression() == null ^ this.getExpression() == null)
return false;
if (other.getExpression() != null && other.getExpression().equals(this.getExpression()) == false)
return false;
if (other.getLanguage() == null ^ this.getLanguage() == null)
return false;
if (other.getLanguage() != null && other.getLanguage().equals(this.getLanguage()) == false)
return false;
if (other.getOutcomes() == null ^ this.getOutcomes() == null)
return false;
if (other.getOutcomes() != null && other.getOutcomes().equals(this.getOutcomes()) == false)
return false;
if (other.getLastUpdatedTime() == null ^ this.getLastUpdatedTime() == null)
return false;
if (other.getLastUpdatedTime() != null && other.getLastUpdatedTime().equals(this.getLastUpdatedTime()) == false)
return false;
if (other.getCreatedTime() == null ^ this.getCreatedTime() == null)
return false;
if (other.getCreatedTime() != null && other.getCreatedTime().equals(this.getCreatedTime()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRuleId() == null) ? 0 : getRuleId().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getDetectorId() == null) ? 0 : getDetectorId().hashCode());
hashCode = prime * hashCode + ((getRuleVersion() == null) ? 0 : getRuleVersion().hashCode());
hashCode = prime * hashCode + ((getExpression() == null) ? 0 : getExpression().hashCode());
hashCode = prime * hashCode + ((getLanguage() == null) ? 0 : getLanguage().hashCode());
hashCode = prime * hashCode + ((getOutcomes() == null) ? 0 : getOutcomes().hashCode());
hashCode = prime * hashCode + ((getLastUpdatedTime() == null) ? 0 : getLastUpdatedTime().hashCode());
hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
return hashCode;
}
@Override
public RuleDetail clone() {
try {
return (RuleDetail) 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.frauddetector.model.transform.RuleDetailMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}