View Javadoc

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