View Javadoc

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