1 package org.apache.archiva.model;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 @SuppressWarnings( "all" )
28 public class ArchivaRepositoryMetadata
29 implements java.io.Serializable
30 {
31
32
33
34
35
36
37
38
39
40
41 private String groupId;
42
43
44
45
46
47
48 private String artifactId;
49
50
51
52
53
54
55 private String version;
56
57
58
59
60
61
62 private String latestVersion;
63
64
65
66
67
68
69 private String releasedVersion;
70
71
72
73
74
75
76 private SnapshotVersion snapshotVersion;
77
78
79
80
81 private java.util.List<Plugin> plugins;
82
83
84
85
86 private java.util.List<String> availableVersions;
87
88
89
90
91
92
93 private String lastUpdated;
94
95
96
97
98
99
100 private java.util.Date fileLastModified;
101
102
103
104
105
106
107 private long fileSize = 0L;
108
109
110
111
112
113
114
115
116
117
118
119 public void addAvailableVersion( String string )
120 {
121 getAvailableVersions().add( string );
122 }
123
124
125
126
127
128
129 public void addPlugin( Plugin plugin )
130 {
131 getPlugins().add( plugin );
132 }
133
134
135
136
137
138
139
140 public boolean equals( Object other )
141 {
142 if ( this == other )
143 {
144 return true;
145 }
146
147 if ( !( other instanceof ArchivaRepositoryMetadata ) )
148 {
149 return false;
150 }
151
152 ArchivaRepositoryMetadatapache/archiva/model/ArchivaRepositoryMetadata.html#ArchivaRepositoryMetadata">ArchivaRepositoryMetadata that = (ArchivaRepositoryMetadata) other;
153 boolean result = true;
154
155 result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) );
156 result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) );
157 result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) );
158
159 return result;
160 }
161
162
163
164
165
166
167 public String getArtifactId()
168 {
169 return this.artifactId;
170 }
171
172
173
174
175
176
177 public java.util.List<String> getAvailableVersions()
178 {
179 if ( this.availableVersions == null )
180 {
181 this.availableVersions = new java.util.ArrayList<String>();
182 }
183
184 return this.availableVersions;
185 }
186
187
188
189
190
191
192 public java.util.Date getFileLastModified()
193 {
194 return this.fileLastModified;
195 }
196
197
198
199
200
201
202 public long getFileSize()
203 {
204 return this.fileSize;
205 }
206
207
208
209
210
211
212 public String getGroupId()
213 {
214 return this.groupId;
215 }
216
217
218
219
220
221
222 public String getLastUpdated()
223 {
224 return this.lastUpdated;
225 }
226
227
228
229
230
231
232 public String getLatestVersion()
233 {
234 return this.latestVersion;
235 }
236
237
238
239
240
241
242 public java.util.List<Plugin> getPlugins()
243 {
244 if ( this.plugins == null )
245 {
246 this.plugins = new java.util.ArrayList<Plugin>();
247 }
248
249 return this.plugins;
250 }
251
252
253
254
255
256
257 public String getReleasedVersion()
258 {
259 return this.releasedVersion;
260 }
261
262
263
264
265
266
267 public SnapshotVersion getSnapshotVersion()
268 {
269 return this.snapshotVersion;
270 }
271
272
273
274
275
276
277 public String getVersion()
278 {
279 return this.version;
280 }
281
282
283
284
285
286
287 public int hashCode()
288 {
289 int result = 17;
290
291 result = 37 * result + ( groupId != null ? groupId.hashCode() : 0 );
292 result = 37 * result + ( artifactId != null ? artifactId.hashCode() : 0 );
293 result = 37 * result + ( version != null ? version.hashCode() : 0 );
294
295 return result;
296 }
297
298
299
300
301
302
303 public void removeAvailableVersion( String string )
304 {
305 getAvailableVersions().remove( string );
306 }
307
308
309
310
311
312
313 public void removePlugin( Plugin plugin )
314 {
315 getPlugins().remove( plugin );
316 }
317
318
319
320
321
322
323 public void setArtifactId( String artifactId )
324 {
325 this.artifactId = artifactId;
326 }
327
328
329
330
331
332
333 public void setAvailableVersions( java.util.List<String> availableVersions )
334 {
335 this.availableVersions = availableVersions;
336 }
337
338
339
340
341
342
343 public void setFileLastModified( java.util.Date fileLastModified )
344 {
345 this.fileLastModified = fileLastModified;
346 }
347
348
349
350
351
352
353 public void setFileSize( long fileSize )
354 {
355 this.fileSize = fileSize;
356 }
357
358
359
360
361
362
363 public void setGroupId( String groupId )
364 {
365 this.groupId = groupId;
366 }
367
368
369
370
371
372
373 public void setLastUpdated( String lastUpdated )
374 {
375 this.lastUpdated = lastUpdated;
376 }
377
378
379
380
381
382
383 public void setLatestVersion( String latestVersion )
384 {
385 this.latestVersion = latestVersion;
386 }
387
388
389
390
391
392
393 public void setPlugins( java.util.List<Plugin> plugins )
394 {
395 this.plugins = plugins;
396 }
397
398
399
400
401
402
403 public void setReleasedVersion( String releasedVersion )
404 {
405 this.releasedVersion = releasedVersion;
406 }
407
408
409
410
411
412
413 public void setSnapshotVersion( SnapshotVersion snapshotVersion )
414 {
415 this.snapshotVersion = snapshotVersion;
416 }
417
418
419
420
421
422
423 public void setVersion( String version )
424 {
425 this.version = version;
426 }
427
428
429
430
431
432
433 public java.lang.String toString()
434 {
435 StringBuilder buf = new StringBuilder( 128 );
436
437 buf.append( "groupId = '" );
438 buf.append( getGroupId() );
439 buf.append( "'" );
440 buf.append( "\n" );
441 buf.append( "artifactId = '" );
442 buf.append( getArtifactId() );
443 buf.append( "'" );
444 buf.append( "\n" );
445 buf.append( "version = '" );
446 buf.append( getVersion() );
447 buf.append( "'" );
448
449 return buf.toString();
450 }
451
452
453 private static final long serialVersionUID = 914715358219606100L;
454
455
456 public void updateTimestamp()
457 {
458 setLastUpdatedTimestamp( new java.util.Date() );
459 }
460
461 public void setLastUpdatedTimestamp( java.util.Date date )
462 {
463 java.util.TimeZone timezone = java.util.TimeZone.getTimeZone( "UTC" );
464 java.text.DateFormat fmt = new java.text.SimpleDateFormat( "yyyyMMddHHmmss" );
465 fmt.setTimeZone( timezone );
466 setLastUpdated( fmt.format( date ) );
467 }
468
469 }