1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.maven.plugins.externals;
17
18 public class GAV {
19
20 String groupId;
21 String artifactId;
22 String version;
23
24 public GAV() {
25 this(null, null, null);
26 }
27
28 public GAV(String groupId, String artifactId, String version) {
29 super();
30 this.groupId = groupId;
31 this.artifactId = artifactId;
32 this.version = version;
33 }
34
35 public String getGroupId() {
36 return groupId;
37 }
38
39 public void setGroupId(String groupId) {
40 this.groupId = groupId;
41 }
42
43 public String getArtifactId() {
44 return artifactId;
45 }
46
47 public void setArtifactId(String artifactId) {
48 this.artifactId = artifactId;
49 }
50
51 public String getVersion() {
52 return version;
53 }
54
55 public void setVersion(String version) {
56 this.version = version;
57 }
58
59 @Override
60 public int hashCode() {
61 final int prime = 31;
62 int result = 1;
63 result = prime * result + ((artifactId == null) ? 0 : artifactId.hashCode());
64 result = prime * result + ((groupId == null) ? 0 : groupId.hashCode());
65 result = prime * result + ((version == null) ? 0 : version.hashCode());
66 return result;
67 }
68
69 @Override
70 public boolean equals(Object obj) {
71 if (this == obj)
72 return true;
73 if (obj == null)
74 return false;
75 if (getClass() != obj.getClass())
76 return false;
77 GAV other = (GAV) obj;
78 if (artifactId == null) {
79 if (other.artifactId != null)
80 return false;
81 } else if (!artifactId.equals(other.artifactId))
82 return false;
83 if (groupId == null) {
84 if (other.groupId != null)
85 return false;
86 } else if (!groupId.equals(other.groupId))
87 return false;
88 if (version == null) {
89 if (other.version != null)
90 return false;
91 } else if (!version.equals(other.version))
92 return false;
93 return true;
94 }
95 }