Vulnerability.java

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

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

  11. @JsonInclude(JsonInclude.Include.NON_NULL)
  12. @JsonPropertyOrder({
  13.     "cveID",
  14.     "vendorProject",
  15.     "product",
  16.     "vulnerabilityName",
  17.     "dateAdded",
  18.     "shortDescription",
  19.     "requiredAction",
  20.     "dueDate",
  21.     "notes"
  22. })
  23. public class Vulnerability {

  24.     /**
  25.      * The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits
  26.      * (Required)
  27.      *
  28.      */
  29.     @JsonProperty("cveID")
  30.     @JsonPropertyDescription("The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits")
  31.     private String cveID;
  32.     /**
  33.      * The vendor or project name for the vulnerability
  34.      * (Required)
  35.      *
  36.      */
  37.     @JsonProperty("vendorProject")
  38.     @JsonPropertyDescription("The vendor or project name for the vulnerability")
  39.     private String vendorProject;
  40.     /**
  41.      * The vulnerability product
  42.      * (Required)
  43.      *
  44.      */
  45.     @JsonProperty("product")
  46.     @JsonPropertyDescription("The vulnerability product")
  47.     private String product;
  48.     /**
  49.      * The name of the vulnerability
  50.      * (Required)
  51.      *
  52.      */
  53.     @JsonProperty("vulnerabilityName")
  54.     @JsonPropertyDescription("The name of the vulnerability")
  55.     private String vulnerabilityName;
  56.     /**
  57.      * The date the vulnerability was added to the catalog in the format YYYY-MM-DD
  58.      * (Required)
  59.      *
  60.      */
  61.     @JsonProperty("dateAdded")
  62.     @JsonPropertyDescription("The date the vulnerability was added to the catalog in the format YYYY-MM-DD")
  63.     private String dateAdded;
  64.     /**
  65.      * A short description of the vulnerability
  66.      * (Required)
  67.      *
  68.      */
  69.     @JsonProperty("shortDescription")
  70.     @JsonPropertyDescription("A short description of the vulnerability")
  71.     private String shortDescription;
  72.     /**
  73.      * The required action to address the vulnerability
  74.      * (Required)
  75.      *
  76.      */
  77.     @JsonProperty("requiredAction")
  78.     @JsonPropertyDescription("The required action to address the vulnerability")
  79.     private String requiredAction;
  80.     /**
  81.      * The date the required action is due in the format YYYY-MM-DD
  82.      * (Required)
  83.      *
  84.      */
  85.     @JsonProperty("dueDate")
  86.     @JsonPropertyDescription("The date the required action is due in the format YYYY-MM-DD")
  87.     private String dueDate;
  88.     /**
  89.      * Any additional notes about the vulnerability
  90.      *
  91.      */
  92.     @JsonProperty("notes")
  93.     @JsonPropertyDescription("Any additional notes about the vulnerability")
  94.     private String notes;
  95.     @JsonIgnore
  96.     private Map<String, Object> additionalProperties = new LinkedHashMap<String, Object>();

  97.     /**
  98.      * The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits
  99.      * (Required)
  100.      *
  101.      */
  102.     @JsonProperty("cveID")
  103.     public String getCveID() {
  104.         return cveID;
  105.     }

  106.     /**
  107.      * The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits
  108.      * (Required)
  109.      *
  110.      */
  111.     @JsonProperty("cveID")
  112.     public void setCveID(String cveID) {
  113.         this.cveID = cveID;
  114.     }

  115.     /**
  116.      * The vendor or project name for the vulnerability
  117.      * (Required)
  118.      *
  119.      */
  120.     @JsonProperty("vendorProject")
  121.     public String getVendorProject() {
  122.         return vendorProject;
  123.     }

  124.     /**
  125.      * The vendor or project name for the vulnerability
  126.      * (Required)
  127.      *
  128.      */
  129.     @JsonProperty("vendorProject")
  130.     public void setVendorProject(String vendorProject) {
  131.         this.vendorProject = vendorProject;
  132.     }

  133.     /**
  134.      * The vulnerability product
  135.      * (Required)
  136.      *
  137.      */
  138.     @JsonProperty("product")
  139.     public String getProduct() {
  140.         return product;
  141.     }

  142.     /**
  143.      * The vulnerability product
  144.      * (Required)
  145.      *
  146.      */
  147.     @JsonProperty("product")
  148.     public void setProduct(String product) {
  149.         this.product = product;
  150.     }

  151.     /**
  152.      * The name of the vulnerability
  153.      * (Required)
  154.      *
  155.      */
  156.     @JsonProperty("vulnerabilityName")
  157.     public String getVulnerabilityName() {
  158.         return vulnerabilityName;
  159.     }

  160.     /**
  161.      * The name of the vulnerability
  162.      * (Required)
  163.      *
  164.      */
  165.     @JsonProperty("vulnerabilityName")
  166.     public void setVulnerabilityName(String vulnerabilityName) {
  167.         this.vulnerabilityName = vulnerabilityName;
  168.     }

  169.     /**
  170.      * The date the vulnerability was added to the catalog in the format YYYY-MM-DD
  171.      * (Required)
  172.      *
  173.      */
  174.     @JsonProperty("dateAdded")
  175.     public String getDateAdded() {
  176.         return dateAdded;
  177.     }

  178.     /**
  179.      * The date the vulnerability was added to the catalog in the format YYYY-MM-DD
  180.      * (Required)
  181.      *
  182.      */
  183.     @JsonProperty("dateAdded")
  184.     public void setDateAdded(String dateAdded) {
  185.         this.dateAdded = dateAdded;
  186.     }

  187.     /**
  188.      * A short description of the vulnerability
  189.      * (Required)
  190.      *
  191.      */
  192.     @JsonProperty("shortDescription")
  193.     public String getShortDescription() {
  194.         return shortDescription;
  195.     }

  196.     /**
  197.      * A short description of the vulnerability
  198.      * (Required)
  199.      *
  200.      */
  201.     @JsonProperty("shortDescription")
  202.     public void setShortDescription(String shortDescription) {
  203.         this.shortDescription = shortDescription;
  204.     }

  205.     /**
  206.      * The required action to address the vulnerability
  207.      * (Required)
  208.      *
  209.      */
  210.     @JsonProperty("requiredAction")
  211.     public String getRequiredAction() {
  212.         return requiredAction;
  213.     }

  214.     /**
  215.      * The required action to address the vulnerability
  216.      * (Required)
  217.      *
  218.      */
  219.     @JsonProperty("requiredAction")
  220.     public void setRequiredAction(String requiredAction) {
  221.         this.requiredAction = requiredAction;
  222.     }

  223.     /**
  224.      * The date the required action is due in the format YYYY-MM-DD
  225.      * (Required)
  226.      *
  227.      */
  228.     @JsonProperty("dueDate")
  229.     public String getDueDate() {
  230.         return dueDate;
  231.     }

  232.     /**
  233.      * The date the required action is due in the format YYYY-MM-DD
  234.      * (Required)
  235.      *
  236.      */
  237.     @JsonProperty("dueDate")
  238.     public void setDueDate(String dueDate) {
  239.         this.dueDate = dueDate;
  240.     }

  241.     /**
  242.      * Any additional notes about the vulnerability
  243.      *
  244.      */
  245.     @JsonProperty("notes")
  246.     public String getNotes() {
  247.         return notes;
  248.     }

  249.     /**
  250.      * Any additional notes about the vulnerability
  251.      *
  252.      */
  253.     @JsonProperty("notes")
  254.     public void setNotes(String notes) {
  255.         this.notes = notes;
  256.     }

  257.     @JsonAnyGetter
  258.     public Map<String, Object> getAdditionalProperties() {
  259.         return this.additionalProperties;
  260.     }

  261.     @JsonAnySetter
  262.     public void setAdditionalProperty(String name, Object value) {
  263.         this.additionalProperties.put(name, value);
  264.     }

  265.     @Override
  266.     public String toString() {
  267.         StringBuilder sb = new StringBuilder();
  268.         sb.append(Vulnerability.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
  269.         sb.append("cveID");
  270.         sb.append('=');
  271.         sb.append(((this.cveID == null)?"<null>":this.cveID));
  272.         sb.append(',');
  273.         sb.append("vendorProject");
  274.         sb.append('=');
  275.         sb.append(((this.vendorProject == null)?"<null>":this.vendorProject));
  276.         sb.append(',');
  277.         sb.append("product");
  278.         sb.append('=');
  279.         sb.append(((this.product == null)?"<null>":this.product));
  280.         sb.append(',');
  281.         sb.append("vulnerabilityName");
  282.         sb.append('=');
  283.         sb.append(((this.vulnerabilityName == null)?"<null>":this.vulnerabilityName));
  284.         sb.append(',');
  285.         sb.append("dateAdded");
  286.         sb.append('=');
  287.         sb.append(((this.dateAdded == null)?"<null>":this.dateAdded));
  288.         sb.append(',');
  289.         sb.append("shortDescription");
  290.         sb.append('=');
  291.         sb.append(((this.shortDescription == null)?"<null>":this.shortDescription));
  292.         sb.append(',');
  293.         sb.append("requiredAction");
  294.         sb.append('=');
  295.         sb.append(((this.requiredAction == null)?"<null>":this.requiredAction));
  296.         sb.append(',');
  297.         sb.append("dueDate");
  298.         sb.append('=');
  299.         sb.append(((this.dueDate == null)?"<null>":this.dueDate));
  300.         sb.append(',');
  301.         sb.append("notes");
  302.         sb.append('=');
  303.         sb.append(((this.notes == null)?"<null>":this.notes));
  304.         sb.append(',');
  305.         sb.append("additionalProperties");
  306.         sb.append('=');
  307.         sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
  308.         sb.append(',');
  309.         if (sb.charAt((sb.length()- 1)) == ',') {
  310.             sb.setCharAt((sb.length()- 1), ']');
  311.         } else {
  312.             sb.append(']');
  313.         }
  314.         return sb.toString();
  315.     }

  316.     @Override
  317.     public int hashCode() {
  318.         int result = 1;
  319.         result = ((result* 31)+((this.product == null)? 0 :this.product.hashCode()));
  320.         result = ((result* 31)+((this.vulnerabilityName == null)? 0 :this.vulnerabilityName.hashCode()));
  321.         result = ((result* 31)+((this.notes == null)? 0 :this.notes.hashCode()));
  322.         result = ((result* 31)+((this.cveID == null)? 0 :this.cveID.hashCode()));
  323.         result = ((result* 31)+((this.dueDate == null)? 0 :this.dueDate.hashCode()));
  324.         result = ((result* 31)+((this.vendorProject == null)? 0 :this.vendorProject.hashCode()));
  325.         result = ((result* 31)+((this.shortDescription == null)? 0 :this.shortDescription.hashCode()));
  326.         result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
  327.         result = ((result* 31)+((this.requiredAction == null)? 0 :this.requiredAction.hashCode()));
  328.         result = ((result* 31)+((this.dateAdded == null)? 0 :this.dateAdded.hashCode()));
  329.         return result;
  330.     }

  331.     @Override
  332.     public boolean equals(Object other) {
  333.         if (other == this) {
  334.             return true;
  335.         }
  336.         if ((other instanceof Vulnerability) == false) {
  337.             return false;
  338.         }
  339.         Vulnerability rhs = ((Vulnerability) other);
  340.         return (((((((((((this.product == rhs.product)||((this.product!= null)&&this.product.equals(rhs.product)))&&((this.vulnerabilityName == rhs.vulnerabilityName)||((this.vulnerabilityName!= null)&&this.vulnerabilityName.equals(rhs.vulnerabilityName))))&&((this.notes == rhs.notes)||((this.notes!= null)&&this.notes.equals(rhs.notes))))&&((this.cveID == rhs.cveID)||((this.cveID!= null)&&this.cveID.equals(rhs.cveID))))&&((this.dueDate == rhs.dueDate)||((this.dueDate!= null)&&this.dueDate.equals(rhs.dueDate))))&&((this.vendorProject == rhs.vendorProject)||((this.vendorProject!= null)&&this.vendorProject.equals(rhs.vendorProject))))&&((this.shortDescription == rhs.shortDescription)||((this.shortDescription!= null)&&this.shortDescription.equals(rhs.shortDescription))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.requiredAction == rhs.requiredAction)||((this.requiredAction!= null)&&this.requiredAction.equals(rhs.requiredAction))))&&((this.dateAdded == rhs.dateAdded)||((this.dateAdded!= null)&&this.dateAdded.equals(rhs.dateAdded))));
  341.     }

  342. }