1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.owasp.dependencycheck.xml.pom;
19
20 import java.io.Serializable;
21 import org.apache.commons.lang3.builder.EqualsBuilder;
22 import org.apache.commons.lang3.builder.HashCodeBuilder;
23
24 import javax.annotation.concurrent.ThreadSafe;
25
26
27
28
29
30 @ThreadSafe
31 public class License implements Serializable {
32
33
34
35
36 private static final long serialVersionUID = 7009115254312746992L;
37
38
39
40
41 private String url;
42
43
44
45 private String name;
46
47
48
49
50 public License() {
51 }
52
53
54
55
56
57
58
59 public License(String name, String url) {
60 this.url = url;
61 this.name = name;
62
63 }
64
65
66
67
68
69
70 public String getUrl() {
71 return url;
72 }
73
74
75
76
77
78
79 public void setUrl(String url) {
80 this.url = url;
81 }
82
83
84
85
86
87
88 public String getName() {
89 return name;
90 }
91
92
93
94
95
96
97 public void setName(String name) {
98 this.name = name;
99 }
100
101
102
103
104
105
106 @Override
107 public int hashCode() {
108 return new HashCodeBuilder(13, 49)
109 .append(name)
110 .append(url)
111 .toHashCode();
112 }
113
114
115
116
117
118
119
120 @Override
121 public boolean equals(Object obj) {
122 if (obj == null || !(obj instanceof License)) {
123 return false;
124 }
125 if (this == obj) {
126 return true;
127 }
128 final License rhs = (License) obj;
129 return new EqualsBuilder()
130 .append(name, rhs.name)
131 .append(url, rhs.url)
132 .isEquals();
133 }
134
135
136
137
138
139
140 @Override
141 public String toString() {
142 return "License{" + "url=" + url + ", name=" + name + '}';
143 }
144
145 }