001    /*
002     =================== DO NOT EDIT THIS FILE ====================
003     Generated by Modello 1.4.1 on 2012-01-20 18:09:18,
004     any modifications will be overwritten.
005     ==============================================================
006     */
007    
008    package org.apache.maven.model;
009    
010    /**
011     * Download policy.
012     * 
013     * @version $Revision$ $Date$
014     */
015    @SuppressWarnings( "all" )
016    public class RepositoryPolicy
017        implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
018    {
019    
020          //--------------------------/
021         //- Class/Member Variables -/
022        //--------------------------/
023    
024        /**
025         * 
026         *             
027         *             Whether to use this repository for downloading
028         * this type of artifact. Note: While the type
029         *             of this field is <code>String</code> for
030         * technical reasons, the semantic type is actually
031         *             <code>Boolean</code>. Default value is
032         * <code>true</code>.
033         *             
034         *           
035         */
036        private String enabled;
037    
038        /**
039         * 
040         *             
041         *             The frequency for downloading updates - can be
042         *             <code>always,</code>
043         *             <code>daily</code>
044         *             (default),
045         *             <code>interval:XXX</code>
046         *             (in minutes) or
047         *             <code>never</code>
048         *             (only if it doesn't exist locally).
049         *             
050         *           
051         */
052        private String updatePolicy;
053    
054        /**
055         * 
056         *             
057         *             What to do when verification of an artifact
058         * checksum fails. Valid values are
059         *             <code>ignore</code>
060         *             ,
061         *             <code>fail</code>
062         *             or
063         *             <code>warn</code>
064         *             (the default).
065         *             
066         *           
067         */
068        private String checksumPolicy;
069    
070        /**
071         * Field locations.
072         */
073        private java.util.Map<Object, InputLocation> locations;
074    
075    
076          //-----------/
077         //- Methods -/
078        //-----------/
079    
080        /**
081         * Method clone.
082         * 
083         * @return RepositoryPolicy
084         */
085        public RepositoryPolicy clone()
086        {
087            try
088            {
089                RepositoryPolicy copy = (RepositoryPolicy) super.clone();
090    
091                if ( copy.locations != null )
092                {
093                    copy.locations = new java.util.LinkedHashMap( copy.locations );
094                }
095    
096                return copy;
097            }
098            catch ( java.lang.Exception ex )
099            {
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    }