org.owasp.dependencycheck.data.nvd.json.DefCveItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dependency-check-core Show documentation
Show all versions of dependency-check-core Show documentation
dependency-check-core is the engine and reporting tool used to identify and report if there are any known, publicly disclosed vulnerabilities in the scanned project's dependencies. The engine extracts meta-data from the dependencies and uses this to do fuzzy key-word matching against the Common Platfrom Enumeration (CPE), if any CPE identifiers are found the associated Common Vulnerability and Exposure (CVE) entries are added to the generated report.
package org.owasp.dependencycheck.data.nvd.json;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Defines a vulnerability in the NVD data feed.
*
*/
public class DefCveItem {
/**
*
* (Required)
*
*/
@SerializedName("cve")
@Expose
private CVEJSON40Min cve;
/**
* Defines the set of product configurations for a NVD applicability statement.
*
*/
@SerializedName("configurations")
@Expose
private DefConfigurations configurations;
/**
* Impact scores for a vulnerability as found on NVD.
*
*/
@SerializedName("impact")
@Expose
private DefImpact impact;
@SerializedName("publishedDate")
@Expose
private String publishedDate;
@SerializedName("lastModifiedDate")
@Expose
private String lastModifiedDate;
/**
*
* (Required)
*
*/
public CVEJSON40Min getCve() {
return cve;
}
/**
*
* (Required)
*
*/
public void setCve(CVEJSON40Min cve) {
this.cve = cve;
}
/**
* Defines the set of product configurations for a NVD applicability statement.
*
*/
public DefConfigurations getConfigurations() {
return configurations;
}
/**
* Defines the set of product configurations for a NVD applicability statement.
*
*/
public void setConfigurations(DefConfigurations configurations) {
this.configurations = configurations;
}
/**
* Impact scores for a vulnerability as found on NVD.
*
*/
public DefImpact getImpact() {
return impact;
}
/**
* Impact scores for a vulnerability as found on NVD.
*
*/
public void setImpact(DefImpact impact) {
this.impact = impact;
}
public String getPublishedDate() {
return publishedDate;
}
public void setPublishedDate(String publishedDate) {
this.publishedDate = publishedDate;
}
public String getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(String lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(DefCveItem.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("cve");
sb.append('=');
sb.append(((this.cve == null)?"":this.cve));
sb.append(',');
sb.append("configurations");
sb.append('=');
sb.append(((this.configurations == null)?"":this.configurations));
sb.append(',');
sb.append("impact");
sb.append('=');
sb.append(((this.impact == null)?"":this.impact));
sb.append(',');
sb.append("publishedDate");
sb.append('=');
sb.append(((this.publishedDate == null)?"":this.publishedDate));
sb.append(',');
sb.append("lastModifiedDate");
sb.append('=');
sb.append(((this.lastModifiedDate == null)?"":this.lastModifiedDate));
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.cve == null)? 0 :this.cve.hashCode()));
result = ((result* 31)+((this.publishedDate == null)? 0 :this.publishedDate.hashCode()));
result = ((result* 31)+((this.lastModifiedDate == null)? 0 :this.lastModifiedDate.hashCode()));
result = ((result* 31)+((this.configurations == null)? 0 :this.configurations.hashCode()));
result = ((result* 31)+((this.impact == null)? 0 :this.impact.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof DefCveItem) == false) {
return false;
}
DefCveItem rhs = ((DefCveItem) other);
return ((((((this.cve == rhs.cve)||((this.cve!= null)&&this.cve.equals(rhs.cve)))&&((this.publishedDate == rhs.publishedDate)||((this.publishedDate!= null)&&this.publishedDate.equals(rhs.publishedDate))))&&((this.lastModifiedDate == rhs.lastModifiedDate)||((this.lastModifiedDate!= null)&&this.lastModifiedDate.equals(rhs.lastModifiedDate))))&&((this.configurations == rhs.configurations)||((this.configurations!= null)&&this.configurations.equals(rhs.configurations))))&&((this.impact == rhs.impact)||((this.impact!= null)&&this.impact.equals(rhs.impact))));
}
}