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 long startTime = 0L;
68
69
70
71
72 private long endTime = 0L;
73
74
75
76
77 private String error;
78
79
80
81
82 private boolean success = false;
83
84
85
86
87 private int exitCode = 0;
88
89
90
91
92 private ScmResult scmResult;
93
94
95
96
97 private TestResult testResult;
98
99
100
101
102
103
104
105
106
107
108
109 public void breakProjectAssociation( Project project )
110 {
111 if ( this.project != project )
112 {
113 throw new IllegalStateException( "project isn't associated." );
114 }
115
116 this.project = null;
117 }
118
119
120
121
122
123
124 public void createProjectAssociation( Project project )
125 {
126 if ( this.project != null )
127 {
128 breakProjectAssociation( this.project );
129 }
130
131 this.project = project;
132 }
133
134
135
136
137
138
139
140 public boolean equals( Object other )
141 {
142 if ( this == other )
143 {
144 return true;
145 }
146
147 if ( !( other instanceof BuildResult ) )
148 {
149 return false;
150 }
151
152 BuildResult that = (BuildResult) other;
153 boolean result = true;
154
155 result = result && id == that.id;
156
157 return result;
158 }
159
160
161
162
163
164
165 public int getBuildNumber()
166 {
167 return this.buildNumber;
168 }
169
170
171
172
173
174
175 public long getEndTime()
176 {
177 return this.endTime;
178 }
179
180
181
182
183
184
185 public String getError()
186 {
187 return this.error;
188 }
189
190
191
192
193
194
195 public int getExitCode()
196 {
197 return this.exitCode;
198 }
199
200
201
202
203
204
205 public int getId()
206 {
207 return this.id;
208 }
209
210
211
212
213
214
215 public Project getProject()
216 {
217 return this.project;
218 }
219
220
221
222
223
224
225 public ScmResult getScmResult()
226 {
227 return this.scmResult;
228 }
229
230
231
232
233
234
235 public long getStartTime()
236 {
237 return this.startTime;
238 }
239
240
241
242
243
244
245 public int getState()
246 {
247 return this.state;
248 }
249
250
251
252
253
254
255 public TestResult getTestResult()
256 {
257 return this.testResult;
258 }
259
260
261
262
263
264
265 public int getTrigger()
266 {
267 return this.trigger;
268 }
269
270
271
272
273
274
275 public int hashCode()
276 {
277 int result = 17;
278
279 result = 37 * result + (int) id;
280
281 return result;
282 }
283
284
285
286
287
288
289 public boolean isSuccess()
290 {
291 return this.success;
292 }
293
294
295
296
297
298
299 public void setBuildNumber( int buildNumber )
300 {
301 this.buildNumber = buildNumber;
302 }
303
304
305
306
307
308
309 public void setEndTime( long endTime )
310 {
311 this.endTime = endTime;
312 }
313
314
315
316
317
318
319 public void setError( String error )
320 {
321 this.error = error;
322 }
323
324
325
326
327
328
329 public void setExitCode( int exitCode )
330 {
331 this.exitCode = exitCode;
332 }
333
334
335
336
337
338
339 public void setId( int id )
340 {
341 this.id = id;
342 }
343
344
345
346
347
348
349 public void setProject( Project project )
350 {
351 if ( this.project != null )
352 {
353 this.project.breakBuildResultAssociation( this );
354 }
355
356 this.project = project;
357
358 if ( project != null )
359 {
360 this.project.createBuildResultAssociation( this );
361 }
362 }
363
364
365
366
367
368
369 public void setScmResult( ScmResult scmResult )
370 {
371 this.scmResult = scmResult;
372 }
373
374
375
376
377
378
379 public void setStartTime( long startTime )
380 {
381 this.startTime = startTime;
382 }
383
384
385
386
387
388
389 public void setState( int state )
390 {
391 this.state = state;
392 }
393
394
395
396
397
398
399 public void setSuccess( boolean success )
400 {
401 this.success = success;
402 }
403
404
405
406
407
408
409 public void setTestResult( TestResult testResult )
410 {
411 this.testResult = testResult;
412 }
413
414
415
416
417
418
419 public void setTrigger( int trigger )
420 {
421 this.trigger = trigger;
422 }
423
424
425
426
427
428
429 public java.lang.String toString()
430 {
431 StringBuilder buf = new StringBuilder( 128 );
432
433 buf.append( "id = '" );
434 buf.append( getId() );
435 buf.append( "'" );
436
437 return buf.toString();
438 }
439
440 }