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