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.model;
25
26
27
28
29
30
31
32
33 @SuppressWarnings( "all" )
34 public class RepositoryBase
35 implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
36 {
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 private String id;
56
57
58
59
60 private String name;
61
62
63
64
65
66
67
68
69
70 private String url;
71
72
73
74
75
76
77
78
79
80
81
82 private String layout = "default";
83
84
85
86
87 private java.util.Map<Object, InputLocation> locations;
88
89
90
91
92 private InputLocation location;
93
94
95
96
97 private InputLocation idLocation;
98
99
100
101
102 private InputLocation nameLocation;
103
104
105
106
107 private InputLocation urlLocation;
108
109
110
111
112 private InputLocation layoutLocation;
113
114
115
116
117
118
119
120
121
122
123
124 public RepositoryBase clone()
125 {
126 try
127 {
128 RepositoryBase copy = (RepositoryBase) super.clone();
129
130 if ( copy.locations != null )
131 {
132 copy.locations = new java.util.LinkedHashMap( copy.locations );
133 }
134
135 return copy;
136 }
137 catch ( java.lang.Exception ex )
138 {
139 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
140 + " does not support clone()" ).initCause( ex );
141 }
142 }
143
144
145
146
147
148
149
150 public boolean equals( Object other )
151 {
152 if ( this == other )
153 {
154 return true;
155 }
156
157 if ( !( other instanceof RepositoryBase ) )
158 {
159 return false;
160 }
161
162 RepositoryBase that = (RepositoryBase) other;
163 boolean result = true;
164
165 result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
166
167 return result;
168 }
169
170
171
172
173
174
175
176
177
178
179
180
181 public String getId()
182 {
183 return this.id;
184 }
185
186
187
188
189
190
191
192
193
194 public String getLayout()
195 {
196 return this.layout;
197 }
198
199
200
201
202
203
204
205 public InputLocation getLocation( Object key )
206 {
207 if ( key instanceof String )
208 {
209 switch ( ( String ) key )
210 {
211 case "" :
212 {
213 return this.location;
214 }
215 case "id" :
216 {
217 return idLocation;
218 }
219 case "name" :
220 {
221 return nameLocation;
222 }
223 case "url" :
224 {
225 return urlLocation;
226 }
227 case "layout" :
228 {
229 return layoutLocation;
230 }
231 default :
232 {
233 return getOtherLocation( key );
234 }
235 }
236 }
237 else
238 {
239 return getOtherLocation( key );
240 }
241 }
242
243
244
245
246
247
248 public String getName()
249 {
250 return this.name;
251 }
252
253
254
255
256
257
258
259 public void setLocation( Object key, InputLocation location )
260 {
261 if ( key instanceof String )
262 {
263 switch ( ( String ) key )
264 {
265 case "" :
266 {
267 this.location = location;
268 return;
269 }
270 case "id" :
271 {
272 idLocation = location;
273 return;
274 }
275 case "name" :
276 {
277 nameLocation = location;
278 return;
279 }
280 case "url" :
281 {
282 urlLocation = location;
283 return;
284 }
285 case "layout" :
286 {
287 layoutLocation = location;
288 return;
289 }
290 default :
291 {
292 setOtherLocation( key, location );
293 return;
294 }
295 }
296 }
297 else
298 {
299 setOtherLocation( key, location );
300 }
301 }
302
303
304
305
306
307
308
309 public void setOtherLocation( Object key, InputLocation location )
310 {
311 if ( location != null )
312 {
313 if ( this.locations == null )
314 {
315 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
316 }
317 this.locations.put( key, location );
318 }
319 }
320
321
322
323
324
325
326
327 private InputLocation getOtherLocation( Object key )
328 {
329 return ( locations != null ) ? locations.get( key ) : null;
330 }
331
332
333
334
335
336
337
338 public String getUrl()
339 {
340 return this.url;
341 }
342
343
344
345
346
347
348 public int hashCode()
349 {
350 int result = 17;
351
352 result = 37 * result + ( id != null ? id.hashCode() : 0 );
353
354 return result;
355 }
356
357
358
359
360
361
362
363
364
365
366
367
368 public void setId( String id )
369 {
370 this.id = id;
371 }
372
373
374
375
376
377
378
379
380
381 public void setLayout( String layout )
382 {
383 this.layout = layout;
384 }
385
386
387
388
389
390
391 public void setName( String name )
392 {
393 this.name = name;
394 }
395
396
397
398
399
400
401
402 public void setUrl( String url )
403 {
404 this.url = url;
405 }
406
407
408
409
410
411
412 public java.lang.String toString()
413 {
414 StringBuilder buf = new StringBuilder( 128 );
415
416 buf.append( "id = '" );
417 buf.append( getId() );
418 buf.append( "'" );
419
420 return buf.toString();
421 }
422
423 }