com.amazonaws.services.macie2.model.SearchResourcesCriteria Maven / Gradle / Ivy
Show all versions of aws-java-sdk-macie2 Show documentation
/*
* Copyright 2018-2023 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.macie2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Specifies a property- or tag-based filter condition for including or excluding Amazon Web Services resources from the
* query results.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SearchResourcesCriteria implements Serializable, Cloneable, StructuredPojo {
/**
*
* A property-based condition that defines a property, operator, and one or more values for including or excluding
* resources from the results.
*
*/
private SearchResourcesSimpleCriterion simpleCriterion;
/**
*
* A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including
* or excluding resources from the results.
*
*/
private SearchResourcesTagCriterion tagCriterion;
/**
*
* A property-based condition that defines a property, operator, and one or more values for including or excluding
* resources from the results.
*
*
* @param simpleCriterion
* A property-based condition that defines a property, operator, and one or more values for including or
* excluding resources from the results.
*/
public void setSimpleCriterion(SearchResourcesSimpleCriterion simpleCriterion) {
this.simpleCriterion = simpleCriterion;
}
/**
*
* A property-based condition that defines a property, operator, and one or more values for including or excluding
* resources from the results.
*
*
* @return A property-based condition that defines a property, operator, and one or more values for including or
* excluding resources from the results.
*/
public SearchResourcesSimpleCriterion getSimpleCriterion() {
return this.simpleCriterion;
}
/**
*
* A property-based condition that defines a property, operator, and one or more values for including or excluding
* resources from the results.
*
*
* @param simpleCriterion
* A property-based condition that defines a property, operator, and one or more values for including or
* excluding resources from the results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchResourcesCriteria withSimpleCriterion(SearchResourcesSimpleCriterion simpleCriterion) {
setSimpleCriterion(simpleCriterion);
return this;
}
/**
*
* A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including
* or excluding resources from the results.
*
*
* @param tagCriterion
* A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for
* including or excluding resources from the results.
*/
public void setTagCriterion(SearchResourcesTagCriterion tagCriterion) {
this.tagCriterion = tagCriterion;
}
/**
*
* A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including
* or excluding resources from the results.
*
*
* @return A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for
* including or excluding resources from the results.
*/
public SearchResourcesTagCriterion getTagCriterion() {
return this.tagCriterion;
}
/**
*
* A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including
* or excluding resources from the results.
*
*
* @param tagCriterion
* A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for
* including or excluding resources from the results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchResourcesCriteria withTagCriterion(SearchResourcesTagCriterion tagCriterion) {
setTagCriterion(tagCriterion);
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 (getSimpleCriterion() != null)
sb.append("SimpleCriterion: ").append(getSimpleCriterion()).append(",");
if (getTagCriterion() != null)
sb.append("TagCriterion: ").append(getTagCriterion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SearchResourcesCriteria == false)
return false;
SearchResourcesCriteria other = (SearchResourcesCriteria) obj;
if (other.getSimpleCriterion() == null ^ this.getSimpleCriterion() == null)
return false;
if (other.getSimpleCriterion() != null && other.getSimpleCriterion().equals(this.getSimpleCriterion()) == false)
return false;
if (other.getTagCriterion() == null ^ this.getTagCriterion() == null)
return false;
if (other.getTagCriterion() != null && other.getTagCriterion().equals(this.getTagCriterion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSimpleCriterion() == null) ? 0 : getSimpleCriterion().hashCode());
hashCode = prime * hashCode + ((getTagCriterion() == null) ? 0 : getTagCriterion().hashCode());
return hashCode;
}
@Override
public SearchResourcesCriteria clone() {
try {
return (SearchResourcesCriteria) 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.macie2.model.transform.SearchResourcesCriteriaMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}