1
2
3
4
5
6
7
8 package org.apache.maven.continuum.model.project.v1_0_9;
9
10
11
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
26
27
28
29 @SuppressWarnings( "all" )
30 public class ProjectGroup
31 implements java.io.Serializable
32 {
33
34
35
36
37
38
39
40
41 private int id = 0;
42
43
44
45
46 private String groupId;
47
48
49
50
51 private String name;
52
53
54
55
56 private String description;
57
58
59
60
61 private java.util.List<Project> projects;
62
63
64
65
66 private java.util.List<ProjectNotifier> notifiers;
67
68
69
70
71 private java.util.List<BuildDefinition> buildDefinitions;
72
73
74
75
76
77
78
79
80
81
82
83 public void addBuildDefinition( BuildDefinition buildDefinition )
84 {
85 getBuildDefinitions().add( buildDefinition );
86 }
87
88
89
90
91
92
93 public void addNotifier( ProjectNotifier projectNotifier )
94 {
95 getNotifiers().add( projectNotifier );
96 }
97
98
99
100
101
102
103 public void addProject( Project project )
104 {
105 getProjects().add( project );
106 project.createProjectGroupAssociation( this );
107 }
108
109
110
111
112
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 }
123
124
125
126
127
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 }
140
141
142
143
144
145
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 }
166
167
168
169
170
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 }
181
182
183
184
185
186
187 public String getDescription()
188 {
189 return this.description;
190 }
191
192
193
194
195
196
197 public String getGroupId()
198 {
199 return this.groupId;
200 }
201
202
203
204
205
206
207 public int getId()
208 {
209 return this.id;
210 }
211
212
213
214
215
216
217 public String getName()
218 {
219 return this.name;
220 }
221
222
223
224
225
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 }
236
237
238
239
240
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 }
251
252
253
254
255
256
257 public int hashCode()
258 {
259 int result = 17;
260
261 result = 37 * result + (int) id;
262
263 return result;
264 }
265
266
267
268
269
270
271 public void removeBuildDefinition( BuildDefinition buildDefinition )
272 {
273 getBuildDefinitions().remove( buildDefinition );
274 }
275
276
277
278
279
280
281 public void removeNotifier( ProjectNotifier projectNotifier )
282 {
283 getNotifiers().remove( projectNotifier );
284 }
285
286
287
288
289
290
291 public void removeProject( Project project )
292 {
293 project.breakProjectGroupAssociation( this );
294 getProjects().remove( project );
295 }
296
297
298
299
300
301
302 public void setBuildDefinitions( java.util.List<BuildDefinition> buildDefinitions )
303 {
304 this.buildDefinitions = buildDefinitions;
305 }
306
307
308
309
310
311
312 public void setDescription( String description )
313 {
314 this.description = description;
315 }
316
317
318
319
320
321
322 public void setGroupId( String groupId )
323 {
324 this.groupId = groupId;
325 }
326
327
328
329
330
331
332 public void setId( int id )
333 {
334 this.id = id;
335 }
336
337
338
339
340
341
342 public void setName( String name )
343 {
344 this.name = name;
345 }
346
347
348
349
350
351
352 public void setNotifiers( java.util.List<ProjectNotifier> notifiers )
353 {
354 this.notifiers = notifiers;
355 }
356
357
358
359
360
361
362 public void setProjects( java.util.List<Project> projects )
363 {
364 this.projects = projects;
365 }
366
367
368
369
370
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 }
382
383 }