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