com.amazonaws.services.ecr.model.PackageVulnerabilityDetails Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ecr 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.ecr.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about a package vulnerability finding.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PackageVulnerabilityDetails implements Serializable, Cloneable, StructuredPojo {
/**
*
* An object that contains details about the CVSS score of a finding.
*
*/
private java.util.List cvss;
/**
*
* One or more URLs that contain details about this vulnerability type.
*
*/
private java.util.List referenceUrls;
/**
*
* One or more vulnerabilities related to the one identified in this finding.
*
*/
private java.util.List relatedVulnerabilities;
/**
*
* The source of the vulnerability information.
*
*/
private String source;
/**
*
* A URL to the source of the vulnerability information.
*
*/
private String sourceUrl;
/**
*
* The date and time that this vulnerability was first added to the vendor's database.
*
*/
private java.util.Date vendorCreatedAt;
/**
*
* The severity the vendor has given to this vulnerability type.
*
*/
private String vendorSeverity;
/**
*
* The date and time the vendor last updated this vulnerability in their database.
*
*/
private java.util.Date vendorUpdatedAt;
/**
*
* The ID given to this vulnerability.
*
*/
private String vulnerabilityId;
/**
*
* The packages impacted by this vulnerability.
*
*/
private java.util.List vulnerablePackages;
/**
*
* An object that contains details about the CVSS score of a finding.
*
*
* @return An object that contains details about the CVSS score of a finding.
*/
public java.util.List getCvss() {
return cvss;
}
/**
*
* An object that contains details about the CVSS score of a finding.
*
*
* @param cvss
* An object that contains details about the CVSS score of a finding.
*/
public void setCvss(java.util.Collection cvss) {
if (cvss == null) {
this.cvss = null;
return;
}
this.cvss = new java.util.ArrayList(cvss);
}
/**
*
* An object that contains details about the CVSS score of a finding.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCvss(java.util.Collection)} or {@link #withCvss(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param cvss
* An object that contains details about the CVSS score of a finding.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withCvss(CvssScore... cvss) {
if (this.cvss == null) {
setCvss(new java.util.ArrayList(cvss.length));
}
for (CvssScore ele : cvss) {
this.cvss.add(ele);
}
return this;
}
/**
*
* An object that contains details about the CVSS score of a finding.
*
*
* @param cvss
* An object that contains details about the CVSS score of a finding.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withCvss(java.util.Collection cvss) {
setCvss(cvss);
return this;
}
/**
*
* One or more URLs that contain details about this vulnerability type.
*
*
* @return One or more URLs that contain details about this vulnerability type.
*/
public java.util.List getReferenceUrls() {
return referenceUrls;
}
/**
*
* One or more URLs that contain details about this vulnerability type.
*
*
* @param referenceUrls
* One or more URLs that contain details about this vulnerability type.
*/
public void setReferenceUrls(java.util.Collection referenceUrls) {
if (referenceUrls == null) {
this.referenceUrls = null;
return;
}
this.referenceUrls = new java.util.ArrayList(referenceUrls);
}
/**
*
* One or more URLs that contain details about this vulnerability type.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setReferenceUrls(java.util.Collection)} or {@link #withReferenceUrls(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param referenceUrls
* One or more URLs that contain details about this vulnerability type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withReferenceUrls(String... referenceUrls) {
if (this.referenceUrls == null) {
setReferenceUrls(new java.util.ArrayList(referenceUrls.length));
}
for (String ele : referenceUrls) {
this.referenceUrls.add(ele);
}
return this;
}
/**
*
* One or more URLs that contain details about this vulnerability type.
*
*
* @param referenceUrls
* One or more URLs that contain details about this vulnerability type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withReferenceUrls(java.util.Collection referenceUrls) {
setReferenceUrls(referenceUrls);
return this;
}
/**
*
* One or more vulnerabilities related to the one identified in this finding.
*
*
* @return One or more vulnerabilities related to the one identified in this finding.
*/
public java.util.List getRelatedVulnerabilities() {
return relatedVulnerabilities;
}
/**
*
* One or more vulnerabilities related to the one identified in this finding.
*
*
* @param relatedVulnerabilities
* One or more vulnerabilities related to the one identified in this finding.
*/
public void setRelatedVulnerabilities(java.util.Collection relatedVulnerabilities) {
if (relatedVulnerabilities == null) {
this.relatedVulnerabilities = null;
return;
}
this.relatedVulnerabilities = new java.util.ArrayList(relatedVulnerabilities);
}
/**
*
* One or more vulnerabilities related to the one identified in this finding.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRelatedVulnerabilities(java.util.Collection)} or
* {@link #withRelatedVulnerabilities(java.util.Collection)} if you want to override the existing values.
*
*
* @param relatedVulnerabilities
* One or more vulnerabilities related to the one identified in this finding.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withRelatedVulnerabilities(String... relatedVulnerabilities) {
if (this.relatedVulnerabilities == null) {
setRelatedVulnerabilities(new java.util.ArrayList(relatedVulnerabilities.length));
}
for (String ele : relatedVulnerabilities) {
this.relatedVulnerabilities.add(ele);
}
return this;
}
/**
*
* One or more vulnerabilities related to the one identified in this finding.
*
*
* @param relatedVulnerabilities
* One or more vulnerabilities related to the one identified in this finding.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withRelatedVulnerabilities(java.util.Collection relatedVulnerabilities) {
setRelatedVulnerabilities(relatedVulnerabilities);
return this;
}
/**
*
* The source of the vulnerability information.
*
*
* @param source
* The source of the vulnerability information.
*/
public void setSource(String source) {
this.source = source;
}
/**
*
* The source of the vulnerability information.
*
*
* @return The source of the vulnerability information.
*/
public String getSource() {
return this.source;
}
/**
*
* The source of the vulnerability information.
*
*
* @param source
* The source of the vulnerability information.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withSource(String source) {
setSource(source);
return this;
}
/**
*
* A URL to the source of the vulnerability information.
*
*
* @param sourceUrl
* A URL to the source of the vulnerability information.
*/
public void setSourceUrl(String sourceUrl) {
this.sourceUrl = sourceUrl;
}
/**
*
* A URL to the source of the vulnerability information.
*
*
* @return A URL to the source of the vulnerability information.
*/
public String getSourceUrl() {
return this.sourceUrl;
}
/**
*
* A URL to the source of the vulnerability information.
*
*
* @param sourceUrl
* A URL to the source of the vulnerability information.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withSourceUrl(String sourceUrl) {
setSourceUrl(sourceUrl);
return this;
}
/**
*
* The date and time that this vulnerability was first added to the vendor's database.
*
*
* @param vendorCreatedAt
* The date and time that this vulnerability was first added to the vendor's database.
*/
public void setVendorCreatedAt(java.util.Date vendorCreatedAt) {
this.vendorCreatedAt = vendorCreatedAt;
}
/**
*
* The date and time that this vulnerability was first added to the vendor's database.
*
*
* @return The date and time that this vulnerability was first added to the vendor's database.
*/
public java.util.Date getVendorCreatedAt() {
return this.vendorCreatedAt;
}
/**
*
* The date and time that this vulnerability was first added to the vendor's database.
*
*
* @param vendorCreatedAt
* The date and time that this vulnerability was first added to the vendor's database.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withVendorCreatedAt(java.util.Date vendorCreatedAt) {
setVendorCreatedAt(vendorCreatedAt);
return this;
}
/**
*
* The severity the vendor has given to this vulnerability type.
*
*
* @param vendorSeverity
* The severity the vendor has given to this vulnerability type.
*/
public void setVendorSeverity(String vendorSeverity) {
this.vendorSeverity = vendorSeverity;
}
/**
*
* The severity the vendor has given to this vulnerability type.
*
*
* @return The severity the vendor has given to this vulnerability type.
*/
public String getVendorSeverity() {
return this.vendorSeverity;
}
/**
*
* The severity the vendor has given to this vulnerability type.
*
*
* @param vendorSeverity
* The severity the vendor has given to this vulnerability type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withVendorSeverity(String vendorSeverity) {
setVendorSeverity(vendorSeverity);
return this;
}
/**
*
* The date and time the vendor last updated this vulnerability in their database.
*
*
* @param vendorUpdatedAt
* The date and time the vendor last updated this vulnerability in their database.
*/
public void setVendorUpdatedAt(java.util.Date vendorUpdatedAt) {
this.vendorUpdatedAt = vendorUpdatedAt;
}
/**
*
* The date and time the vendor last updated this vulnerability in their database.
*
*
* @return The date and time the vendor last updated this vulnerability in their database.
*/
public java.util.Date getVendorUpdatedAt() {
return this.vendorUpdatedAt;
}
/**
*
* The date and time the vendor last updated this vulnerability in their database.
*
*
* @param vendorUpdatedAt
* The date and time the vendor last updated this vulnerability in their database.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withVendorUpdatedAt(java.util.Date vendorUpdatedAt) {
setVendorUpdatedAt(vendorUpdatedAt);
return this;
}
/**
*
* The ID given to this vulnerability.
*
*
* @param vulnerabilityId
* The ID given to this vulnerability.
*/
public void setVulnerabilityId(String vulnerabilityId) {
this.vulnerabilityId = vulnerabilityId;
}
/**
*
* The ID given to this vulnerability.
*
*
* @return The ID given to this vulnerability.
*/
public String getVulnerabilityId() {
return this.vulnerabilityId;
}
/**
*
* The ID given to this vulnerability.
*
*
* @param vulnerabilityId
* The ID given to this vulnerability.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withVulnerabilityId(String vulnerabilityId) {
setVulnerabilityId(vulnerabilityId);
return this;
}
/**
*
* The packages impacted by this vulnerability.
*
*
* @return The packages impacted by this vulnerability.
*/
public java.util.List getVulnerablePackages() {
return vulnerablePackages;
}
/**
*
* The packages impacted by this vulnerability.
*
*
* @param vulnerablePackages
* The packages impacted by this vulnerability.
*/
public void setVulnerablePackages(java.util.Collection vulnerablePackages) {
if (vulnerablePackages == null) {
this.vulnerablePackages = null;
return;
}
this.vulnerablePackages = new java.util.ArrayList(vulnerablePackages);
}
/**
*
* The packages impacted by this vulnerability.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setVulnerablePackages(java.util.Collection)} or {@link #withVulnerablePackages(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param vulnerablePackages
* The packages impacted by this vulnerability.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withVulnerablePackages(VulnerablePackage... vulnerablePackages) {
if (this.vulnerablePackages == null) {
setVulnerablePackages(new java.util.ArrayList(vulnerablePackages.length));
}
for (VulnerablePackage ele : vulnerablePackages) {
this.vulnerablePackages.add(ele);
}
return this;
}
/**
*
* The packages impacted by this vulnerability.
*
*
* @param vulnerablePackages
* The packages impacted by this vulnerability.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVulnerabilityDetails withVulnerablePackages(java.util.Collection vulnerablePackages) {
setVulnerablePackages(vulnerablePackages);
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 (getCvss() != null)
sb.append("Cvss: ").append(getCvss()).append(",");
if (getReferenceUrls() != null)
sb.append("ReferenceUrls: ").append(getReferenceUrls()).append(",");
if (getRelatedVulnerabilities() != null)
sb.append("RelatedVulnerabilities: ").append(getRelatedVulnerabilities()).append(",");
if (getSource() != null)
sb.append("Source: ").append(getSource()).append(",");
if (getSourceUrl() != null)
sb.append("SourceUrl: ").append(getSourceUrl()).append(",");
if (getVendorCreatedAt() != null)
sb.append("VendorCreatedAt: ").append(getVendorCreatedAt()).append(",");
if (getVendorSeverity() != null)
sb.append("VendorSeverity: ").append(getVendorSeverity()).append(",");
if (getVendorUpdatedAt() != null)
sb.append("VendorUpdatedAt: ").append(getVendorUpdatedAt()).append(",");
if (getVulnerabilityId() != null)
sb.append("VulnerabilityId: ").append(getVulnerabilityId()).append(",");
if (getVulnerablePackages() != null)
sb.append("VulnerablePackages: ").append(getVulnerablePackages());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PackageVulnerabilityDetails == false)
return false;
PackageVulnerabilityDetails other = (PackageVulnerabilityDetails) obj;
if (other.getCvss() == null ^ this.getCvss() == null)
return false;
if (other.getCvss() != null && other.getCvss().equals(this.getCvss()) == false)
return false;
if (other.getReferenceUrls() == null ^ this.getReferenceUrls() == null)
return false;
if (other.getReferenceUrls() != null && other.getReferenceUrls().equals(this.getReferenceUrls()) == false)
return false;
if (other.getRelatedVulnerabilities() == null ^ this.getRelatedVulnerabilities() == null)
return false;
if (other.getRelatedVulnerabilities() != null && other.getRelatedVulnerabilities().equals(this.getRelatedVulnerabilities()) == false)
return false;
if (other.getSource() == null ^ this.getSource() == null)
return false;
if (other.getSource() != null && other.getSource().equals(this.getSource()) == false)
return false;
if (other.getSourceUrl() == null ^ this.getSourceUrl() == null)
return false;
if (other.getSourceUrl() != null && other.getSourceUrl().equals(this.getSourceUrl()) == false)
return false;
if (other.getVendorCreatedAt() == null ^ this.getVendorCreatedAt() == null)
return false;
if (other.getVendorCreatedAt() != null && other.getVendorCreatedAt().equals(this.getVendorCreatedAt()) == false)
return false;
if (other.getVendorSeverity() == null ^ this.getVendorSeverity() == null)
return false;
if (other.getVendorSeverity() != null && other.getVendorSeverity().equals(this.getVendorSeverity()) == false)
return false;
if (other.getVendorUpdatedAt() == null ^ this.getVendorUpdatedAt() == null)
return false;
if (other.getVendorUpdatedAt() != null && other.getVendorUpdatedAt().equals(this.getVendorUpdatedAt()) == false)
return false;
if (other.getVulnerabilityId() == null ^ this.getVulnerabilityId() == null)
return false;
if (other.getVulnerabilityId() != null && other.getVulnerabilityId().equals(this.getVulnerabilityId()) == false)
return false;
if (other.getVulnerablePackages() == null ^ this.getVulnerablePackages() == null)
return false;
if (other.getVulnerablePackages() != null && other.getVulnerablePackages().equals(this.getVulnerablePackages()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCvss() == null) ? 0 : getCvss().hashCode());
hashCode = prime * hashCode + ((getReferenceUrls() == null) ? 0 : getReferenceUrls().hashCode());
hashCode = prime * hashCode + ((getRelatedVulnerabilities() == null) ? 0 : getRelatedVulnerabilities().hashCode());
hashCode = prime * hashCode + ((getSource() == null) ? 0 : getSource().hashCode());
hashCode = prime * hashCode + ((getSourceUrl() == null) ? 0 : getSourceUrl().hashCode());
hashCode = prime * hashCode + ((getVendorCreatedAt() == null) ? 0 : getVendorCreatedAt().hashCode());
hashCode = prime * hashCode + ((getVendorSeverity() == null) ? 0 : getVendorSeverity().hashCode());
hashCode = prime * hashCode + ((getVendorUpdatedAt() == null) ? 0 : getVendorUpdatedAt().hashCode());
hashCode = prime * hashCode + ((getVulnerabilityId() == null) ? 0 : getVulnerabilityId().hashCode());
hashCode = prime * hashCode + ((getVulnerablePackages() == null) ? 0 : getVulnerablePackages().hashCode());
return hashCode;
}
@Override
public PackageVulnerabilityDetails clone() {
try {
return (PackageVulnerabilityDetails) 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.ecr.model.transform.PackageVulnerabilityDetailsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}