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