View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2013-02-24 03:31:02,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.model;
9   
10  /**
11   * Download policy.
12   * 
13   * @version $Revision$ $Date$
14   */
15  @SuppressWarnings( "all" )
16  public class RepositoryPolicy
17      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
18  {
19  
20        //--------------------------/
21       //- Class/Member Variables -/
22      //--------------------------/
23  
24      /**
25       * 
26       *             
27       *             Whether to use this repository for downloading
28       * this type of artifact. Note: While the type
29       *             of this field is <code>String</code> for
30       * technical reasons, the semantic type is actually
31       *             <code>Boolean</code>. Default value is
32       * <code>true</code>.
33       *             
34       *           
35       */
36      private String enabled;
37  
38      /**
39       * 
40       *             
41       *             The frequency for downloading updates - can be
42       *             <code>always,</code>
43       *             <code>daily</code>
44       *             (default),
45       *             <code>interval:XXX</code>
46       *             (in minutes) or
47       *             <code>never</code>
48       *             (only if it doesn't exist locally).
49       *             
50       *           
51       */
52      private String updatePolicy;
53  
54      /**
55       * 
56       *             
57       *             What to do when verification of an artifact
58       * checksum fails. Valid values are
59       *             <code>ignore</code>
60       *             ,
61       *             <code>fail</code>
62       *             or
63       *             <code>warn</code>
64       *             (the default).
65       *             
66       *           
67       */
68      private String checksumPolicy;
69  
70      /**
71       * Field locations.
72       */
73      private java.util.Map<Object, InputLocation> locations;
74  
75  
76        //-----------/
77       //- Methods -/
78      //-----------/
79  
80      /**
81       * Method clone.
82       * 
83       * @return RepositoryPolicy
84       */
85      public RepositoryPolicy clone()
86      {
87          try
88          {
89              RepositoryPolicy copy = (RepositoryPolicy) super.clone();
90  
91              if ( copy.locations != null )
92              {
93                  copy.locations = new java.util.LinkedHashMap( copy.locations );
94              }
95  
96              return copy;
97          }
98          catch ( java.lang.Exception ex )
99          {
100             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
101                 + " does not support clone()" ).initCause( ex );
102         }
103     } //-- RepositoryPolicy clone()
104 
105     /**
106      * Get what to do when verification of an artifact checksum
107      * fails. Valid values are
108      *             <code>ignore</code>
109      *             ,
110      *             <code>fail</code>
111      *             or
112      *             <code>warn</code>
113      *             (the default).
114      * 
115      * @return String
116      */
117     public String getChecksumPolicy()
118     {
119         return this.checksumPolicy;
120     } //-- String getChecksumPolicy()
121 
122     /**
123      * Get whether to use this repository for downloading this type
124      * of artifact. Note: While the type
125      *             of this field is <code>String</code> for
126      * technical reasons, the semantic type is actually
127      *             <code>Boolean</code>. Default value is
128      * <code>true</code>.
129      * 
130      * @return String
131      */
132     public String getEnabled()
133     {
134         return this.enabled;
135     } //-- String getEnabled()
136 
137     /**
138      * 
139      * 
140      * @param key
141      * @return InputLocation
142      */
143     public InputLocation getLocation( Object key )
144     {
145         return ( locations != null ) ? locations.get( key ) : null;
146     } //-- InputLocation getLocation( Object )
147 
148     /**
149      * Get the frequency for downloading updates - can be
150      *             <code>always,</code>
151      *             <code>daily</code>
152      *             (default),
153      *             <code>interval:XXX</code>
154      *             (in minutes) or
155      *             <code>never</code>
156      *             (only if it doesn't exist locally).
157      * 
158      * @return String
159      */
160     public String getUpdatePolicy()
161     {
162         return this.updatePolicy;
163     } //-- String getUpdatePolicy()
164 
165     /**
166      * Set what to do when verification of an artifact checksum
167      * fails. Valid values are
168      *             <code>ignore</code>
169      *             ,
170      *             <code>fail</code>
171      *             or
172      *             <code>warn</code>
173      *             (the default).
174      * 
175      * @param checksumPolicy
176      */
177     public void setChecksumPolicy( String checksumPolicy )
178     {
179         this.checksumPolicy = checksumPolicy;
180     } //-- void setChecksumPolicy( String )
181 
182     /**
183      * Set whether to use this repository for downloading this type
184      * of artifact. Note: While the type
185      *             of this field is <code>String</code> for
186      * technical reasons, the semantic type is actually
187      *             <code>Boolean</code>. Default value is
188      * <code>true</code>.
189      * 
190      * @param enabled
191      */
192     public void setEnabled( String enabled )
193     {
194         this.enabled = enabled;
195     } //-- void setEnabled( String )
196 
197     /**
198      * 
199      * 
200      * @param key
201      * @param location
202      */
203     public void setLocation( Object key, InputLocation location )
204     {
205         if ( location != null )
206         {
207             if ( this.locations == null )
208             {
209                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
210             }
211             this.locations.put( key, location );
212         }
213     } //-- void setLocation( Object, InputLocation )
214 
215     /**
216      * Set the frequency for downloading updates - can be
217      *             <code>always,</code>
218      *             <code>daily</code>
219      *             (default),
220      *             <code>interval:XXX</code>
221      *             (in minutes) or
222      *             <code>never</code>
223      *             (only if it doesn't exist locally).
224      * 
225      * @param updatePolicy
226      */
227     public void setUpdatePolicy( String updatePolicy )
228     {
229         this.updatePolicy = updatePolicy;
230     } //-- void setUpdatePolicy( String )
231 
232     
233             
234 
235     public boolean isEnabled()
236     {
237         return ( enabled != null ) ? Boolean.parseBoolean( enabled ) : true;
238     }
239 
240     public void setEnabled( boolean enabled )
241     {
242         this.enabled = String.valueOf( enabled );
243     }
244 
245             
246           
247 }