View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 2.1.2,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.settings;
7   
8   /**
9    * 
10   *         A download mirror for a given repository.
11   *       
12   * 
13   * @version $Revision$ $Date$
14   */
15  @SuppressWarnings( "all" )
16  public class Mirror
17      extends IdentifiableBase
18      implements java.io.Serializable, java.lang.Cloneable
19  {
20  
21        //--------------------------/
22       //- Class/Member Variables -/
23      //--------------------------/
24  
25      /**
26       * 
27       *             
28       *             A repository id or (since Maven 2.0.9) an
29       * expression matching one or many repository ids to mirror,
30       * e.g.,
31       *             <code>central</code> or <code>*,!repo1</code>.
32       *             <code>*</code> (since Maven 2.0.5),
33       * <code>external:*</code> (since Maven 2.0.9) and
34       * <code>external:http:*</code> (since Maven 3.8.0) have
35       *             a special meaning: see <a
36       * href="/guides/mini/guide-mirror-settings.html">Mirror
37       * Settings</a> guide.
38       *             
39       *           
40       */
41      private String mirrorOf;
42  
43      /**
44       * 
45       *             The optional name that describes the mirror.
46       *           
47       */
48      private String name;
49  
50      /**
51       * The URL of the mirror repository.
52       */
53      private String url;
54  
55      /**
56       * 
57       *             
58       *             The layout of the mirror repository.
59       *             <br><b>Since</b>: Maven 3
60       *             
61       *           .
62       */
63      private String layout = "default";
64  
65      /**
66       * 
67       *             
68       *             The layouts of repositories being mirrored. This
69       * value can be used to restrict the usage
70       *             of the mirror to repositories with a matching
71       * layout (apart from a matching id).
72       *             <br><b>Since</b>: Maven 3
73       *             
74       *           .
75       */
76      private String mirrorOfLayouts = "default,legacy";
77  
78      /**
79       * 
80       *             
81       *             Whether this mirror should be blocked from any
82       * download request but fail the download process, explaining
83       * why.
84       *             <br><b>Default value is</b>: <code>false</code>
85       *             <br><b>Since</b>: Maven 3.8.0
86       *             
87       *           .
88       */
89      private boolean blocked = false;
90  
91  
92        //-----------/
93       //- Methods -/
94      //-----------/
95  
96      /**
97       * Method clone.
98       * 
99       * @return Mirror
100      */
101     public Mirror clone()
102     {
103         try
104         {
105             Mirror copy = (Mirror) super.clone();
106 
107             return copy;
108         }
109         catch ( java.lang.Exception ex )
110         {
111             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
112                 + " does not support clone()" ).initCause( ex );
113         }
114     } //-- Mirror clone()
115 
116     /**
117      * Get the layout of the mirror repository.
118      *             <br><b>Since</b>: Maven 3.
119      * 
120      * @return String
121      */
122     public String getLayout()
123     {
124         return this.layout;
125     } //-- String getLayout()
126 
127     /**
128      * Get a repository id or (since Maven 2.0.9) an expression
129      * matching one or many repository ids to mirror, e.g.,
130      *             <code>central</code> or <code>*,!repo1</code>.
131      *             <code>*</code> (since Maven 2.0.5),
132      * <code>external:*</code> (since Maven 2.0.9) and
133      * <code>external:http:*</code> (since Maven 3.8.0) have
134      *             a special meaning: see <a
135      * href="/guides/mini/guide-mirror-settings.html">Mirror
136      * Settings</a> guide.
137      * 
138      * @return String
139      */
140     public String getMirrorOf()
141     {
142         return this.mirrorOf;
143     } //-- String getMirrorOf()
144 
145     /**
146      * Get the layouts of repositories being mirrored. This value
147      * can be used to restrict the usage
148      *             of the mirror to repositories with a matching
149      * layout (apart from a matching id).
150      *             <br><b>Since</b>: Maven 3.
151      * 
152      * @return String
153      */
154     public String getMirrorOfLayouts()
155     {
156         return this.mirrorOfLayouts;
157     } //-- String getMirrorOfLayouts()
158 
159     /**
160      * Get the optional name that describes the mirror.
161      * 
162      * @return String
163      */
164     public String getName()
165     {
166         return this.name;
167     } //-- String getName()
168 
169     /**
170      * Get the URL of the mirror repository.
171      * 
172      * @return String
173      */
174     public String getUrl()
175     {
176         return this.url;
177     } //-- String getUrl()
178 
179     /**
180      * Get whether this mirror should be blocked from any download
181      * request but fail the download process, explaining why.
182      *             <br><b>Default value is</b>: <code>false</code>
183      *             <br><b>Since</b>: Maven 3.8.0.
184      * 
185      * @return boolean
186      */
187     public boolean isBlocked()
188     {
189         return this.blocked;
190     } //-- boolean isBlocked()
191 
192     /**
193      * Set whether this mirror should be blocked from any download
194      * request but fail the download process, explaining why.
195      *             <br><b>Default value is</b>: <code>false</code>
196      *             <br><b>Since</b>: Maven 3.8.0.
197      * 
198      * @param blocked a blocked object.
199      */
200     public void setBlocked( boolean blocked )
201     {
202         this.blocked = blocked;
203     } //-- void setBlocked( boolean )
204 
205     /**
206      * Set the layout of the mirror repository.
207      *             <br><b>Since</b>: Maven 3.
208      * 
209      * @param layout a layout object.
210      */
211     public void setLayout( String layout )
212     {
213         this.layout = layout;
214     } //-- void setLayout( String )
215 
216     /**
217      * Set a repository id or (since Maven 2.0.9) an expression
218      * matching one or many repository ids to mirror, e.g.,
219      *             <code>central</code> or <code>*,!repo1</code>.
220      *             <code>*</code> (since Maven 2.0.5),
221      * <code>external:*</code> (since Maven 2.0.9) and
222      * <code>external:http:*</code> (since Maven 3.8.0) have
223      *             a special meaning: see <a
224      * href="/guides/mini/guide-mirror-settings.html">Mirror
225      * Settings</a> guide.
226      * 
227      * @param mirrorOf a mirrorOf object.
228      */
229     public void setMirrorOf( String mirrorOf )
230     {
231         this.mirrorOf = mirrorOf;
232     } //-- void setMirrorOf( String )
233 
234     /**
235      * Set the layouts of repositories being mirrored. This value
236      * can be used to restrict the usage
237      *             of the mirror to repositories with a matching
238      * layout (apart from a matching id).
239      *             <br><b>Since</b>: Maven 3.
240      * 
241      * @param mirrorOfLayouts a mirrorOfLayouts object.
242      */
243     public void setMirrorOfLayouts( String mirrorOfLayouts )
244     {
245         this.mirrorOfLayouts = mirrorOfLayouts;
246     } //-- void setMirrorOfLayouts( String )
247 
248     /**
249      * Set the optional name that describes the mirror.
250      * 
251      * @param name a name object.
252      */
253     public void setName( String name )
254     {
255         this.name = name;
256     } //-- void setName( String )
257 
258     /**
259      * Set the URL of the mirror repository.
260      * 
261      * @param url a url object.
262      */
263     public void setUrl( String url )
264     {
265         this.url = url;
266     } //-- void setUrl( String )
267 
268     
269             
270 
271     public String toString()
272     {
273         StringBuilder sb = new StringBuilder( 128 );
274         sb.append( "Mirror[" );
275         sb.append( "id=" ).append( this.getId() );
276         sb.append( ",mirrorOf=" ).append( mirrorOf );
277         sb.append( ",url=" ).append( this.url );
278         sb.append( ",name=" ).append( this.name );
279         if ( isBlocked() )
280         {
281             sb.append( ",blocked" );
282         }
283         sb.append( "]" );
284         return sb.toString();
285     }
286             
287           
288 }