org.owasp.dependencycheck.data.nvd.json.BaseMetricV3 Maven / Gradle / Ivy
package org.owasp.dependencycheck.data.nvd.json;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* CVSS V3.0 score.
*
*/
public class BaseMetricV3 {
/**
* JSON Schema for Common Vulnerability Scoring System version 3.0
*
*
*
*/
@SerializedName("cvssV3")
@Expose
private CvssV30 cvssV3;
/**
* CVSS subscore.
*
*/
@SerializedName("exploitabilityScore")
@Expose
private Double exploitabilityScore;
/**
* CVSS subscore.
*
*/
@SerializedName("impactScore")
@Expose
private Double impactScore;
/**
* JSON Schema for Common Vulnerability Scoring System version 3.0
*
*
*
*/
public CvssV30 getCvssV3() {
return cvssV3;
}
/**
* JSON Schema for Common Vulnerability Scoring System version 3.0
*
*
*
*/
public void setCvssV3(CvssV30 cvssV3) {
this.cvssV3 = cvssV3;
}
/**
* CVSS subscore.
*
*/
public Double getExploitabilityScore() {
return exploitabilityScore;
}
/**
* CVSS subscore.
*
*/
public void setExploitabilityScore(Double exploitabilityScore) {
this.exploitabilityScore = exploitabilityScore;
}
/**
* CVSS subscore.
*
*/
public Double getImpactScore() {
return impactScore;
}
/**
* CVSS subscore.
*
*/
public void setImpactScore(Double impactScore) {
this.impactScore = impactScore;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(BaseMetricV3 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("cvssV3");
sb.append('=');
sb.append(((this.cvssV3 == null)?"":this.cvssV3));
sb.append(',');
sb.append("exploitabilityScore");
sb.append('=');
sb.append(((this.exploitabilityScore == null)?"":this.exploitabilityScore));
sb.append(',');
sb.append("impactScore");
sb.append('=');
sb.append(((this.impactScore == null)?"":this.impactScore));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.exploitabilityScore == null)? 0 :this.exploitabilityScore.hashCode()));
result = ((result* 31)+((this.cvssV3 == null)? 0 :this.cvssV3 .hashCode()));
result = ((result* 31)+((this.impactScore == null)? 0 :this.impactScore.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof BaseMetricV3) == false) {
return false;
}
BaseMetricV3 rhs = ((BaseMetricV3) other);
return ((((this.exploitabilityScore == rhs.exploitabilityScore)||((this.exploitabilityScore!= null)&&this.exploitabilityScore.equals(rhs.exploitabilityScore)))&&((this.cvssV3 == rhs.cvssV3)||((this.cvssV3 != null)&&this.cvssV3 .equals(rhs.cvssV3))))&&((this.impactScore == rhs.impactScore)||((this.impactScore!= null)&&this.impactScore.equals(rhs.impactScore))));
}
}