DefCveItem.java

  1. package org.owasp.dependencycheck.data.nvd.json;

  2. import java.util.LinkedHashMap;
  3. import java.util.Map;
  4. import javax.annotation.Generated;
  5. import com.fasterxml.jackson.annotation.JsonAnyGetter;
  6. import com.fasterxml.jackson.annotation.JsonAnySetter;
  7. import com.fasterxml.jackson.annotation.JsonIgnore;
  8. import com.fasterxml.jackson.annotation.JsonInclude;
  9. import com.fasterxml.jackson.annotation.JsonProperty;
  10. import com.fasterxml.jackson.annotation.JsonPropertyDescription;
  11. import com.fasterxml.jackson.annotation.JsonPropertyOrder;


  12. /**
  13.  * Defines a vulnerability in the NVD data feed.
  14.  *
  15.  */
  16. @JsonInclude(JsonInclude.Include.NON_NULL)
  17. @JsonPropertyOrder({
  18.     "cve",
  19.     "configurations",
  20.     "impact"
  21. })
  22. @Generated("jsonschema2pojo")
  23. public class DefCveItem {

  24.     /**
  25.      *
  26.      * (Required)
  27.      *
  28.      */
  29.     @JsonProperty("cve")
  30.     private CVEJSON40Min11 cve;
  31.     /**
  32.      * Defines the set of product configurations for a NVD applicability statement.
  33.      *
  34.      */
  35.     @JsonProperty("configurations")
  36.     @JsonPropertyDescription("Defines the set of product configurations for a NVD applicability statement.")
  37.     private DefConfigurations configurations;
  38.     /**
  39.      * Impact scores for a vulnerability as found on NVD.
  40.      *
  41.      */
  42.     @JsonProperty("impact")
  43.     @JsonPropertyDescription("Impact scores for a vulnerability as found on NVD.")
  44.     private DefImpact impact;
  45.     @JsonIgnore
  46.     private Map<String, Object> additionalProperties = new LinkedHashMap<String, Object>();

  47.     /**
  48.      *
  49.      * (Required)
  50.      *
  51.      */
  52.     @JsonProperty("cve")
  53.     public CVEJSON40Min11 getCve() {
  54.         return cve;
  55.     }

  56.     /**
  57.      *
  58.      * (Required)
  59.      *
  60.      */
  61.     @JsonProperty("cve")
  62.     public void setCve(CVEJSON40Min11 cve) {
  63.         this.cve = cve;
  64.     }

  65.     /**
  66.      * Defines the set of product configurations for a NVD applicability statement.
  67.      *
  68.      */
  69.     @JsonProperty("configurations")
  70.     public DefConfigurations getConfigurations() {
  71.         return configurations;
  72.     }

  73.     /**
  74.      * Defines the set of product configurations for a NVD applicability statement.
  75.      *
  76.      */
  77.     @JsonProperty("configurations")
  78.     public void setConfigurations(DefConfigurations configurations) {
  79.         this.configurations = configurations;
  80.     }

  81.     /**
  82.      * Impact scores for a vulnerability as found on NVD.
  83.      *
  84.      */
  85.     @JsonProperty("impact")
  86.     public DefImpact getImpact() {
  87.         return impact;
  88.     }

  89.     /**
  90.      * Impact scores for a vulnerability as found on NVD.
  91.      *
  92.      */
  93.     @JsonProperty("impact")
  94.     public void setImpact(DefImpact impact) {
  95.         this.impact = impact;
  96.     }

  97.     @JsonAnyGetter
  98.     public Map<String, Object> getAdditionalProperties() {
  99.         return this.additionalProperties;
  100.     }

  101.     @JsonAnySetter
  102.     public void setAdditionalProperty(String name, Object value) {
  103.         this.additionalProperties.put(name, value);
  104.     }

  105.     @Override
  106.     public String toString() {
  107.         StringBuilder sb = new StringBuilder();
  108.         sb.append(DefCveItem.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
  109.         sb.append("cve");
  110.         sb.append('=');
  111.         sb.append(((this.cve == null)?"<null>":this.cve));
  112.         sb.append(',');
  113.         sb.append("configurations");
  114.         sb.append('=');
  115.         sb.append(((this.configurations == null)?"<null>":this.configurations));
  116.         sb.append(',');
  117.         sb.append("impact");
  118.         sb.append('=');
  119.         sb.append(((this.impact == null)?"<null>":this.impact));
  120.         sb.append(',');
  121.         sb.append("additionalProperties");
  122.         sb.append('=');
  123.         sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
  124.         sb.append(',');
  125.         if (sb.charAt((sb.length()- 1)) == ',') {
  126.             sb.setCharAt((sb.length()- 1), ']');
  127.         } else {
  128.             sb.append(']');
  129.         }
  130.         return sb.toString();
  131.     }

  132.     @Override
  133.     public int hashCode() {
  134.         int result = 1;
  135.         result = ((result* 31)+((this.cve == null)? 0 :this.cve.hashCode()));
  136.         result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
  137.         result = ((result* 31)+((this.configurations == null)? 0 :this.configurations.hashCode()));
  138.         result = ((result* 31)+((this.impact == null)? 0 :this.impact.hashCode()));
  139.         return result;
  140.     }

  141.     @Override
  142.     public boolean equals(Object other) {
  143.         if (other == this) {
  144.             return true;
  145.         }
  146.         if ((other instanceof DefCveItem) == false) {
  147.             return false;
  148.         }
  149.         DefCveItem rhs = ((DefCveItem) other);
  150.         return (((((this.cve == rhs.cve)||((this.cve!= null)&&this.cve.equals(rhs.cve)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.configurations == rhs.configurations)||((this.configurations!= null)&&this.configurations.equals(rhs.configurations))))&&((this.impact == rhs.impact)||((this.impact!= null)&&this.impact.equals(rhs.impact))));
  151.     }

  152. }