View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.1 on 2011-09-18 14:33:27,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.continuum.model.project.v1_0_9;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import java.util.Collection;
15  import org.apache.maven.continuum.model.scm.v1_0_9.ChangeFile;
16  import org.apache.maven.continuum.model.scm.v1_0_9.ChangeSet;
17  import org.apache.maven.continuum.model.scm.v1_0_9.ScmResult;
18  import org.apache.maven.continuum.model.scm.v1_0_9.SuiteResult;
19  import org.apache.maven.continuum.model.scm.v1_0_9.TestCaseFailure;
20  import org.apache.maven.continuum.model.scm.v1_0_9.TestResult;
21  import org.apache.maven.continuum.model.system.v1_0_9.NotificationAddress;
22  import org.apache.maven.continuum.model.system.v1_0_9.SystemConfiguration;
23  
24  /**
25   * Class ProjectGroup.
26   * 
27   * @version $Revision$ $Date$
28   */
29  @SuppressWarnings( "all" )
30  public class ProjectGroup
31      implements java.io.Serializable
32  {
33  
34        //--------------------------/
35       //- Class/Member Variables -/
36      //--------------------------/
37  
38      /**
39       * Field id.
40       */
41      private int id = 0;
42  
43      /**
44       * Field groupId.
45       */
46      private String groupId;
47  
48      /**
49       * Field name.
50       */
51      private String name;
52  
53      /**
54       * Field description.
55       */
56      private String description;
57  
58      /**
59       * Field projects.
60       */
61      private java.util.List<Project> projects;
62  
63      /**
64       * Field notifiers.
65       */
66      private java.util.List<ProjectNotifier> notifiers;
67  
68      /**
69       * Field buildDefinitions.
70       */
71      private java.util.List<BuildDefinition> buildDefinitions;
72  
73  
74        //-----------/
75       //- Methods -/
76      //-----------/
77  
78      /**
79       * Method addBuildDefinition.
80       * 
81       * @param buildDefinition
82       */
83      public void addBuildDefinition( BuildDefinition buildDefinition )
84      {
85          getBuildDefinitions().add( buildDefinition );
86      } //-- void addBuildDefinition( BuildDefinition )
87  
88      /**
89       * Method addNotifier.
90       * 
91       * @param projectNotifier
92       */
93      public void addNotifier( ProjectNotifier projectNotifier )
94      {
95          getNotifiers().add( projectNotifier );
96      } //-- void addNotifier( ProjectNotifier )
97  
98      /**
99       * Method addProject.
100      * 
101      * @param project
102      */
103     public void addProject( Project project )
104     {
105         getProjects().add( project );
106         project.createProjectGroupAssociation( this );
107     } //-- void addProject( Project )
108 
109     /**
110      * Method breakProjectAssociation.
111      * 
112      * @param project
113      */
114     public void breakProjectAssociation( Project project )
115     {
116         if ( ! getProjects().contains( project ) )
117         {
118             throw new IllegalStateException( "project isn't associated." );
119         }
120 
121         getProjects().remove( project );
122     } //-- void breakProjectAssociation( Project )
123 
124     /**
125      * Method createProjectAssociation.
126      * 
127      * @param project
128      */
129     public void createProjectAssociation( Project project )
130     {
131         Collection projects = getProjects();
132 
133         if ( projects.contains( project ) )
134         {
135             throw new IllegalStateException( "project is already assigned." );
136         }
137 
138         projects.add( project );
139     } //-- void createProjectAssociation( Project )
140 
141     /**
142      * Method equals.
143      * 
144      * @param other
145      * @return boolean
146      */
147     public boolean equals( Object other )
148     {
149         if ( this == other )
150         {
151             return true;
152         }
153 
154         if ( !( other instanceof ProjectGroup ) )
155         {
156             return false;
157         }
158 
159         ProjectGroup that = (ProjectGroup) other;
160         boolean result = true;
161 
162         result = result && id == that.id;
163 
164         return result;
165     } //-- boolean equals( Object )
166 
167     /**
168      * Method getBuildDefinitions.
169      * 
170      * @return List
171      */
172     public java.util.List<BuildDefinition> getBuildDefinitions()
173     {
174         if ( this.buildDefinitions == null )
175         {
176             this.buildDefinitions = new java.util.ArrayList<BuildDefinition>();
177         }
178 
179         return this.buildDefinitions;
180     } //-- java.util.List<BuildDefinition> getBuildDefinitions()
181 
182     /**
183      * Get the description field.
184      * 
185      * @return String
186      */
187     public String getDescription()
188     {
189         return this.description;
190     } //-- String getDescription()
191 
192     /**
193      * Get the groupId field.
194      * 
195      * @return String
196      */
197     public String getGroupId()
198     {
199         return this.groupId;
200     } //-- String getGroupId()
201 
202     /**
203      * Get the id field.
204      * 
205      * @return int
206      */
207     public int getId()
208     {
209         return this.id;
210     } //-- int getId()
211 
212     /**
213      * Get the name field.
214      * 
215      * @return String
216      */
217     public String getName()
218     {
219         return this.name;
220     } //-- String getName()
221 
222     /**
223      * Method getNotifiers.
224      * 
225      * @return List
226      */
227     public java.util.List<ProjectNotifier> getNotifiers()
228     {
229         if ( this.notifiers == null )
230         {
231             this.notifiers = new java.util.ArrayList<ProjectNotifier>();
232         }
233 
234         return this.notifiers;
235     } //-- java.util.List<ProjectNotifier> getNotifiers()
236 
237     /**
238      * Method getProjects.
239      * 
240      * @return List
241      */
242     public java.util.List<Project> getProjects()
243     {
244         if ( this.projects == null )
245         {
246             this.projects = new java.util.ArrayList<Project>();
247         }
248 
249         return this.projects;
250     } //-- java.util.List<Project> getProjects()
251 
252     /**
253      * Method hashCode.
254      * 
255      * @return int
256      */
257     public int hashCode()
258     {
259         int result = 17;
260 
261         result = 37 * result + (int) id;
262 
263         return result;
264     } //-- int hashCode()
265 
266     /**
267      * Method removeBuildDefinition.
268      * 
269      * @param buildDefinition
270      */
271     public void removeBuildDefinition( BuildDefinition buildDefinition )
272     {
273         getBuildDefinitions().remove( buildDefinition );
274     } //-- void removeBuildDefinition( BuildDefinition )
275 
276     /**
277      * Method removeNotifier.
278      * 
279      * @param projectNotifier
280      */
281     public void removeNotifier( ProjectNotifier projectNotifier )
282     {
283         getNotifiers().remove( projectNotifier );
284     } //-- void removeNotifier( ProjectNotifier )
285 
286     /**
287      * Method removeProject.
288      * 
289      * @param project
290      */
291     public void removeProject( Project project )
292     {
293         project.breakProjectGroupAssociation( this );
294         getProjects().remove( project );
295     } //-- void removeProject( Project )
296 
297     /**
298      * Set the buildDefinitions field.
299      * 
300      * @param buildDefinitions
301      */
302     public void setBuildDefinitions( java.util.List<BuildDefinition> buildDefinitions )
303     {
304         this.buildDefinitions = buildDefinitions;
305     } //-- void setBuildDefinitions( java.util.List )
306 
307     /**
308      * Set the description field.
309      * 
310      * @param description
311      */
312     public void setDescription( String description )
313     {
314         this.description = description;
315     } //-- void setDescription( String )
316 
317     /**
318      * Set the groupId field.
319      * 
320      * @param groupId
321      */
322     public void setGroupId( String groupId )
323     {
324         this.groupId = groupId;
325     } //-- void setGroupId( String )
326 
327     /**
328      * Set the id field.
329      * 
330      * @param id
331      */
332     public void setId( int id )
333     {
334         this.id = id;
335     } //-- void setId( int )
336 
337     /**
338      * Set the name field.
339      * 
340      * @param name
341      */
342     public void setName( String name )
343     {
344         this.name = name;
345     } //-- void setName( String )
346 
347     /**
348      * Set the notifiers field.
349      * 
350      * @param notifiers
351      */
352     public void setNotifiers( java.util.List<ProjectNotifier> notifiers )
353     {
354         this.notifiers = notifiers;
355     } //-- void setNotifiers( java.util.List )
356 
357     /**
358      * Set the projects field.
359      * 
360      * @param projects
361      */
362     public void setProjects( java.util.List<Project> projects )
363     {
364         this.projects = projects;
365     } //-- void setProjects( java.util.List )
366 
367     /**
368      * Method toString.
369      * 
370      * @return String
371      */
372     public java.lang.String toString()
373     {
374         StringBuilder buf = new StringBuilder( 128 );
375 
376         buf.append( "id = '" );
377         buf.append( getId() );
378         buf.append( "'" );
379 
380         return buf.toString();
381     } //-- java.lang.String toString()
382 
383 }