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