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 org.apache.maven.continuum.model.scm.v1_0_9.ChangeFile;
15 import org.apache.maven.continuum.model.scm.v1_0_9.ChangeSet;
16 import org.apache.maven.continuum.model.scm.v1_0_9.ScmResult;
17 import org.apache.maven.continuum.model.scm.v1_0_9.SuiteResult;
18 import org.apache.maven.continuum.model.scm.v1_0_9.TestCaseFailure;
19 import org.apache.maven.continuum.model.scm.v1_0_9.TestResult;
20 import org.apache.maven.continuum.model.system.v1_0_9.NotificationAddress;
21 import org.apache.maven.continuum.model.system.v1_0_9.SystemConfiguration;
22
23
24
25
26
27
28
29
30 @SuppressWarnings( "all" )
31 public class BuildResult
32 implements java.io.Serializable
33 {
34
35
36
37
38
39
40
41
42 private Project project;
43
44
45
46
47 private int id = 0;
48
49
50
51
52 private int buildNumber = 0;
53
54
55
56
57 private int state = 0;
58
59
60
61
62 private int trigger = 0;
63
64
65
66
67 private String username;
68
69
70
71
72 private long startTime = 0L;
73
74
75
76
77 private long endTime = 0L;
78
79
80
81
82 private String error;
83
84
85
86
87 private boolean success = false;
88
89
90
91
92 private int exitCode = 0;
93
94
95
96
97 private ScmResult scmResult;
98
99
100
101
102 private TestResult testResult;
103
104
105
106
107
108
109
110
111
112
113
114 public void breakProjectAssociation( Project project )
115 {
116 if ( this.project != project )
117 {
118 throw new IllegalStateException( "project isn't associated." );
119 }
120
121 this.project = null;
122 }
123
124
125
126
127
128
129 public void createProjectAssociation( Project project )
130 {
131 if ( this.project != null )
132 {
133 breakProjectAssociation( this.project );
134 }
135
136 this.project = project;
137 }
138
139
140
141
142
143
144
145 public boolean equals( Object other )
146 {
147 if ( this == other )
148 {
149 return true;
150 }
151
152 if ( !( other instanceof BuildResult ) )
153 {
154 return false;
155 }
156
157 BuildResult that = (BuildResult) other;
158 boolean result = true;
159
160 result = result && id == that.id;
161
162 return result;
163 }
164
165
166
167
168
169
170 public int getBuildNumber()
171 {
172 return this.buildNumber;
173 }
174
175
176
177
178
179
180 public long getEndTime()
181 {
182 return this.endTime;
183 }
184
185
186
187
188
189
190 public String getError()
191 {
192 return this.error;
193 }
194
195
196
197
198
199
200 public int getExitCode()
201 {
202 return this.exitCode;
203 }
204
205
206
207
208
209
210 public int getId()
211 {
212 return this.id;
213 }
214
215
216
217
218
219
220 public Project getProject()
221 {
222 return this.project;
223 }
224
225
226
227
228
229
230 public ScmResult getScmResult()
231 {
232 return this.scmResult;
233 }
234
235
236
237
238
239
240 public long getStartTime()
241 {
242 return this.startTime;
243 }
244
245
246
247
248
249
250 public int getState()
251 {
252 return this.state;
253 }
254
255
256
257
258
259
260 public TestResult getTestResult()
261 {
262 return this.testResult;
263 }
264
265
266
267
268
269
270 public int getTrigger()
271 {
272 return this.trigger;
273 }
274
275
276
277
278
279
280 public String getUsername()
281 {
282 return this.username;
283 }
284
285
286
287
288
289
290 public int hashCode()
291 {
292 int result = 17;
293
294 result = 37 * result + (int) id;
295
296 return result;
297 }
298
299
300
301
302
303
304 public boolean isSuccess()
305 {
306 return this.success;
307 }
308
309
310
311
312
313
314 public void setBuildNumber( int buildNumber )
315 {
316 this.buildNumber = buildNumber;
317 }
318
319
320
321
322
323
324 public void setEndTime( long endTime )
325 {
326 this.endTime = endTime;
327 }
328
329
330
331
332
333
334 public void setError( String error )
335 {
336 this.error = error;
337 }
338
339
340
341
342
343
344 public void setExitCode( int exitCode )
345 {
346 this.exitCode = exitCode;
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 setProject( Project project )
365 {
366 if ( this.project != null )
367 {
368 this.project.breakBuildResultAssociation( this );
369 }
370
371 this.project = project;
372
373 if ( project != null )
374 {
375 this.project.createBuildResultAssociation( this );
376 }
377 }
378
379
380
381
382
383
384 public void setScmResult( ScmResult scmResult )
385 {
386 this.scmResult = scmResult;
387 }
388
389
390
391
392
393
394 public void setStartTime( long startTime )
395 {
396 this.startTime = startTime;
397 }
398
399
400
401
402
403
404 public void setState( int state )
405 {
406 this.state = state;
407 }
408
409
410
411
412
413
414 public void setSuccess( boolean success )
415 {
416 this.success = success;
417 }
418
419
420
421
422
423
424 public void setTestResult( TestResult testResult )
425 {
426 this.testResult = testResult;
427 }
428
429
430
431
432
433
434 public void setTrigger( int trigger )
435 {
436 this.trigger = trigger;
437 }
438
439
440
441
442
443
444 public void setUsername( String username )
445 {
446 this.username = username;
447 }
448
449
450
451
452
453
454 public java.lang.String toString()
455 {
456 StringBuilder buf = new StringBuilder( 128 );
457
458 buf.append( "id = '" );
459 buf.append( getId() );
460 buf.append( "'" );
461
462 return buf.toString();
463 }
464
465 }