com.amazonaws.services.ecr.model.CvssScore Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ecr 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.ecr.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The CVSS score for a finding.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CvssScore implements Serializable, Cloneable, StructuredPojo {
/**
*
* The base CVSS score used for the finding.
*
*/
private Double baseScore;
/**
*
* The vector string of the CVSS score.
*
*/
private String scoringVector;
/**
*
* The source of the CVSS score.
*
*/
private String source;
/**
*
* The version of CVSS used for the score.
*
*/
private String version;
/**
*
* The base CVSS score used for the finding.
*
*
* @param baseScore
* The base CVSS score used for the finding.
*/
public void setBaseScore(Double baseScore) {
this.baseScore = baseScore;
}
/**
*
* The base CVSS score used for the finding.
*
*
* @return The base CVSS score used for the finding.
*/
public Double getBaseScore() {
return this.baseScore;
}
/**
*
* The base CVSS score used for the finding.
*
*
* @param baseScore
* The base CVSS score used for the finding.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CvssScore withBaseScore(Double baseScore) {
setBaseScore(baseScore);
return this;
}
/**
*
* The vector string of the CVSS score.
*
*
* @param scoringVector
* The vector string of the CVSS score.
*/
public void setScoringVector(String scoringVector) {
this.scoringVector = scoringVector;
}
/**
*
* The vector string of the CVSS score.
*
*
* @return The vector string of the CVSS score.
*/
public String getScoringVector() {
return this.scoringVector;
}
/**
*
* The vector string of the CVSS score.
*
*
* @param scoringVector
* The vector string of the CVSS score.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CvssScore withScoringVector(String scoringVector) {
setScoringVector(scoringVector);
return this;
}
/**
*
* The source of the CVSS score.
*
*
* @param source
* The source of the CVSS score.
*/
public void setSource(String source) {
this.source = source;
}
/**
*
* The source of the CVSS score.
*
*
* @return The source of the CVSS score.
*/
public String getSource() {
return this.source;
}
/**
*
* The source of the CVSS score.
*
*
* @param source
* The source of the CVSS score.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CvssScore withSource(String source) {
setSource(source);
return this;
}
/**
*
* The version of CVSS used for the score.
*
*
* @param version
* The version of CVSS used for the score.
*/
public void setVersion(String version) {
this.version = version;
}
/**
*
* The version of CVSS used for the score.
*
*
* @return The version of CVSS used for the score.
*/
public String getVersion() {
return this.version;
}
/**
*
* The version of CVSS used for the score.
*
*
* @param version
* The version of CVSS used for the score.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CvssScore 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 (getBaseScore() != null)
sb.append("BaseScore: ").append(getBaseScore()).append(",");
if (getScoringVector() != null)
sb.append("ScoringVector: ").append(getScoringVector()).append(",");
if (getSource() != null)
sb.append("Source: ").append(getSource()).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 CvssScore == false)
return false;
CvssScore other = (CvssScore) obj;
if (other.getBaseScore() == null ^ this.getBaseScore() == null)
return false;
if (other.getBaseScore() != null && other.getBaseScore().equals(this.getBaseScore()) == false)
return false;
if (other.getScoringVector() == null ^ this.getScoringVector() == null)
return false;
if (other.getScoringVector() != null && other.getScoringVector().equals(this.getScoringVector()) == 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.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 + ((getBaseScore() == null) ? 0 : getBaseScore().hashCode());
hashCode = prime * hashCode + ((getScoringVector() == null) ? 0 : getScoringVector().hashCode());
hashCode = prime * hashCode + ((getSource() == null) ? 0 : getSource().hashCode());
hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
return hashCode;
}
@Override
public CvssScore clone() {
try {
return (CvssScore) 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.CvssScoreMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}