1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.owasp.dependencycheck.data.nuget;
19
20 import org.apache.commons.lang3.builder.EqualsBuilder;
21 import org.apache.commons.lang3.builder.HashCodeBuilder;
22
23
24
25
26
27
28 public class NugetPackageReference {
29
30
31
32
33 private String id;
34
35
36
37
38 private String version;
39
40
41
42
43
44
45 public void setId(String id) {
46 this.id = id;
47 }
48
49
50
51
52
53
54 public String getId() {
55 return id;
56 }
57
58
59
60
61
62
63 public void setVersion(String version) {
64 this.version = version;
65 }
66
67
68
69
70
71
72 public String getVersion() {
73 return version;
74 }
75
76
77
78
79 @Override
80 public boolean equals(Object obj) {
81 if (obj == null || !(obj instanceof NugetPackageReference)) {
82 return false;
83 }
84 if (this == obj) {
85 return true;
86 }
87 final NugetPackageReference rhs = (NugetPackageReference) obj;
88 return new EqualsBuilder()
89 .append(id, rhs.id)
90 .append(version, rhs.version)
91 .isEquals();
92 }
93
94
95
96
97 @Override
98 public int hashCode() {
99 return new HashCodeBuilder(7, 89)
100 .append(id)
101 .append(version)
102 .toHashCode();
103 }
104 }