org.owasp.dependencycheck.data.nvd.json.DefNode 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;
/**
* Defines a node or sub-node in an NVD applicability statement.
*
*/
public class DefNode {
@SerializedName("operator")
@Expose
private String operator;
@SerializedName("negate")
@Expose
private Boolean negate;
@SerializedName("children")
@Expose
private List children = new ArrayList();
@SerializedName("cpe_match")
@Expose
private List cpeMatch = new ArrayList();
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
public Boolean getNegate() {
return negate;
}
public void setNegate(Boolean negate) {
this.negate = negate;
}
public List getChildren() {
return children;
}
public void setChildren(List children) {
this.children = children;
}
public List getCpeMatch() {
return cpeMatch;
}
public void setCpeMatch(List cpeMatch) {
this.cpeMatch = cpeMatch;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(DefNode.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("operator");
sb.append('=');
sb.append(((this.operator == null)?"":this.operator));
sb.append(',');
sb.append("negate");
sb.append('=');
sb.append(((this.negate == null)?"":this.negate));
sb.append(',');
sb.append("children");
sb.append('=');
sb.append(((this.children == null)?"":this.children));
sb.append(',');
sb.append("cpeMatch");
sb.append('=');
sb.append(((this.cpeMatch == null)?"":this.cpeMatch));
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.children == null)? 0 :this.children.hashCode()));
result = ((result* 31)+((this.operator == null)? 0 :this.operator.hashCode()));
result = ((result* 31)+((this.negate == null)? 0 :this.negate.hashCode()));
result = ((result* 31)+((this.cpeMatch == null)? 0 :this.cpeMatch.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof DefNode) == false) {
return false;
}
DefNode rhs = ((DefNode) other);
return (((((this.children == rhs.children)||((this.children!= null)&&this.children.equals(rhs.children)))&&((this.operator == rhs.operator)||((this.operator!= null)&&this.operator.equals(rhs.operator))))&&((this.negate == rhs.negate)||((this.negate!= null)&&this.negate.equals(rhs.negate))))&&((this.cpeMatch == rhs.cpeMatch)||((this.cpeMatch!= null)&&this.cpeMatch.equals(rhs.cpeMatch))));
}
}