
com.amazonaws.services.inspector2.model.TitleAggregation 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;
/**
*
* The details that define an aggregation based on finding title.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TitleAggregation implements Serializable, Cloneable, StructuredPojo {
/**
*
* The type of finding to aggregate on.
*
*/
private String findingType;
/**
*
* The resource type to aggregate on.
*
*/
private String resourceType;
/**
*
* The value to sort results by.
*
*/
private String sortBy;
/**
*
* The order to sort results by.
*
*/
private String sortOrder;
/**
*
* The finding titles to aggregate on.
*
*/
private java.util.List titles;
/**
*
* The vulnerability IDs of the findings.
*
*/
private java.util.List vulnerabilityIds;
/**
*
* The type of finding to aggregate on.
*
*
* @param findingType
* The type of finding to aggregate on.
* @see AggregationFindingType
*/
public void setFindingType(String findingType) {
this.findingType = findingType;
}
/**
*
* The type of finding to aggregate on.
*
*
* @return The type of finding to aggregate on.
* @see AggregationFindingType
*/
public String getFindingType() {
return this.findingType;
}
/**
*
* The type of finding to aggregate on.
*
*
* @param findingType
* The type of finding to aggregate on.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AggregationFindingType
*/
public TitleAggregation withFindingType(String findingType) {
setFindingType(findingType);
return this;
}
/**
*
* The type of finding to aggregate on.
*
*
* @param findingType
* The type of finding to aggregate on.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AggregationFindingType
*/
public TitleAggregation withFindingType(AggregationFindingType findingType) {
this.findingType = findingType.toString();
return this;
}
/**
*
* The resource type to aggregate on.
*
*
* @param resourceType
* The resource type to aggregate on.
* @see AggregationResourceType
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The resource type to aggregate on.
*
*
* @return The resource type to aggregate on.
* @see AggregationResourceType
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The resource type to aggregate on.
*
*
* @param resourceType
* The resource type to aggregate on.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AggregationResourceType
*/
public TitleAggregation withResourceType(String resourceType) {
setResourceType(resourceType);
return this;
}
/**
*
* The resource type to aggregate on.
*
*
* @param resourceType
* The resource type to aggregate on.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AggregationResourceType
*/
public TitleAggregation withResourceType(AggregationResourceType resourceType) {
this.resourceType = resourceType.toString();
return this;
}
/**
*
* The value to sort results by.
*
*
* @param sortBy
* The value to sort results by.
* @see TitleSortBy
*/
public void setSortBy(String sortBy) {
this.sortBy = sortBy;
}
/**
*
* The value to sort results by.
*
*
* @return The value to sort results by.
* @see TitleSortBy
*/
public String getSortBy() {
return this.sortBy;
}
/**
*
* The value to sort results by.
*
*
* @param sortBy
* The value to sort results by.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TitleSortBy
*/
public TitleAggregation withSortBy(String sortBy) {
setSortBy(sortBy);
return this;
}
/**
*
* The value to sort results by.
*
*
* @param sortBy
* The value to sort results by.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TitleSortBy
*/
public TitleAggregation withSortBy(TitleSortBy sortBy) {
this.sortBy = sortBy.toString();
return this;
}
/**
*
* The order to sort results by.
*
*
* @param sortOrder
* The order to sort results by.
* @see SortOrder
*/
public void setSortOrder(String sortOrder) {
this.sortOrder = sortOrder;
}
/**
*
* The order to sort results by.
*
*
* @return The order to sort results by.
* @see SortOrder
*/
public String getSortOrder() {
return this.sortOrder;
}
/**
*
* The order to sort results by.
*
*
* @param sortOrder
* The order to sort results by.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SortOrder
*/
public TitleAggregation withSortOrder(String sortOrder) {
setSortOrder(sortOrder);
return this;
}
/**
*
* The order to sort results by.
*
*
* @param sortOrder
* The order to sort results by.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SortOrder
*/
public TitleAggregation withSortOrder(SortOrder sortOrder) {
this.sortOrder = sortOrder.toString();
return this;
}
/**
*
* The finding titles to aggregate on.
*
*
* @return The finding titles to aggregate on.
*/
public java.util.List getTitles() {
return titles;
}
/**
*
* The finding titles to aggregate on.
*
*
* @param titles
* The finding titles to aggregate on.
*/
public void setTitles(java.util.Collection titles) {
if (titles == null) {
this.titles = null;
return;
}
this.titles = new java.util.ArrayList(titles);
}
/**
*
* The finding titles to aggregate on.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTitles(java.util.Collection)} or {@link #withTitles(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param titles
* The finding titles to aggregate on.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TitleAggregation withTitles(StringFilter... titles) {
if (this.titles == null) {
setTitles(new java.util.ArrayList(titles.length));
}
for (StringFilter ele : titles) {
this.titles.add(ele);
}
return this;
}
/**
*
* The finding titles to aggregate on.
*
*
* @param titles
* The finding titles to aggregate on.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TitleAggregation withTitles(java.util.Collection titles) {
setTitles(titles);
return this;
}
/**
*
* The vulnerability IDs of the findings.
*
*
* @return The vulnerability IDs of the findings.
*/
public java.util.List getVulnerabilityIds() {
return vulnerabilityIds;
}
/**
*
* The vulnerability IDs of the findings.
*
*
* @param vulnerabilityIds
* The vulnerability IDs of the findings.
*/
public void setVulnerabilityIds(java.util.Collection vulnerabilityIds) {
if (vulnerabilityIds == null) {
this.vulnerabilityIds = null;
return;
}
this.vulnerabilityIds = new java.util.ArrayList(vulnerabilityIds);
}
/**
*
* The vulnerability IDs of the findings.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setVulnerabilityIds(java.util.Collection)} or {@link #withVulnerabilityIds(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param vulnerabilityIds
* The vulnerability IDs of the findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TitleAggregation withVulnerabilityIds(StringFilter... vulnerabilityIds) {
if (this.vulnerabilityIds == null) {
setVulnerabilityIds(new java.util.ArrayList(vulnerabilityIds.length));
}
for (StringFilter ele : vulnerabilityIds) {
this.vulnerabilityIds.add(ele);
}
return this;
}
/**
*
* The vulnerability IDs of the findings.
*
*
* @param vulnerabilityIds
* The vulnerability IDs of the findings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TitleAggregation withVulnerabilityIds(java.util.Collection vulnerabilityIds) {
setVulnerabilityIds(vulnerabilityIds);
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 (getFindingType() != null)
sb.append("FindingType: ").append(getFindingType()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType()).append(",");
if (getSortBy() != null)
sb.append("SortBy: ").append(getSortBy()).append(",");
if (getSortOrder() != null)
sb.append("SortOrder: ").append(getSortOrder()).append(",");
if (getTitles() != null)
sb.append("Titles: ").append(getTitles()).append(",");
if (getVulnerabilityIds() != null)
sb.append("VulnerabilityIds: ").append(getVulnerabilityIds());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TitleAggregation == false)
return false;
TitleAggregation other = (TitleAggregation) obj;
if (other.getFindingType() == null ^ this.getFindingType() == null)
return false;
if (other.getFindingType() != null && other.getFindingType().equals(this.getFindingType()) == false)
return false;
if (other.getResourceType() == null ^ this.getResourceType() == null)
return false;
if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == 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;
if (other.getTitles() == null ^ this.getTitles() == null)
return false;
if (other.getTitles() != null && other.getTitles().equals(this.getTitles()) == false)
return false;
if (other.getVulnerabilityIds() == null ^ this.getVulnerabilityIds() == null)
return false;
if (other.getVulnerabilityIds() != null && other.getVulnerabilityIds().equals(this.getVulnerabilityIds()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFindingType() == null) ? 0 : getFindingType().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
hashCode = prime * hashCode + ((getSortBy() == null) ? 0 : getSortBy().hashCode());
hashCode = prime * hashCode + ((getSortOrder() == null) ? 0 : getSortOrder().hashCode());
hashCode = prime * hashCode + ((getTitles() == null) ? 0 : getTitles().hashCode());
hashCode = prime * hashCode + ((getVulnerabilityIds() == null) ? 0 : getVulnerabilityIds().hashCode());
return hashCode;
}
@Override
public TitleAggregation clone() {
try {
return (TitleAggregation) 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.TitleAggregationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}