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