com.amazonaws.services.frauddetector.model.EvaluatedRule 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 used for evaluating variable values.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EvaluatedRule implements Serializable, Cloneable, StructuredPojo {
/**
*
* The rule ID.
*
*/
private String ruleId;
/**
*
* The rule version.
*
*/
private String ruleVersion;
/**
*
* The rule expression.
*
*/
private String expression;
/**
*
* The rule expression value.
*
*/
private String expressionWithValues;
/**
*
* The rule outcome.
*
*/
private java.util.List outcomes;
/**
*
* Indicates whether the rule was evaluated.
*
*/
private Boolean evaluated;
/**
*
* Indicates whether the rule matched.
*
*/
private Boolean matched;
/**
*
* 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 EvaluatedRule withRuleId(String ruleId) {
setRuleId(ruleId);
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 EvaluatedRule 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 EvaluatedRule withExpression(String expression) {
setExpression(expression);
return this;
}
/**
*
* The rule expression value.
*
*
* @param expressionWithValues
* The rule expression value.
*/
public void setExpressionWithValues(String expressionWithValues) {
this.expressionWithValues = expressionWithValues;
}
/**
*
* The rule expression value.
*
*
* @return The rule expression value.
*/
public String getExpressionWithValues() {
return this.expressionWithValues;
}
/**
*
* The rule expression value.
*
*
* @param expressionWithValues
* The rule expression value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EvaluatedRule withExpressionWithValues(String expressionWithValues) {
setExpressionWithValues(expressionWithValues);
return this;
}
/**
*
* The rule outcome.
*
*
* @return The rule outcome.
*/
public java.util.List getOutcomes() {
return outcomes;
}
/**
*
* The rule outcome.
*
*
* @param outcomes
* The rule outcome.
*/
public void setOutcomes(java.util.Collection outcomes) {
if (outcomes == null) {
this.outcomes = null;
return;
}
this.outcomes = new java.util.ArrayList(outcomes);
}
/**
*
* The rule outcome.
*
*
* 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 outcome.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EvaluatedRule 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 outcome.
*
*
* @param outcomes
* The rule outcome.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EvaluatedRule withOutcomes(java.util.Collection outcomes) {
setOutcomes(outcomes);
return this;
}
/**
*
* Indicates whether the rule was evaluated.
*
*
* @param evaluated
* Indicates whether the rule was evaluated.
*/
public void setEvaluated(Boolean evaluated) {
this.evaluated = evaluated;
}
/**
*
* Indicates whether the rule was evaluated.
*
*
* @return Indicates whether the rule was evaluated.
*/
public Boolean getEvaluated() {
return this.evaluated;
}
/**
*
* Indicates whether the rule was evaluated.
*
*
* @param evaluated
* Indicates whether the rule was evaluated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EvaluatedRule withEvaluated(Boolean evaluated) {
setEvaluated(evaluated);
return this;
}
/**
*
* Indicates whether the rule was evaluated.
*
*
* @return Indicates whether the rule was evaluated.
*/
public Boolean isEvaluated() {
return this.evaluated;
}
/**
*
* Indicates whether the rule matched.
*
*
* @param matched
* Indicates whether the rule matched.
*/
public void setMatched(Boolean matched) {
this.matched = matched;
}
/**
*
* Indicates whether the rule matched.
*
*
* @return Indicates whether the rule matched.
*/
public Boolean getMatched() {
return this.matched;
}
/**
*
* Indicates whether the rule matched.
*
*
* @param matched
* Indicates whether the rule matched.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EvaluatedRule withMatched(Boolean matched) {
setMatched(matched);
return this;
}
/**
*
* Indicates whether the rule matched.
*
*
* @return Indicates whether the rule matched.
*/
public Boolean isMatched() {
return this.matched;
}
/**
* 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 (getRuleVersion() != null)
sb.append("RuleVersion: ").append(getRuleVersion()).append(",");
if (getExpression() != null)
sb.append("Expression: ").append("***Sensitive Data Redacted***").append(",");
if (getExpressionWithValues() != null)
sb.append("ExpressionWithValues: ").append("***Sensitive Data Redacted***").append(",");
if (getOutcomes() != null)
sb.append("Outcomes: ").append(getOutcomes()).append(",");
if (getEvaluated() != null)
sb.append("Evaluated: ").append(getEvaluated()).append(",");
if (getMatched() != null)
sb.append("Matched: ").append(getMatched());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EvaluatedRule == false)
return false;
EvaluatedRule other = (EvaluatedRule) obj;
if (other.getRuleId() == null ^ this.getRuleId() == null)
return false;
if (other.getRuleId() != null && other.getRuleId().equals(this.getRuleId()) == 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.getExpressionWithValues() == null ^ this.getExpressionWithValues() == null)
return false;
if (other.getExpressionWithValues() != null && other.getExpressionWithValues().equals(this.getExpressionWithValues()) == 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.getEvaluated() == null ^ this.getEvaluated() == null)
return false;
if (other.getEvaluated() != null && other.getEvaluated().equals(this.getEvaluated()) == false)
return false;
if (other.getMatched() == null ^ this.getMatched() == null)
return false;
if (other.getMatched() != null && other.getMatched().equals(this.getMatched()) == 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 + ((getRuleVersion() == null) ? 0 : getRuleVersion().hashCode());
hashCode = prime * hashCode + ((getExpression() == null) ? 0 : getExpression().hashCode());
hashCode = prime * hashCode + ((getExpressionWithValues() == null) ? 0 : getExpressionWithValues().hashCode());
hashCode = prime * hashCode + ((getOutcomes() == null) ? 0 : getOutcomes().hashCode());
hashCode = prime * hashCode + ((getEvaluated() == null) ? 0 : getEvaluated().hashCode());
hashCode = prime * hashCode + ((getMatched() == null) ? 0 : getMatched().hashCode());
return hashCode;
}
@Override
public EvaluatedRule clone() {
try {
return (EvaluatedRule) 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.EvaluatedRuleMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}