1
2
3
4
5
6
7
8 package org.apache.maven.continuum.model.project;
9
10
11
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
32
33
34
35 @SuppressWarnings( "all" )
36 public class ProjectGroup
37 implements java.io.Serializable
38 {
39
40
41
42
43
44
45
46
47 private int id = 0;
48
49
50
51
52 private String groupId;
53
54
55
56
57 private String name;
58
59
60
61
62 private String description;
63
64
65
66
67 private java.util.List<Project> projects;
68
69
70
71
72 private java.util.List<ProjectNotifier> notifiers;
73
74
75
76
77 private java.util.List<BuildDefinition> buildDefinitions;
78
79
80
81
82 private LocalRepository localRepository;
83
84
85
86
87
88
89
90
91
92
93
94 public void addBuildDefinition( BuildDefinition buildDefinition )
95 {
96 getBuildDefinitions().add( buildDefinition );
97 }
98
99
100
101
102
103
104 public void addNotifier( ProjectNotifier projectNotifier )
105 {
106 getNotifiers().add( projectNotifier );
107 }
108
109
110
111
112
113
114 public void addProject( Project project )
115 {
116 getProjects().add( project );
117 project.createProjectGroupAssociation( this );
118 }
119
120
121
122
123
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 }
134
135
136
137
138
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 }
151
152
153
154
155
156
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 }
177
178
179
180
181
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 }
192
193
194
195
196
197
198 public String getDescription()
199 {
200 return this.description;
201 }
202
203
204
205
206
207
208 public String getGroupId()
209 {
210 return this.groupId;
211 }
212
213
214
215
216
217
218 public int getId()
219 {
220 return this.id;
221 }
222
223
224
225
226
227
228 public LocalRepository getLocalRepository()
229 {
230 return this.localRepository;
231 }
232
233
234
235
236
237
238 public String getName()
239 {
240 return this.name;
241 }
242
243
244
245
246
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 }
257
258
259
260
261
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 }
272
273
274
275
276
277
278 public int hashCode()
279 {
280 int result = 17;
281
282 result = 37 * result + (int) id;
283
284 return result;
285 }
286
287
288
289
290
291
292 public void removeBuildDefinition( BuildDefinition buildDefinition )
293 {
294 getBuildDefinitions().remove( buildDefinition );
295 }
296
297
298
299
300
301
302 public void removeNotifier( ProjectNotifier projectNotifier )
303 {
304 getNotifiers().remove( projectNotifier );
305 }
306
307
308
309
310
311
312 public void removeProject( Project project )
313 {
314 project.breakProjectGroupAssociation( this );
315 getProjects().remove( project );
316 }
317
318
319
320
321
322
323 public void setBuildDefinitions( java.util.List<BuildDefinition> buildDefinitions )
324 {
325 this.buildDefinitions = buildDefinitions;
326 }
327
328
329
330
331
332
333 public void setDescription( String description )
334 {
335 this.description = description;
336 }
337
338
339
340
341
342
343 public void setGroupId( String groupId )
344 {
345 this.groupId = groupId;
346 }
347
348
349
350
351
352
353 public void setId( int id )
354 {
355 this.id = id;
356 }
357
358
359
360
361
362
363 public void setLocalRepository( LocalRepository localRepository )
364 {
365 this.localRepository = localRepository;
366 }
367
368
369
370
371
372
373 public void setName( String name )
374 {
375 this.name = name;
376 }
377
378
379
380
381
382
383 public void setNotifiers( java.util.List<ProjectNotifier> notifiers )
384 {
385 this.notifiers = notifiers;
386 }
387
388
389
390
391
392
393 public void setProjects( java.util.List<Project> projects )
394 {
395 this.projects = projects;
396 }
397
398
399
400
401
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 }
413
414 }