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