org.owasp.dependencycheck.data.nvd.json.DefCpeMatch 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 java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* CPE match string or range
*
*/
public class DefCpeMatch {
/**
*
* (Required)
*
*/
@SerializedName("vulnerable")
@Expose
private Boolean vulnerable;
@SerializedName("cpe22Uri")
@Expose
private String cpe22Uri;
/**
*
* (Required)
*
*/
@SerializedName("cpe23Uri")
@Expose
private String cpe23Uri;
@SerializedName("versionStartExcluding")
@Expose
private String versionStartExcluding;
@SerializedName("versionStartIncluding")
@Expose
private String versionStartIncluding;
@SerializedName("versionEndExcluding")
@Expose
private String versionEndExcluding;
@SerializedName("versionEndIncluding")
@Expose
private String versionEndIncluding;
@SerializedName("cpe_name")
@Expose
private List cpeName = new ArrayList();
/**
*
* (Required)
*
*/
public Boolean getVulnerable() {
return vulnerable;
}
/**
*
* (Required)
*
*/
public void setVulnerable(Boolean vulnerable) {
this.vulnerable = vulnerable;
}
public String getCpe22Uri() {
return cpe22Uri;
}
public void setCpe22Uri(String cpe22Uri) {
this.cpe22Uri = cpe22Uri;
}
/**
*
* (Required)
*
*/
public String getCpe23Uri() {
return cpe23Uri;
}
/**
*
* (Required)
*
*/
public void setCpe23Uri(String cpe23Uri) {
this.cpe23Uri = cpe23Uri;
}
public String getVersionStartExcluding() {
return versionStartExcluding;
}
public void setVersionStartExcluding(String versionStartExcluding) {
this.versionStartExcluding = versionStartExcluding;
}
public String getVersionStartIncluding() {
return versionStartIncluding;
}
public void setVersionStartIncluding(String versionStartIncluding) {
this.versionStartIncluding = versionStartIncluding;
}
public String getVersionEndExcluding() {
return versionEndExcluding;
}
public void setVersionEndExcluding(String versionEndExcluding) {
this.versionEndExcluding = versionEndExcluding;
}
public String getVersionEndIncluding() {
return versionEndIncluding;
}
public void setVersionEndIncluding(String versionEndIncluding) {
this.versionEndIncluding = versionEndIncluding;
}
public List getCpeName() {
return cpeName;
}
public void setCpeName(List cpeName) {
this.cpeName = cpeName;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(DefCpeMatch.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("vulnerable");
sb.append('=');
sb.append(((this.vulnerable == null)?"":this.vulnerable));
sb.append(',');
sb.append("cpe22Uri");
sb.append('=');
sb.append(((this.cpe22Uri == null)?"":this.cpe22Uri));
sb.append(',');
sb.append("cpe23Uri");
sb.append('=');
sb.append(((this.cpe23Uri == null)?"":this.cpe23Uri));
sb.append(',');
sb.append("versionStartExcluding");
sb.append('=');
sb.append(((this.versionStartExcluding == null)?"":this.versionStartExcluding));
sb.append(',');
sb.append("versionStartIncluding");
sb.append('=');
sb.append(((this.versionStartIncluding == null)?"":this.versionStartIncluding));
sb.append(',');
sb.append("versionEndExcluding");
sb.append('=');
sb.append(((this.versionEndExcluding == null)?"":this.versionEndExcluding));
sb.append(',');
sb.append("versionEndIncluding");
sb.append('=');
sb.append(((this.versionEndIncluding == null)?"":this.versionEndIncluding));
sb.append(',');
sb.append("cpeName");
sb.append('=');
sb.append(((this.cpeName == null)?"":this.cpeName));
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.vulnerable == null)? 0 :this.vulnerable.hashCode()));
result = ((result* 31)+((this.cpe23Uri == null)? 0 :this.cpe23Uri.hashCode()));
result = ((result* 31)+((this.versionStartExcluding == null)? 0 :this.versionStartExcluding.hashCode()));
result = ((result* 31)+((this.cpe22Uri == null)? 0 :this.cpe22Uri.hashCode()));
result = ((result* 31)+((this.versionEndExcluding == null)? 0 :this.versionEndExcluding.hashCode()));
result = ((result* 31)+((this.cpeName == null)? 0 :this.cpeName.hashCode()));
result = ((result* 31)+((this.versionEndIncluding == null)? 0 :this.versionEndIncluding.hashCode()));
result = ((result* 31)+((this.versionStartIncluding == null)? 0 :this.versionStartIncluding.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof DefCpeMatch) == false) {
return false;
}
DefCpeMatch rhs = ((DefCpeMatch) other);
return (((((((((this.vulnerable == rhs.vulnerable)||((this.vulnerable!= null)&&this.vulnerable.equals(rhs.vulnerable)))&&((this.cpe23Uri == rhs.cpe23Uri)||((this.cpe23Uri!= null)&&this.cpe23Uri.equals(rhs.cpe23Uri))))&&((this.versionStartExcluding == rhs.versionStartExcluding)||((this.versionStartExcluding!= null)&&this.versionStartExcluding.equals(rhs.versionStartExcluding))))&&((this.cpe22Uri == rhs.cpe22Uri)||((this.cpe22Uri!= null)&&this.cpe22Uri.equals(rhs.cpe22Uri))))&&((this.versionEndExcluding == rhs.versionEndExcluding)||((this.versionEndExcluding!= null)&&this.versionEndExcluding.equals(rhs.versionEndExcluding))))&&((this.cpeName == rhs.cpeName)||((this.cpeName!= null)&&this.cpeName.equals(rhs.cpeName))))&&((this.versionEndIncluding == rhs.versionEndIncluding)||((this.versionEndIncluding!= null)&&this.versionEndIncluding.equals(rhs.versionEndIncluding))))&&((this.versionStartIncluding == rhs.versionStartIncluding)||((this.versionStartIncluding!= null)&&this.versionStartIncluding.equals(rhs.versionStartIncluding))));
}
}