1
2
3
4
5
6 package org.apache.maven.plugin.doap.options;
7
8
9
10
11
12
13 @SuppressWarnings( "all" )
14 public class DoapArtifact
15 implements java.io.Serializable
16 {
17
18
19
20
21
22
23
24
25 private String groupId;
26
27
28
29
30 private String artifactId;
31
32
33
34
35 private String version;
36
37
38
39
40
41 private String doapFileName;
42
43
44
45
46
47
48
49
50
51
52
53
54 public boolean equals( Object other )
55 {
56 if ( this == other )
57 {
58 return true;
59 }
60
61 if ( !( other instanceof DoapArtifact ) )
62 {
63 return false;
64 }
65
66 DoapArtifact that = (DoapArtifact) other;
67 boolean result = true;
68
69 result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) );
70 result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) );
71 result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) );
72 result = result && ( getDoapFileName() == null ? that.getDoapFileName() == null : getDoapFileName().equals( that.getDoapFileName() ) );
73
74 return result;
75 }
76
77
78
79
80
81
82 public String getArtifactId()
83 {
84 return this.artifactId;
85 }
86
87
88
89
90
91
92 public String getGroupId()
93 {
94 return this.groupId;
95 }
96
97
98
99
100
101
102 public String getVersion()
103 {
104 return this.version;
105 }
106
107
108
109
110
111
112 public int hashCode()
113 {
114 int result = 17;
115
116 result = 37 * result + ( groupId != null ? groupId.hashCode() : 0 );
117 result = 37 * result + ( artifactId != null ? artifactId.hashCode() : 0 );
118 result = 37 * result + ( version != null ? version.hashCode() : 0 );
119 result = 37 * result + ( doapFileName != null ? doapFileName.hashCode() : 0 );
120
121 return result;
122 }
123
124
125
126
127
128
129 public void setArtifactId( String artifactId )
130 {
131 this.artifactId = artifactId;
132 }
133
134
135
136
137
138
139
140 public void setDoapFileName( String doapFileName )
141 {
142 this.doapFileName = doapFileName;
143 }
144
145
146
147
148
149
150 public void setGroupId( String groupId )
151 {
152 this.groupId = groupId;
153 }
154
155
156
157
158
159
160 public void setVersion( String version )
161 {
162 this.version = version;
163 }
164
165
166
167
168
169
170 public java.lang.String toString()
171 {
172 StringBuilder buf = new StringBuilder( 128 );
173
174 buf.append( "groupId = '" );
175 buf.append( getGroupId() );
176 buf.append( "'" );
177 buf.append( "\n" );
178 buf.append( "artifactId = '" );
179 buf.append( getArtifactId() );
180 buf.append( "'" );
181 buf.append( "\n" );
182 buf.append( "version = '" );
183 buf.append( getVersion() );
184 buf.append( "'" );
185 buf.append( "\n" );
186 buf.append( "doapFileName = '" );
187 buf.append( getDoapFileName() );
188 buf.append( "'" );
189
190 return buf.toString();
191 }
192
193
194
195
196
197
198
199
200
201 public String getDoapFileName()
202 {
203 if ( org.codehaus.plexus.util.StringUtils.isEmpty( this.doapFileName ) )
204 {
205 return "doap_" + this.artifactId + ".rdf";
206 }
207 return this.doapFileName;
208 }
209
210
211
212
213 public String toConfiguration()
214 {
215 java.lang.StringBuilder sb = new java.lang.StringBuilder();
216 sb.append( "<artifact>" );
217 sb.append( "<groupId>" ).append( this.groupId ).append( "</groupId>" );
218 sb.append( "<artifactId>" ).append( this.artifactId ).append( "</artifactId>" );
219 sb.append( "<version>" ).append( this.version ).append( "</version>" );
220 sb.append( "</artifact>" );
221
222 return sb.toString();
223 }
224
225
226 }