com.amazonaws.services.inspector2.model.AwsEcrContainerAggregation Maven / Gradle / Ivy
Show all versions of aws-java-sdk-inspector2 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.inspector2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* An aggregation of information about Amazon ECR containers.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AwsEcrContainerAggregation implements Serializable, Cloneable, StructuredPojo {
/**
*
* The architecture of the containers.
*
*/
private java.util.List architectures;
/**
*
* The image SHA values.
*
*/
private java.util.List imageShas;
/**
*
* The image tags.
*
*/
private java.util.List imageTags;
/**
*
* The container repositories.
*
*/
private java.util.List repositories;
/**
*
* The container resource IDs.
*
*/
private java.util.List resourceIds;
/**
*
* The value to sort by.
*
*/
private String sortBy;
/**
*
* The sort order (ascending or descending).
*
*/
private String sortOrder;
/**
*
* The architecture of the containers.
*
*
* @return The architecture of the containers.
*/
public java.util.List getArchitectures() {
return architectures;
}
/**
*
* The architecture of the containers.
*
*
* @param architectures
* The architecture of the containers.
*/
public void setArchitectures(java.util.Collection architectures) {
if (architectures == null) {
this.architectures = null;
return;
}
this.architectures = new java.util.ArrayList(architectures);
}
/**
*
* The architecture of the containers.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setArchitectures(java.util.Collection)} or {@link #withArchitectures(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param architectures
* The architecture of the containers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withArchitectures(StringFilter... architectures) {
if (this.architectures == null) {
setArchitectures(new java.util.ArrayList(architectures.length));
}
for (StringFilter ele : architectures) {
this.architectures.add(ele);
}
return this;
}
/**
*
* The architecture of the containers.
*
*
* @param architectures
* The architecture of the containers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withArchitectures(java.util.Collection architectures) {
setArchitectures(architectures);
return this;
}
/**
*
* The image SHA values.
*
*
* @return The image SHA values.
*/
public java.util.List getImageShas() {
return imageShas;
}
/**
*
* The image SHA values.
*
*
* @param imageShas
* The image SHA values.
*/
public void setImageShas(java.util.Collection imageShas) {
if (imageShas == null) {
this.imageShas = null;
return;
}
this.imageShas = new java.util.ArrayList(imageShas);
}
/**
*
* The image SHA values.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setImageShas(java.util.Collection)} or {@link #withImageShas(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param imageShas
* The image SHA values.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withImageShas(StringFilter... imageShas) {
if (this.imageShas == null) {
setImageShas(new java.util.ArrayList(imageShas.length));
}
for (StringFilter ele : imageShas) {
this.imageShas.add(ele);
}
return this;
}
/**
*
* The image SHA values.
*
*
* @param imageShas
* The image SHA values.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withImageShas(java.util.Collection imageShas) {
setImageShas(imageShas);
return this;
}
/**
*
* The image tags.
*
*
* @return The image tags.
*/
public java.util.List getImageTags() {
return imageTags;
}
/**
*
* The image tags.
*
*
* @param imageTags
* The image tags.
*/
public void setImageTags(java.util.Collection imageTags) {
if (imageTags == null) {
this.imageTags = null;
return;
}
this.imageTags = new java.util.ArrayList(imageTags);
}
/**
*
* The image tags.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setImageTags(java.util.Collection)} or {@link #withImageTags(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param imageTags
* The image tags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withImageTags(StringFilter... imageTags) {
if (this.imageTags == null) {
setImageTags(new java.util.ArrayList(imageTags.length));
}
for (StringFilter ele : imageTags) {
this.imageTags.add(ele);
}
return this;
}
/**
*
* The image tags.
*
*
* @param imageTags
* The image tags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withImageTags(java.util.Collection imageTags) {
setImageTags(imageTags);
return this;
}
/**
*
* The container repositories.
*
*
* @return The container repositories.
*/
public java.util.List getRepositories() {
return repositories;
}
/**
*
* The container repositories.
*
*
* @param repositories
* The container repositories.
*/
public void setRepositories(java.util.Collection repositories) {
if (repositories == null) {
this.repositories = null;
return;
}
this.repositories = new java.util.ArrayList(repositories);
}
/**
*
* The container repositories.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRepositories(java.util.Collection)} or {@link #withRepositories(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param repositories
* The container repositories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withRepositories(StringFilter... repositories) {
if (this.repositories == null) {
setRepositories(new java.util.ArrayList(repositories.length));
}
for (StringFilter ele : repositories) {
this.repositories.add(ele);
}
return this;
}
/**
*
* The container repositories.
*
*
* @param repositories
* The container repositories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withRepositories(java.util.Collection repositories) {
setRepositories(repositories);
return this;
}
/**
*
* The container resource IDs.
*
*
* @return The container resource IDs.
*/
public java.util.List getResourceIds() {
return resourceIds;
}
/**
*
* The container resource IDs.
*
*
* @param resourceIds
* The container resource IDs.
*/
public void setResourceIds(java.util.Collection resourceIds) {
if (resourceIds == null) {
this.resourceIds = null;
return;
}
this.resourceIds = new java.util.ArrayList(resourceIds);
}
/**
*
* The container resource IDs.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResourceIds(java.util.Collection)} or {@link #withResourceIds(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param resourceIds
* The container resource IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withResourceIds(StringFilter... resourceIds) {
if (this.resourceIds == null) {
setResourceIds(new java.util.ArrayList(resourceIds.length));
}
for (StringFilter ele : resourceIds) {
this.resourceIds.add(ele);
}
return this;
}
/**
*
* The container resource IDs.
*
*
* @param resourceIds
* The container resource IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEcrContainerAggregation withResourceIds(java.util.Collection resourceIds) {
setResourceIds(resourceIds);
return this;
}
/**
*
* The value to sort by.
*
*
* @param sortBy
* The value to sort by.
* @see AwsEcrContainerSortBy
*/
public void setSortBy(String sortBy) {
this.sortBy = sortBy;
}
/**
*
* The value to sort by.
*
*
* @return The value to sort by.
* @see AwsEcrContainerSortBy
*/
public String getSortBy() {
return this.sortBy;
}
/**
*
* The value to sort by.
*
*
* @param sortBy
* The value to sort by.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AwsEcrContainerSortBy
*/
public AwsEcrContainerAggregation withSortBy(String sortBy) {
setSortBy(sortBy);
return this;
}
/**
*
* The value to sort by.
*
*
* @param sortBy
* The value to sort by.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AwsEcrContainerSortBy
*/
public AwsEcrContainerAggregation withSortBy(AwsEcrContainerSortBy sortBy) {
this.sortBy = sortBy.toString();
return this;
}
/**
*
* The sort order (ascending or descending).
*
*
* @param sortOrder
* The sort order (ascending or descending).
* @see SortOrder
*/
public void setSortOrder(String sortOrder) {
this.sortOrder = sortOrder;
}
/**
*
* The sort order (ascending or descending).
*
*
* @return The sort order (ascending or descending).
* @see SortOrder
*/
public String getSortOrder() {
return this.sortOrder;
}
/**
*
* The sort order (ascending or descending).
*
*
* @param sortOrder
* The sort order (ascending or descending).
* @return Returns a reference to this object so that method calls can be chained together.
* @see SortOrder
*/
public AwsEcrContainerAggregation withSortOrder(String sortOrder) {
setSortOrder(sortOrder);
return this;
}
/**
*
* The sort order (ascending or descending).
*
*
* @param sortOrder
* The sort order (ascending or descending).
* @return Returns a reference to this object so that method calls can be chained together.
* @see SortOrder
*/
public AwsEcrContainerAggregation withSortOrder(SortOrder sortOrder) {
this.sortOrder = sortOrder.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 (getArchitectures() != null)
sb.append("Architectures: ").append(getArchitectures()).append(",");
if (getImageShas() != null)
sb.append("ImageShas: ").append(getImageShas()).append(",");
if (getImageTags() != null)
sb.append("ImageTags: ").append(getImageTags()).append(",");
if (getRepositories() != null)
sb.append("Repositories: ").append(getRepositories()).append(",");
if (getResourceIds() != null)
sb.append("ResourceIds: ").append(getResourceIds()).append(",");
if (getSortBy() != null)
sb.append("SortBy: ").append(getSortBy()).append(",");
if (getSortOrder() != null)
sb.append("SortOrder: ").append(getSortOrder());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsEcrContainerAggregation == false)
return false;
AwsEcrContainerAggregation other = (AwsEcrContainerAggregation) obj;
if (other.getArchitectures() == null ^ this.getArchitectures() == null)
return false;
if (other.getArchitectures() != null && other.getArchitectures().equals(this.getArchitectures()) == false)
return false;
if (other.getImageShas() == null ^ this.getImageShas() == null)
return false;
if (other.getImageShas() != null && other.getImageShas().equals(this.getImageShas()) == false)
return false;
if (other.getImageTags() == null ^ this.getImageTags() == null)
return false;
if (other.getImageTags() != null && other.getImageTags().equals(this.getImageTags()) == false)
return false;
if (other.getRepositories() == null ^ this.getRepositories() == null)
return false;
if (other.getRepositories() != null && other.getRepositories().equals(this.getRepositories()) == false)
return false;
if (other.getResourceIds() == null ^ this.getResourceIds() == null)
return false;
if (other.getResourceIds() != null && other.getResourceIds().equals(this.getResourceIds()) == false)
return false;
if (other.getSortBy() == null ^ this.getSortBy() == null)
return false;
if (other.getSortBy() != null && other.getSortBy().equals(this.getSortBy()) == false)
return false;
if (other.getSortOrder() == null ^ this.getSortOrder() == null)
return false;
if (other.getSortOrder() != null && other.getSortOrder().equals(this.getSortOrder()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArchitectures() == null) ? 0 : getArchitectures().hashCode());
hashCode = prime * hashCode + ((getImageShas() == null) ? 0 : getImageShas().hashCode());
hashCode = prime * hashCode + ((getImageTags() == null) ? 0 : getImageTags().hashCode());
hashCode = prime * hashCode + ((getRepositories() == null) ? 0 : getRepositories().hashCode());
hashCode = prime * hashCode + ((getResourceIds() == null) ? 0 : getResourceIds().hashCode());
hashCode = prime * hashCode + ((getSortBy() == null) ? 0 : getSortBy().hashCode());
hashCode = prime * hashCode + ((getSortOrder() == null) ? 0 : getSortOrder().hashCode());
return hashCode;
}
@Override
public AwsEcrContainerAggregation clone() {
try {
return (AwsEcrContainerAggregation) 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.inspector2.model.transform.AwsEcrContainerAggregationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}