1 package com.atlassian.maven.plugins.amps.osgi;
2
3
4
5
6 public class PluginDependency
7 {
8 private String groupId, artifactId;
9
10 public PluginDependency() {
11 }
12
13 public PluginDependency(final String groupId, final String artifactId) {
14 this.groupId = groupId;
15 this.artifactId = artifactId;
16 }
17
18 public String getGroupId() {
19 return groupId;
20 }
21
22 public void setGroupId(final String groupId) {
23 this.groupId = groupId;
24 }
25
26 public String getArtifactId() {
27 return artifactId;
28 }
29
30 public void setArtifactId(final String artifactId) {
31 this.artifactId = artifactId;
32 }
33
34 @Override
35 public boolean equals(Object o)
36 {
37 if (this == o)
38 {
39 return true;
40 }
41 if (!(o instanceof PluginDependency))
42 {
43 return false;
44 }
45
46 PluginDependency that = (PluginDependency) o;
47
48 if (artifactId != null ? !artifactId.equals(that.artifactId) : that.artifactId != null)
49 {
50 return false;
51 }
52 if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != null)
53 {
54 return false;
55 }
56
57 return true;
58 }
59
60 @Override
61 public int hashCode()
62 {
63 int result = groupId != null ? groupId.hashCode() : 0;
64 result = 31 * result + (artifactId != null ? artifactId.hashCode() : 0);
65 return result;
66 }
67
68 @Override
69 public String toString()
70 {
71 return new StringBuilder(groupId).append(":").append(artifactId).toString();
72 }
73 }