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