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