com.amazonaws.services.inspector2.model.VulnerablePackage 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;
/**
*
* Information on the vulnerable package identified by a finding.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class VulnerablePackage implements Serializable, Cloneable, StructuredPojo {
/**
*
* The architecture of the vulnerable package.
*
*/
private String arch;
/**
*
* The epoch of the vulnerable package.
*
*/
private Integer epoch;
/**
*
* The file path of the vulnerable package.
*
*/
private String filePath;
/**
*
* The version of the package that contains the vulnerability fix.
*
*/
private String fixedInVersion;
/**
*
* The name of the vulnerable package.
*
*/
private String name;
/**
*
* The package manager of the vulnerable package.
*
*/
private String packageManager;
/**
*
* The release of the vulnerable package.
*
*/
private String release;
/**
*
* The code to run in your environment to update packages with a fix available.
*
*/
private String remediation;
/**
*
* The Amazon Resource Number (ARN) of the Amazon Web Services Lambda function affected by a finding.
*
*/
private String sourceLambdaLayerArn;
/**
*
* The source layer hash of the vulnerable package.
*
*/
private String sourceLayerHash;
/**
*
* The version of the vulnerable package.
*
*/
private String version;
/**
*
* The architecture of the vulnerable package.
*
*
* @param arch
* The architecture of the vulnerable package.
*/
public void setArch(String arch) {
this.arch = arch;
}
/**
*
* The architecture of the vulnerable package.
*
*
* @return The architecture of the vulnerable package.
*/
public String getArch() {
return this.arch;
}
/**
*
* The architecture of the vulnerable package.
*
*
* @param arch
* The architecture of the vulnerable package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withArch(String arch) {
setArch(arch);
return this;
}
/**
*
* The epoch of the vulnerable package.
*
*
* @param epoch
* The epoch of the vulnerable package.
*/
public void setEpoch(Integer epoch) {
this.epoch = epoch;
}
/**
*
* The epoch of the vulnerable package.
*
*
* @return The epoch of the vulnerable package.
*/
public Integer getEpoch() {
return this.epoch;
}
/**
*
* The epoch of the vulnerable package.
*
*
* @param epoch
* The epoch of the vulnerable package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withEpoch(Integer epoch) {
setEpoch(epoch);
return this;
}
/**
*
* The file path of the vulnerable package.
*
*
* @param filePath
* The file path of the vulnerable package.
*/
public void setFilePath(String filePath) {
this.filePath = filePath;
}
/**
*
* The file path of the vulnerable package.
*
*
* @return The file path of the vulnerable package.
*/
public String getFilePath() {
return this.filePath;
}
/**
*
* The file path of the vulnerable package.
*
*
* @param filePath
* The file path of the vulnerable package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withFilePath(String filePath) {
setFilePath(filePath);
return this;
}
/**
*
* The version of the package that contains the vulnerability fix.
*
*
* @param fixedInVersion
* The version of the package that contains the vulnerability fix.
*/
public void setFixedInVersion(String fixedInVersion) {
this.fixedInVersion = fixedInVersion;
}
/**
*
* The version of the package that contains the vulnerability fix.
*
*
* @return The version of the package that contains the vulnerability fix.
*/
public String getFixedInVersion() {
return this.fixedInVersion;
}
/**
*
* The version of the package that contains the vulnerability fix.
*
*
* @param fixedInVersion
* The version of the package that contains the vulnerability fix.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withFixedInVersion(String fixedInVersion) {
setFixedInVersion(fixedInVersion);
return this;
}
/**
*
* The name of the vulnerable package.
*
*
* @param name
* The name of the vulnerable package.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the vulnerable package.
*
*
* @return The name of the vulnerable package.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the vulnerable package.
*
*
* @param name
* The name of the vulnerable package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withName(String name) {
setName(name);
return this;
}
/**
*
* The package manager of the vulnerable package.
*
*
* @param packageManager
* The package manager of the vulnerable package.
* @see PackageManager
*/
public void setPackageManager(String packageManager) {
this.packageManager = packageManager;
}
/**
*
* The package manager of the vulnerable package.
*
*
* @return The package manager of the vulnerable package.
* @see PackageManager
*/
public String getPackageManager() {
return this.packageManager;
}
/**
*
* The package manager of the vulnerable package.
*
*
* @param packageManager
* The package manager of the vulnerable package.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageManager
*/
public VulnerablePackage withPackageManager(String packageManager) {
setPackageManager(packageManager);
return this;
}
/**
*
* The package manager of the vulnerable package.
*
*
* @param packageManager
* The package manager of the vulnerable package.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageManager
*/
public VulnerablePackage withPackageManager(PackageManager packageManager) {
this.packageManager = packageManager.toString();
return this;
}
/**
*
* The release of the vulnerable package.
*
*
* @param release
* The release of the vulnerable package.
*/
public void setRelease(String release) {
this.release = release;
}
/**
*
* The release of the vulnerable package.
*
*
* @return The release of the vulnerable package.
*/
public String getRelease() {
return this.release;
}
/**
*
* The release of the vulnerable package.
*
*
* @param release
* The release of the vulnerable package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withRelease(String release) {
setRelease(release);
return this;
}
/**
*
* The code to run in your environment to update packages with a fix available.
*
*
* @param remediation
* The code to run in your environment to update packages with a fix available.
*/
public void setRemediation(String remediation) {
this.remediation = remediation;
}
/**
*
* The code to run in your environment to update packages with a fix available.
*
*
* @return The code to run in your environment to update packages with a fix available.
*/
public String getRemediation() {
return this.remediation;
}
/**
*
* The code to run in your environment to update packages with a fix available.
*
*
* @param remediation
* The code to run in your environment to update packages with a fix available.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withRemediation(String remediation) {
setRemediation(remediation);
return this;
}
/**
*
* The Amazon Resource Number (ARN) of the Amazon Web Services Lambda function affected by a finding.
*
*
* @param sourceLambdaLayerArn
* The Amazon Resource Number (ARN) of the Amazon Web Services Lambda function affected by a finding.
*/
public void setSourceLambdaLayerArn(String sourceLambdaLayerArn) {
this.sourceLambdaLayerArn = sourceLambdaLayerArn;
}
/**
*
* The Amazon Resource Number (ARN) of the Amazon Web Services Lambda function affected by a finding.
*
*
* @return The Amazon Resource Number (ARN) of the Amazon Web Services Lambda function affected by a finding.
*/
public String getSourceLambdaLayerArn() {
return this.sourceLambdaLayerArn;
}
/**
*
* The Amazon Resource Number (ARN) of the Amazon Web Services Lambda function affected by a finding.
*
*
* @param sourceLambdaLayerArn
* The Amazon Resource Number (ARN) of the Amazon Web Services Lambda function affected by a finding.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withSourceLambdaLayerArn(String sourceLambdaLayerArn) {
setSourceLambdaLayerArn(sourceLambdaLayerArn);
return this;
}
/**
*
* The source layer hash of the vulnerable package.
*
*
* @param sourceLayerHash
* The source layer hash of the vulnerable package.
*/
public void setSourceLayerHash(String sourceLayerHash) {
this.sourceLayerHash = sourceLayerHash;
}
/**
*
* The source layer hash of the vulnerable package.
*
*
* @return The source layer hash of the vulnerable package.
*/
public String getSourceLayerHash() {
return this.sourceLayerHash;
}
/**
*
* The source layer hash of the vulnerable package.
*
*
* @param sourceLayerHash
* The source layer hash of the vulnerable package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withSourceLayerHash(String sourceLayerHash) {
setSourceLayerHash(sourceLayerHash);
return this;
}
/**
*
* The version of the vulnerable package.
*
*
* @param version
* The version of the vulnerable package.
*/
public void setVersion(String version) {
this.version = version;
}
/**
*
* The version of the vulnerable package.
*
*
* @return The version of the vulnerable package.
*/
public String getVersion() {
return this.version;
}
/**
*
* The version of the vulnerable package.
*
*
* @param version
* The version of the vulnerable package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VulnerablePackage withVersion(String version) {
setVersion(version);
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 (getArch() != null)
sb.append("Arch: ").append(getArch()).append(",");
if (getEpoch() != null)
sb.append("Epoch: ").append(getEpoch()).append(",");
if (getFilePath() != null)
sb.append("FilePath: ").append(getFilePath()).append(",");
if (getFixedInVersion() != null)
sb.append("FixedInVersion: ").append(getFixedInVersion()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getPackageManager() != null)
sb.append("PackageManager: ").append(getPackageManager()).append(",");
if (getRelease() != null)
sb.append("Release: ").append(getRelease()).append(",");
if (getRemediation() != null)
sb.append("Remediation: ").append(getRemediation()).append(",");
if (getSourceLambdaLayerArn() != null)
sb.append("SourceLambdaLayerArn: ").append(getSourceLambdaLayerArn()).append(",");
if (getSourceLayerHash() != null)
sb.append("SourceLayerHash: ").append(getSourceLayerHash()).append(",");
if (getVersion() != null)
sb.append("Version: ").append(getVersion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof VulnerablePackage == false)
return false;
VulnerablePackage other = (VulnerablePackage) obj;
if (other.getArch() == null ^ this.getArch() == null)
return false;
if (other.getArch() != null && other.getArch().equals(this.getArch()) == false)
return false;
if (other.getEpoch() == null ^ this.getEpoch() == null)
return false;
if (other.getEpoch() != null && other.getEpoch().equals(this.getEpoch()) == false)
return false;
if (other.getFilePath() == null ^ this.getFilePath() == null)
return false;
if (other.getFilePath() != null && other.getFilePath().equals(this.getFilePath()) == false)
return false;
if (other.getFixedInVersion() == null ^ this.getFixedInVersion() == null)
return false;
if (other.getFixedInVersion() != null && other.getFixedInVersion().equals(this.getFixedInVersion()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getPackageManager() == null ^ this.getPackageManager() == null)
return false;
if (other.getPackageManager() != null && other.getPackageManager().equals(this.getPackageManager()) == false)
return false;
if (other.getRelease() == null ^ this.getRelease() == null)
return false;
if (other.getRelease() != null && other.getRelease().equals(this.getRelease()) == false)
return false;
if (other.getRemediation() == null ^ this.getRemediation() == null)
return false;
if (other.getRemediation() != null && other.getRemediation().equals(this.getRemediation()) == false)
return false;
if (other.getSourceLambdaLayerArn() == null ^ this.getSourceLambdaLayerArn() == null)
return false;
if (other.getSourceLambdaLayerArn() != null && other.getSourceLambdaLayerArn().equals(this.getSourceLambdaLayerArn()) == false)
return false;
if (other.getSourceLayerHash() == null ^ this.getSourceLayerHash() == null)
return false;
if (other.getSourceLayerHash() != null && other.getSourceLayerHash().equals(this.getSourceLayerHash()) == false)
return false;
if (other.getVersion() == null ^ this.getVersion() == null)
return false;
if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArch() == null) ? 0 : getArch().hashCode());
hashCode = prime * hashCode + ((getEpoch() == null) ? 0 : getEpoch().hashCode());
hashCode = prime * hashCode + ((getFilePath() == null) ? 0 : getFilePath().hashCode());
hashCode = prime * hashCode + ((getFixedInVersion() == null) ? 0 : getFixedInVersion().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getPackageManager() == null) ? 0 : getPackageManager().hashCode());
hashCode = prime * hashCode + ((getRelease() == null) ? 0 : getRelease().hashCode());
hashCode = prime * hashCode + ((getRemediation() == null) ? 0 : getRemediation().hashCode());
hashCode = prime * hashCode + ((getSourceLambdaLayerArn() == null) ? 0 : getSourceLambdaLayerArn().hashCode());
hashCode = prime * hashCode + ((getSourceLayerHash() == null) ? 0 : getSourceLayerHash().hashCode());
hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
return hashCode;
}
@Override
public VulnerablePackage clone() {
try {
return (VulnerablePackage) 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.VulnerablePackageMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}