com.amazonaws.services.guardduty.model.Condition Maven / Gradle / Ivy
Show all versions of aws-java-sdk-guardduty 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.guardduty.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains information about the condition.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Condition implements Serializable, Cloneable, StructuredPojo {
/**
*
* Represents the equal condition to be applied to a single field when querying for findings.
*
*/
@Deprecated
private java.util.List eq;
/**
*
* Represents the not equal condition to be applied to a single field when querying for findings.
*
*/
@Deprecated
private java.util.List neq;
/**
*
* Represents a greater than condition to be applied to a single field when querying for findings.
*
*/
@Deprecated
private Integer gt;
/**
*
* Represents a greater than or equal condition to be applied to a single field when querying for findings.
*
*/
@Deprecated
private Integer gte;
/**
*
* Represents a less than condition to be applied to a single field when querying for findings.
*
*/
@Deprecated
private Integer lt;
/**
*
* Represents a less than or equal condition to be applied to a single field when querying for findings.
*
*/
@Deprecated
private Integer lte;
/**
*
* Represents an equal condition to be applied to a single field when querying for findings.
*
*/
private java.util.List equals;
/**
*
* Represents a not equal condition to be applied to a single field when querying for findings.
*
*/
private java.util.List notEquals;
/**
*
* Represents a greater than condition to be applied to a single field when querying for findings.
*
*/
private Long greaterThan;
/**
*
* Represents a greater than or equal condition to be applied to a single field when querying for findings.
*
*/
private Long greaterThanOrEqual;
/**
*
* Represents a less than condition to be applied to a single field when querying for findings.
*
*/
private Long lessThan;
/**
*
* Represents a less than or equal condition to be applied to a single field when querying for findings.
*
*/
private Long lessThanOrEqual;
/**
*
* Represents the equal condition to be applied to a single field when querying for findings.
*
*
* @return Represents the equal condition to be applied to a single field when querying for findings.
*/
@Deprecated
public java.util.List getEq() {
return eq;
}
/**
*
* Represents the equal condition to be applied to a single field when querying for findings.
*
*
* @param eq
* Represents the equal condition to be applied to a single field when querying for findings.
*/
@Deprecated
public void setEq(java.util.Collection eq) {
if (eq == null) {
this.eq = null;
return;
}
this.eq = new java.util.ArrayList(eq);
}
/**
*
* Represents the equal condition to be applied to a single field when querying for findings.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEq(java.util.Collection)} or {@link #withEq(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param eq
* Represents the equal condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public Condition withEq(String... eq) {
if (this.eq == null) {
setEq(new java.util.ArrayList(eq.length));
}
for (String ele : eq) {
this.eq.add(ele);
}
return this;
}
/**
*
* Represents the equal condition to be applied to a single field when querying for findings.
*
*
* @param eq
* Represents the equal condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public Condition withEq(java.util.Collection eq) {
setEq(eq);
return this;
}
/**
*
* Represents the not equal condition to be applied to a single field when querying for findings.
*
*
* @return Represents the not equal condition to be applied to a single field when querying for findings.
*/
@Deprecated
public java.util.List getNeq() {
return neq;
}
/**
*
* Represents the not equal condition to be applied to a single field when querying for findings.
*
*
* @param neq
* Represents the not equal condition to be applied to a single field when querying for findings.
*/
@Deprecated
public void setNeq(java.util.Collection neq) {
if (neq == null) {
this.neq = null;
return;
}
this.neq = new java.util.ArrayList(neq);
}
/**
*
* Represents the not equal condition to be applied to a single field when querying for findings.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setNeq(java.util.Collection)} or {@link #withNeq(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param neq
* Represents the not equal condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public Condition withNeq(String... neq) {
if (this.neq == null) {
setNeq(new java.util.ArrayList(neq.length));
}
for (String ele : neq) {
this.neq.add(ele);
}
return this;
}
/**
*
* Represents the not equal condition to be applied to a single field when querying for findings.
*
*
* @param neq
* Represents the not equal condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public Condition withNeq(java.util.Collection neq) {
setNeq(neq);
return this;
}
/**
*
* Represents a greater than condition to be applied to a single field when querying for findings.
*
*
* @param gt
* Represents a greater than condition to be applied to a single field when querying for findings.
*/
@Deprecated
public void setGt(Integer gt) {
this.gt = gt;
}
/**
*
* Represents a greater than condition to be applied to a single field when querying for findings.
*
*
* @return Represents a greater than condition to be applied to a single field when querying for findings.
*/
@Deprecated
public Integer getGt() {
return this.gt;
}
/**
*
* Represents a greater than condition to be applied to a single field when querying for findings.
*
*
* @param gt
* Represents a greater than condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public Condition withGt(Integer gt) {
setGt(gt);
return this;
}
/**
*
* Represents a greater than or equal condition to be applied to a single field when querying for findings.
*
*
* @param gte
* Represents a greater than or equal condition to be applied to a single field when querying for
* findings.
*/
@Deprecated
public void setGte(Integer gte) {
this.gte = gte;
}
/**
*
* Represents a greater than or equal condition to be applied to a single field when querying for findings.
*
*
* @return Represents a greater than or equal condition to be applied to a single field when querying for
* findings.
*/
@Deprecated
public Integer getGte() {
return this.gte;
}
/**
*
* Represents a greater than or equal condition to be applied to a single field when querying for findings.
*
*
* @param gte
* Represents a greater than or equal condition to be applied to a single field when querying for
* findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public Condition withGte(Integer gte) {
setGte(gte);
return this;
}
/**
*
* Represents a less than condition to be applied to a single field when querying for findings.
*
*
* @param lt
* Represents a less than condition to be applied to a single field when querying for findings.
*/
@Deprecated
public void setLt(Integer lt) {
this.lt = lt;
}
/**
*
* Represents a less than condition to be applied to a single field when querying for findings.
*
*
* @return Represents a less than condition to be applied to a single field when querying for findings.
*/
@Deprecated
public Integer getLt() {
return this.lt;
}
/**
*
* Represents a less than condition to be applied to a single field when querying for findings.
*
*
* @param lt
* Represents a less than condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public Condition withLt(Integer lt) {
setLt(lt);
return this;
}
/**
*
* Represents a less than or equal condition to be applied to a single field when querying for findings.
*
*
* @param lte
* Represents a less than or equal condition to be applied to a single field when querying for
* findings.
*/
@Deprecated
public void setLte(Integer lte) {
this.lte = lte;
}
/**
*
* Represents a less than or equal condition to be applied to a single field when querying for findings.
*
*
* @return Represents a less than or equal condition to be applied to a single field when querying for
* findings.
*/
@Deprecated
public Integer getLte() {
return this.lte;
}
/**
*
* Represents a less than or equal condition to be applied to a single field when querying for findings.
*
*
* @param lte
* Represents a less than or equal condition to be applied to a single field when querying for
* findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public Condition withLte(Integer lte) {
setLte(lte);
return this;
}
/**
*
* Represents an equal condition to be applied to a single field when querying for findings.
*
*
* @return Represents an equal condition to be applied to a single field when querying for findings.
*/
public java.util.List getEquals() {
return equals;
}
/**
*
* Represents an equal condition to be applied to a single field when querying for findings.
*
*
* @param equals
* Represents an equal condition to be applied to a single field when querying for findings.
*/
public void setEquals(java.util.Collection equals) {
if (equals == null) {
this.equals = null;
return;
}
this.equals = new java.util.ArrayList(equals);
}
/**
*
* Represents an equal condition to be applied to a single field when querying for findings.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEquals(java.util.Collection)} or {@link #withEquals(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param equals
* Represents an equal condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Condition withEquals(String... equals) {
if (this.equals == null) {
setEquals(new java.util.ArrayList(equals.length));
}
for (String ele : equals) {
this.equals.add(ele);
}
return this;
}
/**
*
* Represents an equal condition to be applied to a single field when querying for findings.
*
*
* @param equals
* Represents an equal condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Condition withEquals(java.util.Collection equals) {
setEquals(equals);
return this;
}
/**
*
* Represents a not equal condition to be applied to a single field when querying for findings.
*
*
* @return Represents a not equal condition to be applied to a single field when querying for findings.
*/
public java.util.List getNotEquals() {
return notEquals;
}
/**
*
* Represents a not equal condition to be applied to a single field when querying for findings.
*
*
* @param notEquals
* Represents a not equal condition to be applied to a single field when querying for findings.
*/
public void setNotEquals(java.util.Collection notEquals) {
if (notEquals == null) {
this.notEquals = null;
return;
}
this.notEquals = new java.util.ArrayList(notEquals);
}
/**
*
* Represents a not equal condition to be applied to a single field when querying for findings.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setNotEquals(java.util.Collection)} or {@link #withNotEquals(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param notEquals
* Represents a not equal condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Condition withNotEquals(String... notEquals) {
if (this.notEquals == null) {
setNotEquals(new java.util.ArrayList(notEquals.length));
}
for (String ele : notEquals) {
this.notEquals.add(ele);
}
return this;
}
/**
*
* Represents a not equal condition to be applied to a single field when querying for findings.
*
*
* @param notEquals
* Represents a not equal condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Condition withNotEquals(java.util.Collection notEquals) {
setNotEquals(notEquals);
return this;
}
/**
*
* Represents a greater than condition to be applied to a single field when querying for findings.
*
*
* @param greaterThan
* Represents a greater than condition to be applied to a single field when querying for findings.
*/
public void setGreaterThan(Long greaterThan) {
this.greaterThan = greaterThan;
}
/**
*
* Represents a greater than condition to be applied to a single field when querying for findings.
*
*
* @return Represents a greater than condition to be applied to a single field when querying for findings.
*/
public Long getGreaterThan() {
return this.greaterThan;
}
/**
*
* Represents a greater than condition to be applied to a single field when querying for findings.
*
*
* @param greaterThan
* Represents a greater than condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Condition withGreaterThan(Long greaterThan) {
setGreaterThan(greaterThan);
return this;
}
/**
*
* Represents a greater than or equal condition to be applied to a single field when querying for findings.
*
*
* @param greaterThanOrEqual
* Represents a greater than or equal condition to be applied to a single field when querying for
* findings.
*/
public void setGreaterThanOrEqual(Long greaterThanOrEqual) {
this.greaterThanOrEqual = greaterThanOrEqual;
}
/**
*
* Represents a greater than or equal condition to be applied to a single field when querying for findings.
*
*
* @return Represents a greater than or equal condition to be applied to a single field when querying for
* findings.
*/
public Long getGreaterThanOrEqual() {
return this.greaterThanOrEqual;
}
/**
*
* Represents a greater than or equal condition to be applied to a single field when querying for findings.
*
*
* @param greaterThanOrEqual
* Represents a greater than or equal condition to be applied to a single field when querying for
* findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Condition withGreaterThanOrEqual(Long greaterThanOrEqual) {
setGreaterThanOrEqual(greaterThanOrEqual);
return this;
}
/**
*
* Represents a less than condition to be applied to a single field when querying for findings.
*
*
* @param lessThan
* Represents a less than condition to be applied to a single field when querying for findings.
*/
public void setLessThan(Long lessThan) {
this.lessThan = lessThan;
}
/**
*
* Represents a less than condition to be applied to a single field when querying for findings.
*
*
* @return Represents a less than condition to be applied to a single field when querying for findings.
*/
public Long getLessThan() {
return this.lessThan;
}
/**
*
* Represents a less than condition to be applied to a single field when querying for findings.
*
*
* @param lessThan
* Represents a less than condition to be applied to a single field when querying for findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Condition withLessThan(Long lessThan) {
setLessThan(lessThan);
return this;
}
/**
*
* Represents a less than or equal condition to be applied to a single field when querying for findings.
*
*
* @param lessThanOrEqual
* Represents a less than or equal condition to be applied to a single field when querying for
* findings.
*/
public void setLessThanOrEqual(Long lessThanOrEqual) {
this.lessThanOrEqual = lessThanOrEqual;
}
/**
*
* Represents a less than or equal condition to be applied to a single field when querying for findings.
*
*
* @return Represents a less than or equal condition to be applied to a single field when querying for
* findings.
*/
public Long getLessThanOrEqual() {
return this.lessThanOrEqual;
}
/**
*
* Represents a less than or equal condition to be applied to a single field when querying for findings.
*
*
* @param lessThanOrEqual
* Represents a less than or equal condition to be applied to a single field when querying for
* findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Condition withLessThanOrEqual(Long lessThanOrEqual) {
setLessThanOrEqual(lessThanOrEqual);
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 (getEq() != null)
sb.append("Eq: ").append(getEq()).append(",");
if (getNeq() != null)
sb.append("Neq: ").append(getNeq()).append(",");
if (getGt() != null)
sb.append("Gt: ").append(getGt()).append(",");
if (getGte() != null)
sb.append("Gte: ").append(getGte()).append(",");
if (getLt() != null)
sb.append("Lt: ").append(getLt()).append(",");
if (getLte() != null)
sb.append("Lte: ").append(getLte()).append(",");
if (getEquals() != null)
sb.append("Equals: ").append(getEquals()).append(",");
if (getNotEquals() != null)
sb.append("NotEquals: ").append(getNotEquals()).append(",");
if (getGreaterThan() != null)
sb.append("GreaterThan: ").append(getGreaterThan()).append(",");
if (getGreaterThanOrEqual() != null)
sb.append("GreaterThanOrEqual: ").append(getGreaterThanOrEqual()).append(",");
if (getLessThan() != null)
sb.append("LessThan: ").append(getLessThan()).append(",");
if (getLessThanOrEqual() != null)
sb.append("LessThanOrEqual: ").append(getLessThanOrEqual());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Condition == false)
return false;
Condition other = (Condition) obj;
if (other.getEq() == null ^ this.getEq() == null)
return false;
if (other.getEq() != null && other.getEq().equals(this.getEq()) == false)
return false;
if (other.getNeq() == null ^ this.getNeq() == null)
return false;
if (other.getNeq() != null && other.getNeq().equals(this.getNeq()) == false)
return false;
if (other.getGt() == null ^ this.getGt() == null)
return false;
if (other.getGt() != null && other.getGt().equals(this.getGt()) == false)
return false;
if (other.getGte() == null ^ this.getGte() == null)
return false;
if (other.getGte() != null && other.getGte().equals(this.getGte()) == false)
return false;
if (other.getLt() == null ^ this.getLt() == null)
return false;
if (other.getLt() != null && other.getLt().equals(this.getLt()) == false)
return false;
if (other.getLte() == null ^ this.getLte() == null)
return false;
if (other.getLte() != null && other.getLte().equals(this.getLte()) == false)
return false;
if (other.getEquals() == null ^ this.getEquals() == null)
return false;
if (other.getEquals() != null && other.getEquals().equals(this.getEquals()) == false)
return false;
if (other.getNotEquals() == null ^ this.getNotEquals() == null)
return false;
if (other.getNotEquals() != null && other.getNotEquals().equals(this.getNotEquals()) == false)
return false;
if (other.getGreaterThan() == null ^ this.getGreaterThan() == null)
return false;
if (other.getGreaterThan() != null && other.getGreaterThan().equals(this.getGreaterThan()) == false)
return false;
if (other.getGreaterThanOrEqual() == null ^ this.getGreaterThanOrEqual() == null)
return false;
if (other.getGreaterThanOrEqual() != null && other.getGreaterThanOrEqual().equals(this.getGreaterThanOrEqual()) == false)
return false;
if (other.getLessThan() == null ^ this.getLessThan() == null)
return false;
if (other.getLessThan() != null && other.getLessThan().equals(this.getLessThan()) == false)
return false;
if (other.getLessThanOrEqual() == null ^ this.getLessThanOrEqual() == null)
return false;
if (other.getLessThanOrEqual() != null && other.getLessThanOrEqual().equals(this.getLessThanOrEqual()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEq() == null) ? 0 : getEq().hashCode());
hashCode = prime * hashCode + ((getNeq() == null) ? 0 : getNeq().hashCode());
hashCode = prime * hashCode + ((getGt() == null) ? 0 : getGt().hashCode());
hashCode = prime * hashCode + ((getGte() == null) ? 0 : getGte().hashCode());
hashCode = prime * hashCode + ((getLt() == null) ? 0 : getLt().hashCode());
hashCode = prime * hashCode + ((getLte() == null) ? 0 : getLte().hashCode());
hashCode = prime * hashCode + ((getEquals() == null) ? 0 : getEquals().hashCode());
hashCode = prime * hashCode + ((getNotEquals() == null) ? 0 : getNotEquals().hashCode());
hashCode = prime * hashCode + ((getGreaterThan() == null) ? 0 : getGreaterThan().hashCode());
hashCode = prime * hashCode + ((getGreaterThanOrEqual() == null) ? 0 : getGreaterThanOrEqual().hashCode());
hashCode = prime * hashCode + ((getLessThan() == null) ? 0 : getLessThan().hashCode());
hashCode = prime * hashCode + ((getLessThanOrEqual() == null) ? 0 : getLessThanOrEqual().hashCode());
return hashCode;
}
@Override
public Condition clone() {
try {
return (Condition) 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.guardduty.model.transform.ConditionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}