1
2
3
4
5
6
7
8 package org.apache.maven.archetype.catalog;
9
10
11
12
13
14
15 @SuppressWarnings( "all" )
16 public class Archetype
17 implements java.io.Serializable
18 {
19
20
21
22
23
24
25
26
27 private String groupId;
28
29
30
31
32 private String artifactId;
33
34
35
36
37
38 private String version;
39
40
41
42
43
44
45 private String repository;
46
47
48
49
50 private String description;
51
52
53
54
55 private java.util.List<String> goals;
56
57
58
59
60 private java.util.Properties properties;
61
62
63
64
65
66
67
68
69
70
71
72 public void addGoal( String string )
73 {
74 getGoals().add( string );
75 }
76
77
78
79
80
81
82
83 public void addProperty( String key, String value )
84 {
85 getProperties().put( key, value );
86 }
87
88
89
90
91
92
93 public String getArtifactId()
94 {
95 return this.artifactId;
96 }
97
98
99
100
101
102
103 public String getDescription()
104 {
105 return this.description;
106 }
107
108
109
110
111
112
113 public java.util.List<String> getGoals()
114 {
115 if ( this.goals == null )
116 {
117 this.goals = new java.util.ArrayList<String>();
118 }
119
120 return this.goals;
121 }
122
123
124
125
126
127
128 public String getGroupId()
129 {
130 return this.groupId;
131 }
132
133
134
135
136
137
138 public java.util.Properties getProperties()
139 {
140 if ( this.properties == null )
141 {
142 this.properties = new java.util.Properties();
143 }
144
145 return this.properties;
146 }
147
148
149
150
151
152
153
154
155 public String getRepository()
156 {
157 return this.repository;
158 }
159
160
161
162
163
164
165
166 public String getVersion()
167 {
168 return this.version;
169 }
170
171
172
173
174
175
176 public void removeGoal( String string )
177 {
178 getGoals().remove( string );
179 }
180
181
182
183
184
185
186 public void setArtifactId( String artifactId )
187 {
188 this.artifactId = artifactId;
189 }
190
191
192
193
194
195
196 public void setDescription( String description )
197 {
198 this.description = description;
199 }
200
201
202
203
204
205
206 public void setGoals( java.util.List<String> goals )
207 {
208 this.goals = goals;
209 }
210
211
212
213
214
215
216 public void setGroupId( String groupId )
217 {
218 this.groupId = groupId;
219 }
220
221
222
223
224
225
226
227 public void setProperties( java.util.Properties properties )
228 {
229 this.properties = properties;
230 }
231
232
233
234
235
236
237
238
239 public void setRepository( String repository )
240 {
241 this.repository = repository;
242 }
243
244
245
246
247
248
249
250 public void setVersion( String version )
251 {
252 this.version = version;
253 }
254
255
256 public String toString()
257 {
258 return "[" + groupId + ":" + artifactId + ":" + version + ( repository != null ? " -> " + repository : "" ) + "]";
259 }
260 public int hashCode()
261 {
262 return groupId.hashCode() + 17 * artifactId.hashCode();
263 }
264 public boolean equals( Object object )
265 {
266 if ( object == null || !( object instanceof Archetype ) )
267 {
268 return false;
269 }
270 else
271 {
272 Archetype a = (Archetype) object;
273 return org.codehaus.plexus.util.StringUtils.equals( groupId, a.getGroupId() )
274 && org.codehaus.plexus.util.StringUtils.equals( artifactId, a.getArtifactId() );
275 }
276 }
277
278 }