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