View Javadoc
1   
2   package org.owasp.dependencycheck.data.knownexploited.json;
3   
4   import java.util.LinkedHashMap;
5   import java.util.Map;
6   import com.fasterxml.jackson.annotation.JsonAnyGetter;
7   import com.fasterxml.jackson.annotation.JsonAnySetter;
8   import com.fasterxml.jackson.annotation.JsonIgnore;
9   import com.fasterxml.jackson.annotation.JsonInclude;
10  import com.fasterxml.jackson.annotation.JsonProperty;
11  import com.fasterxml.jackson.annotation.JsonPropertyDescription;
12  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
13  
14  @JsonInclude(JsonInclude.Include.NON_NULL)
15  @JsonPropertyOrder({
16      "cveID",
17      "vendorProject",
18      "product",
19      "vulnerabilityName",
20      "dateAdded",
21      "shortDescription",
22      "requiredAction",
23      "dueDate",
24      "notes"
25  })
26  public class Vulnerability {
27  
28      /**
29       * The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits
30       * (Required)
31       * 
32       */
33      @JsonProperty("cveID")
34      @JsonPropertyDescription("The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits")
35      private String cveID;
36      /**
37       * The vendor or project name for the vulnerability
38       * (Required)
39       * 
40       */
41      @JsonProperty("vendorProject")
42      @JsonPropertyDescription("The vendor or project name for the vulnerability")
43      private String vendorProject;
44      /**
45       * The vulnerability product
46       * (Required)
47       * 
48       */
49      @JsonProperty("product")
50      @JsonPropertyDescription("The vulnerability product")
51      private String product;
52      /**
53       * The name of the vulnerability
54       * (Required)
55       * 
56       */
57      @JsonProperty("vulnerabilityName")
58      @JsonPropertyDescription("The name of the vulnerability")
59      private String vulnerabilityName;
60      /**
61       * The date the vulnerability was added to the catalog in the format YYYY-MM-DD
62       * (Required)
63       * 
64       */
65      @JsonProperty("dateAdded")
66      @JsonPropertyDescription("The date the vulnerability was added to the catalog in the format YYYY-MM-DD")
67      private String dateAdded;
68      /**
69       * A short description of the vulnerability
70       * (Required)
71       * 
72       */
73      @JsonProperty("shortDescription")
74      @JsonPropertyDescription("A short description of the vulnerability")
75      private String shortDescription;
76      /**
77       * The required action to address the vulnerability
78       * (Required)
79       * 
80       */
81      @JsonProperty("requiredAction")
82      @JsonPropertyDescription("The required action to address the vulnerability")
83      private String requiredAction;
84      /**
85       * The date the required action is due in the format YYYY-MM-DD
86       * (Required)
87       * 
88       */
89      @JsonProperty("dueDate")
90      @JsonPropertyDescription("The date the required action is due in the format YYYY-MM-DD")
91      private String dueDate;
92      /**
93       * Any additional notes about the vulnerability
94       * 
95       */
96      @JsonProperty("notes")
97      @JsonPropertyDescription("Any additional notes about the vulnerability")
98      private String notes;
99      @JsonIgnore
100     private Map<String, Object> additionalProperties = new LinkedHashMap<String, Object>();
101 
102     /**
103      * The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits
104      * (Required)
105      * 
106      */
107     @JsonProperty("cveID")
108     public String getCveID() {
109         return cveID;
110     }
111 
112     /**
113      * The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits
114      * (Required)
115      * 
116      */
117     @JsonProperty("cveID")
118     public void setCveID(String cveID) {
119         this.cveID = cveID;
120     }
121 
122     /**
123      * The vendor or project name for the vulnerability
124      * (Required)
125      * 
126      */
127     @JsonProperty("vendorProject")
128     public String getVendorProject() {
129         return vendorProject;
130     }
131 
132     /**
133      * The vendor or project name for the vulnerability
134      * (Required)
135      * 
136      */
137     @JsonProperty("vendorProject")
138     public void setVendorProject(String vendorProject) {
139         this.vendorProject = vendorProject;
140     }
141 
142     /**
143      * The vulnerability product
144      * (Required)
145      * 
146      */
147     @JsonProperty("product")
148     public String getProduct() {
149         return product;
150     }
151 
152     /**
153      * The vulnerability product
154      * (Required)
155      * 
156      */
157     @JsonProperty("product")
158     public void setProduct(String product) {
159         this.product = product;
160     }
161 
162     /**
163      * The name of the vulnerability
164      * (Required)
165      * 
166      */
167     @JsonProperty("vulnerabilityName")
168     public String getVulnerabilityName() {
169         return vulnerabilityName;
170     }
171 
172     /**
173      * The name of the vulnerability
174      * (Required)
175      * 
176      */
177     @JsonProperty("vulnerabilityName")
178     public void setVulnerabilityName(String vulnerabilityName) {
179         this.vulnerabilityName = vulnerabilityName;
180     }
181 
182     /**
183      * The date the vulnerability was added to the catalog in the format YYYY-MM-DD
184      * (Required)
185      * 
186      */
187     @JsonProperty("dateAdded")
188     public String getDateAdded() {
189         return dateAdded;
190     }
191 
192     /**
193      * The date the vulnerability was added to the catalog in the format YYYY-MM-DD
194      * (Required)
195      * 
196      */
197     @JsonProperty("dateAdded")
198     public void setDateAdded(String dateAdded) {
199         this.dateAdded = dateAdded;
200     }
201 
202     /**
203      * A short description of the vulnerability
204      * (Required)
205      * 
206      */
207     @JsonProperty("shortDescription")
208     public String getShortDescription() {
209         return shortDescription;
210     }
211 
212     /**
213      * A short description of the vulnerability
214      * (Required)
215      * 
216      */
217     @JsonProperty("shortDescription")
218     public void setShortDescription(String shortDescription) {
219         this.shortDescription = shortDescription;
220     }
221 
222     /**
223      * The required action to address the vulnerability
224      * (Required)
225      * 
226      */
227     @JsonProperty("requiredAction")
228     public String getRequiredAction() {
229         return requiredAction;
230     }
231 
232     /**
233      * The required action to address the vulnerability
234      * (Required)
235      * 
236      */
237     @JsonProperty("requiredAction")
238     public void setRequiredAction(String requiredAction) {
239         this.requiredAction = requiredAction;
240     }
241 
242     /**
243      * The date the required action is due in the format YYYY-MM-DD
244      * (Required)
245      * 
246      */
247     @JsonProperty("dueDate")
248     public String getDueDate() {
249         return dueDate;
250     }
251 
252     /**
253      * The date the required action is due in the format YYYY-MM-DD
254      * (Required)
255      * 
256      */
257     @JsonProperty("dueDate")
258     public void setDueDate(String dueDate) {
259         this.dueDate = dueDate;
260     }
261 
262     /**
263      * Any additional notes about the vulnerability
264      * 
265      */
266     @JsonProperty("notes")
267     public String getNotes() {
268         return notes;
269     }
270 
271     /**
272      * Any additional notes about the vulnerability
273      * 
274      */
275     @JsonProperty("notes")
276     public void setNotes(String notes) {
277         this.notes = notes;
278     }
279 
280     @JsonAnyGetter
281     public Map<String, Object> getAdditionalProperties() {
282         return this.additionalProperties;
283     }
284 
285     @JsonAnySetter
286     public void setAdditionalProperty(String name, Object value) {
287         this.additionalProperties.put(name, value);
288     }
289 
290     @Override
291     public String toString() {
292         StringBuilder sb = new StringBuilder();
293         sb.append(Vulnerability.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
294         sb.append("cveID");
295         sb.append('=');
296         sb.append(((this.cveID == null)?"<null>":this.cveID));
297         sb.append(',');
298         sb.append("vendorProject");
299         sb.append('=');
300         sb.append(((this.vendorProject == null)?"<null>":this.vendorProject));
301         sb.append(',');
302         sb.append("product");
303         sb.append('=');
304         sb.append(((this.product == null)?"<null>":this.product));
305         sb.append(',');
306         sb.append("vulnerabilityName");
307         sb.append('=');
308         sb.append(((this.vulnerabilityName == null)?"<null>":this.vulnerabilityName));
309         sb.append(',');
310         sb.append("dateAdded");
311         sb.append('=');
312         sb.append(((this.dateAdded == null)?"<null>":this.dateAdded));
313         sb.append(',');
314         sb.append("shortDescription");
315         sb.append('=');
316         sb.append(((this.shortDescription == null)?"<null>":this.shortDescription));
317         sb.append(',');
318         sb.append("requiredAction");
319         sb.append('=');
320         sb.append(((this.requiredAction == null)?"<null>":this.requiredAction));
321         sb.append(',');
322         sb.append("dueDate");
323         sb.append('=');
324         sb.append(((this.dueDate == null)?"<null>":this.dueDate));
325         sb.append(',');
326         sb.append("notes");
327         sb.append('=');
328         sb.append(((this.notes == null)?"<null>":this.notes));
329         sb.append(',');
330         sb.append("additionalProperties");
331         sb.append('=');
332         sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
333         sb.append(',');
334         if (sb.charAt((sb.length()- 1)) == ',') {
335             sb.setCharAt((sb.length()- 1), ']');
336         } else {
337             sb.append(']');
338         }
339         return sb.toString();
340     }
341 
342     @Override
343     public int hashCode() {
344         int result = 1;
345         result = ((result* 31)+((this.product == null)? 0 :this.product.hashCode()));
346         result = ((result* 31)+((this.vulnerabilityName == null)? 0 :this.vulnerabilityName.hashCode()));
347         result = ((result* 31)+((this.notes == null)? 0 :this.notes.hashCode()));
348         result = ((result* 31)+((this.cveID == null)? 0 :this.cveID.hashCode()));
349         result = ((result* 31)+((this.dueDate == null)? 0 :this.dueDate.hashCode()));
350         result = ((result* 31)+((this.vendorProject == null)? 0 :this.vendorProject.hashCode()));
351         result = ((result* 31)+((this.shortDescription == null)? 0 :this.shortDescription.hashCode()));
352         result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
353         result = ((result* 31)+((this.requiredAction == null)? 0 :this.requiredAction.hashCode()));
354         result = ((result* 31)+((this.dateAdded == null)? 0 :this.dateAdded.hashCode()));
355         return result;
356     }
357 
358     @Override
359     public boolean equals(Object other) {
360         if (other == this) {
361             return true;
362         }
363         if ((other instanceof Vulnerability) == false) {
364             return false;
365         }
366         Vulnerability rhs = ((Vulnerability) other);
367         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))));
368     }
369 
370 }