View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2013-02-24 03:31:03,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.settings;
9   
10  /**
11   * 
12   *         
13   *         Modifications to the build process which is keyed on
14   * some
15   *         sort of environmental parameter.
16   *         
17   *       
18   * 
19   * @version $Revision$ $Date$
20   */
21  @SuppressWarnings( "all" )
22  public class Profile
23      extends IdentifiableBase
24      implements java.io.Serializable, java.lang.Cloneable
25  {
26  
27        //--------------------------/
28       //- Class/Member Variables -/
29      //--------------------------/
30  
31      /**
32       * 
33       *             
34       *             The conditional logic which will automatically
35       *             trigger the inclusion of this profile.
36       *             
37       *           
38       */
39      private Activation activation;
40  
41      /**
42       * Field properties.
43       */
44      private java.util.Properties properties;
45  
46      /**
47       * Field repositories.
48       */
49      private java.util.List<Repository> repositories;
50  
51      /**
52       * 
53       *             
54       *             This may be removed or relocated in the near
55       *             future. It is undecided whether plugins really
56       * need a remote
57       *             repository set of their own.
58       *             
59       *           
60       */
61      private java.util.List<Repository> pluginRepositories;
62  
63  
64        //-----------/
65       //- Methods -/
66      //-----------/
67  
68      /**
69       * Method addPluginRepository.
70       * 
71       * @param repository
72       */
73      public void addPluginRepository( Repository repository )
74      {
75          getPluginRepositories().add( repository );
76      } //-- void addPluginRepository( Repository )
77  
78      /**
79       * Method addProperty.
80       * 
81       * @param key
82       * @param value
83       */
84      public void addProperty( String key, String value )
85      {
86          getProperties().put( key, value );
87      } //-- void addProperty( String, String )
88  
89      /**
90       * Method addRepository.
91       * 
92       * @param repository
93       */
94      public void addRepository( Repository repository )
95      {
96          getRepositories().add( repository );
97      } //-- void addRepository( Repository )
98  
99      /**
100      * Method clone.
101      * 
102      * @return Profile
103      */
104     public Profile clone()
105     {
106         try
107         {
108             Profile copy = (Profile) super.clone();
109 
110             if ( this.activation != null )
111             {
112                 copy.activation = (Activation) this.activation.clone();
113             }
114 
115             if ( this.properties != null )
116             {
117                 copy.properties = (java.util.Properties) this.properties.clone();
118             }
119 
120             if ( this.repositories != null )
121             {
122                 copy.repositories = new java.util.ArrayList<Repository>();
123                 for ( Repository item : this.repositories )
124                 {
125                     copy.repositories.add( ( (Repository) item).clone() );
126                 }
127             }
128 
129             if ( this.pluginRepositories != null )
130             {
131                 copy.pluginRepositories = new java.util.ArrayList<Repository>();
132                 for ( Repository item : this.pluginRepositories )
133                 {
134                     copy.pluginRepositories.add( ( (Repository) item).clone() );
135                 }
136             }
137 
138             return copy;
139         }
140         catch ( java.lang.Exception ex )
141         {
142             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
143                 + " does not support clone()" ).initCause( ex );
144         }
145     } //-- Profile clone()
146 
147     /**
148      * Get the conditional logic which will automatically
149      *             trigger the inclusion of this profile.
150      * 
151      * @return Activation
152      */
153     public Activation getActivation()
154     {
155         return this.activation;
156     } //-- Activation getActivation()
157 
158     /**
159      * Method getPluginRepositories.
160      * 
161      * @return List
162      */
163     public java.util.List<Repository> getPluginRepositories()
164     {
165         if ( this.pluginRepositories == null )
166         {
167             this.pluginRepositories = new java.util.ArrayList<Repository>();
168         }
169 
170         return this.pluginRepositories;
171     } //-- java.util.List<Repository> getPluginRepositories()
172 
173     /**
174      * Method getProperties.
175      * 
176      * @return Properties
177      */
178     public java.util.Properties getProperties()
179     {
180         if ( this.properties == null )
181         {
182             this.properties = new java.util.Properties();
183         }
184 
185         return this.properties;
186     } //-- java.util.Properties getProperties()
187 
188     /**
189      * Method getRepositories.
190      * 
191      * @return List
192      */
193     public java.util.List<Repository> getRepositories()
194     {
195         if ( this.repositories == null )
196         {
197             this.repositories = new java.util.ArrayList<Repository>();
198         }
199 
200         return this.repositories;
201     } //-- java.util.List<Repository> getRepositories()
202 
203     /**
204      * Method removePluginRepository.
205      * 
206      * @param repository
207      */
208     public void removePluginRepository( Repository repository )
209     {
210         getPluginRepositories().remove( repository );
211     } //-- void removePluginRepository( Repository )
212 
213     /**
214      * Method removeRepository.
215      * 
216      * @param repository
217      */
218     public void removeRepository( Repository repository )
219     {
220         getRepositories().remove( repository );
221     } //-- void removeRepository( Repository )
222 
223     /**
224      * Set the conditional logic which will automatically
225      *             trigger the inclusion of this profile.
226      * 
227      * @param activation
228      */
229     public void setActivation( Activation activation )
230     {
231         this.activation = activation;
232     } //-- void setActivation( Activation )
233 
234     /**
235      * Set the lists of the remote repositories for discovering
236      * plugins.
237      * 
238      * @param pluginRepositories
239      */
240     public void setPluginRepositories( java.util.List<Repository> pluginRepositories )
241     {
242         this.pluginRepositories = pluginRepositories;
243     } //-- void setPluginRepositories( java.util.List )
244 
245     /**
246      * Set extended configuration specific to this profile goes
247      * here.
248      *             Contents take the form of
249      *             <property.name>property.value</property.name>
250      * 
251      * @param properties
252      */
253     public void setProperties( java.util.Properties properties )
254     {
255         this.properties = properties;
256     } //-- void setProperties( java.util.Properties )
257 
258     /**
259      * Set the lists of the remote repositories.
260      * 
261      * @param repositories
262      */
263     public void setRepositories( java.util.List<Repository> repositories )
264     {
265         this.repositories = repositories;
266     } //-- void setRepositories( java.util.List )
267 
268 }