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.model;
25  
26  /**
27   * 
28   *         
29   *         The <code>&lt;CiManagement&gt;</code> element contains
30   * informations required to the
31   *         continuous integration system of the project.
32   *         
33   *       
34   * 
35   * @version $Revision$ $Date$
36   */
37  @SuppressWarnings( "all" )
38  public class CiManagement
39      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
40  {
41  
42        //--------------------------/
43       //- Class/Member Variables -/
44      //--------------------------/
45  
46      /**
47       * 
48       *             
49       *             The name of the continuous integration system,
50       * e.g. <code>continuum</code>.
51       *             
52       *           
53       */
54      private String system;
55  
56      /**
57       * URL for the continuous integration system used by the
58       * project if it has a web
59       *             interface.
60       */
61      private String url;
62  
63      /**
64       * Field notifiers.
65       */
66      private java.util.List<Notifier> notifiers;
67  
68      /**
69       * Field locations.
70       */
71      private java.util.Map<Object, InputLocation> locations;
72  
73      /**
74       * Field location.
75       */
76      private InputLocation location;
77  
78      /**
79       * Field systemLocation.
80       */
81      private InputLocation systemLocation;
82  
83      /**
84       * Field urlLocation.
85       */
86      private InputLocation urlLocation;
87  
88      /**
89       * Field notifiersLocation.
90       */
91      private InputLocation notifiersLocation;
92  
93  
94        //-----------/
95       //- Methods -/
96      //-----------/
97  
98      /**
99       * Method addNotifier.
100      * 
101      * @param notifier a notifier object.
102      */
103     public void addNotifier( Notifier notifier )
104     {
105         getNotifiers().add( notifier );
106     } //-- void addNotifier( Notifier )
107 
108     /**
109      * Method clone.
110      * 
111      * @return CiManagement
112      */
113     public CiManagement clone()
114     {
115         try
116         {
117             CiManagement copy = (CiManagement) super.clone();
118 
119             if ( this.notifiers != null )
120             {
121                 copy.notifiers = new java.util.ArrayList<Notifier>();
122                 for ( Notifier item : this.notifiers )
123                 {
124                     copy.notifiers.add( ( (Notifier) item).clone() );
125                 }
126             }
127 
128             if ( copy.locations != null )
129             {
130                 copy.locations = new java.util.LinkedHashMap( copy.locations );
131             }
132 
133             return copy;
134         }
135         catch ( java.lang.Exception ex )
136         {
137             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
138                 + " does not support clone()" ).initCause( ex );
139         }
140     } //-- CiManagement clone()
141 
142     /**
143      * 
144      * 
145      * @param key a key object.
146      * @return InputLocation
147      */
148     public InputLocation getLocation( Object key )
149     {
150         if ( key instanceof String )
151         {
152             switch ( ( String ) key )
153             {
154                 case "" :
155                 {
156                     return this.location;
157                 }
158                 case "system" :
159                 {
160                     return systemLocation;
161                 }
162                 case "url" :
163                 {
164                     return urlLocation;
165                 }
166                 case "notifiers" :
167                 {
168                     return notifiersLocation;
169                 }
170                 default :
171                 {
172                     return getOtherLocation( key );
173                 }
174                 }
175             }
176             else
177             {
178                 return getOtherLocation( key );
179             }
180     } //-- InputLocation getLocation( Object )
181 
182     /**
183      * Method getNotifiers.
184      * 
185      * @return List
186      */
187     public java.util.List<Notifier> getNotifiers()
188     {
189         if ( this.notifiers == null )
190         {
191             this.notifiers = new java.util.ArrayList<Notifier>();
192         }
193 
194         return this.notifiers;
195     } //-- java.util.List<Notifier> getNotifiers()
196 
197     /**
198      * 
199      * 
200      * @param key a key object.
201      * @param location a location object.
202      */
203     public void setLocation( Object key, InputLocation location )
204     {
205         if ( key instanceof String )
206         {
207             switch ( ( String ) key )
208             {
209                 case "" :
210                 {
211                     this.location = location;
212                     return;
213                 }
214                 case "system" :
215                 {
216                     systemLocation = location;
217                     return;
218                 }
219                 case "url" :
220                 {
221                     urlLocation = location;
222                     return;
223                 }
224                 case "notifiers" :
225                 {
226                     notifiersLocation = location;
227                     return;
228                 }
229                 default :
230                 {
231                     setOtherLocation( key, location );
232                     return;
233                 }
234             }
235         }
236         else
237         {
238             setOtherLocation( key, location );
239         }
240     } //-- void setLocation( Object, InputLocation )
241 
242     /**
243      * 
244      * 
245      * @param key a key object.
246      * @param location a location object.
247      */
248     public void setOtherLocation( Object key, InputLocation location )
249     {
250         if ( location != null )
251         {
252             if ( this.locations == null )
253             {
254                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
255             }
256             this.locations.put( key, location );
257         }
258     } //-- void setOtherLocation( Object, InputLocation )
259 
260     /**
261      * 
262      * 
263      * @param key a key object.
264      * @return InputLocation
265      */
266     private InputLocation getOtherLocation( Object key )
267     {
268         return ( locations != null ) ? locations.get( key ) : null;
269     } //-- InputLocation getOtherLocation( Object )
270 
271     /**
272      * Get the name of the continuous integration system, e.g.
273      * <code>continuum</code>.
274      * 
275      * @return String
276      */
277     public String getSystem()
278     {
279         return this.system;
280     } //-- String getSystem()
281 
282     /**
283      * Get uRL for the continuous integration system used by the
284      * project if it has a web
285      *             interface.
286      * 
287      * @return String
288      */
289     public String getUrl()
290     {
291         return this.url;
292     } //-- String getUrl()
293 
294     /**
295      * Method removeNotifier.
296      * 
297      * @param notifier a notifier object.
298      */
299     public void removeNotifier( Notifier notifier )
300     {
301         getNotifiers().remove( notifier );
302     } //-- void removeNotifier( Notifier )
303 
304     /**
305      * Set configuration for notifying developers/users when a
306      * build is unsuccessful,
307      *             including user information and notification
308      * mode.
309      * 
310      * @param notifiers a notifiers object.
311      */
312     public void setNotifiers( java.util.List<Notifier> notifiers )
313     {
314         this.notifiers = notifiers;
315     } //-- void setNotifiers( java.util.List )
316 
317     /**
318      * Set the name of the continuous integration system, e.g.
319      * <code>continuum</code>.
320      * 
321      * @param system a system object.
322      */
323     public void setSystem( String system )
324     {
325         this.system = system;
326     } //-- void setSystem( String )
327 
328     /**
329      * Set uRL for the continuous integration system used by the
330      * project if it has a web
331      *             interface.
332      * 
333      * @param url a url object.
334      */
335     public void setUrl( String url )
336     {
337         this.url = url;
338     } //-- void setUrl( String )
339 
340 }