View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.continuum.model.project.v1_0_9;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
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   *         This class is a single continuum build.
26   *       
27   * 
28   * @version $Revision$ $Date$
29   */
30  @SuppressWarnings( "all" )
31  public class BuildResult
32      implements java.io.Serializable
33  {
34  
35        //--------------------------/
36       //- Class/Member Variables -/
37      //--------------------------/
38  
39      /**
40       * Field project.
41       */
42      private Project project;
43  
44      /**
45       * Field id.
46       */
47      private int id = 0;
48  
49      /**
50       * Field buildNumber.
51       */
52      private int buildNumber = 0;
53  
54      /**
55       * Field state.
56       */
57      private int state = 0;
58  
59      /**
60       * Field trigger.
61       */
62      private int trigger = 0;
63  
64      /**
65       * Field username.
66       */
67      private String username;
68  
69      /**
70       * Field startTime.
71       */
72      private long startTime = 0L;
73  
74      /**
75       * Field endTime.
76       */
77      private long endTime = 0L;
78  
79      /**
80       * Field error.
81       */
82      private String error;
83  
84      /**
85       * Field success.
86       */
87      private boolean success = false;
88  
89      /**
90       * Field exitCode.
91       */
92      private int exitCode = 0;
93  
94      /**
95       * Field scmResult.
96       */
97      private ScmResult scmResult;
98  
99      /**
100      * Field testResult.
101      */
102     private TestResult testResult;
103 
104 
105       //-----------/
106      //- Methods -/
107     //-----------/
108 
109     /**
110      * Method breakProjectAssociation.
111      * 
112      * @param project
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     } //-- void breakProjectAssociation( Project )
123 
124     /**
125      * Method createProjectAssociation.
126      * 
127      * @param project
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     } //-- void createProjectAssociation( Project )
138 
139     /**
140      * Method equals.
141      * 
142      * @param other
143      * @return boolean
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     } //-- boolean equals( Object )
164 
165     /**
166      * Get the buildNumber field.
167      * 
168      * @return int
169      */
170     public int getBuildNumber()
171     {
172         return this.buildNumber;
173     } //-- int getBuildNumber()
174 
175     /**
176      * Get the endTime field.
177      * 
178      * @return long
179      */
180     public long getEndTime()
181     {
182         return this.endTime;
183     } //-- long getEndTime()
184 
185     /**
186      * Get the error field.
187      * 
188      * @return String
189      */
190     public String getError()
191     {
192         return this.error;
193     } //-- String getError()
194 
195     /**
196      * Get the exitCode field.
197      * 
198      * @return int
199      */
200     public int getExitCode()
201     {
202         return this.exitCode;
203     } //-- int getExitCode()
204 
205     /**
206      * Get the id field.
207      * 
208      * @return int
209      */
210     public int getId()
211     {
212         return this.id;
213     } //-- int getId()
214 
215     /**
216      * Get the project field.
217      * 
218      * @return Project
219      */
220     public Project getProject()
221     {
222         return this.project;
223     } //-- Project getProject()
224 
225     /**
226      * Get the scmResult field.
227      * 
228      * @return ScmResult
229      */
230     public ScmResult getScmResult()
231     {
232         return this.scmResult;
233     } //-- ScmResult getScmResult()
234 
235     /**
236      * Get the startTime field.
237      * 
238      * @return long
239      */
240     public long getStartTime()
241     {
242         return this.startTime;
243     } //-- long getStartTime()
244 
245     /**
246      * Get the state field.
247      * 
248      * @return int
249      */
250     public int getState()
251     {
252         return this.state;
253     } //-- int getState()
254 
255     /**
256      * Get the testResult field.
257      * 
258      * @return TestResult
259      */
260     public TestResult getTestResult()
261     {
262         return this.testResult;
263     } //-- TestResult getTestResult()
264 
265     /**
266      * Get the trigger field.
267      * 
268      * @return int
269      */
270     public int getTrigger()
271     {
272         return this.trigger;
273     } //-- int getTrigger()
274 
275     /**
276      * Get the username field.
277      * 
278      * @return String
279      */
280     public String getUsername()
281     {
282         return this.username;
283     } //-- String getUsername()
284 
285     /**
286      * Method hashCode.
287      * 
288      * @return int
289      */
290     public int hashCode()
291     {
292         int result = 17;
293 
294         result = 37 * result + (int) id;
295 
296         return result;
297     } //-- int hashCode()
298 
299     /**
300      * Get the success field.
301      * 
302      * @return boolean
303      */
304     public boolean isSuccess()
305     {
306         return this.success;
307     } //-- boolean isSuccess()
308 
309     /**
310      * Set the buildNumber field.
311      * 
312      * @param buildNumber
313      */
314     public void setBuildNumber( int buildNumber )
315     {
316         this.buildNumber = buildNumber;
317     } //-- void setBuildNumber( int )
318 
319     /**
320      * Set the endTime field.
321      * 
322      * @param endTime
323      */
324     public void setEndTime( long endTime )
325     {
326         this.endTime = endTime;
327     } //-- void setEndTime( long )
328 
329     /**
330      * Set the error field.
331      * 
332      * @param error
333      */
334     public void setError( String error )
335     {
336         this.error = error;
337     } //-- void setError( String )
338 
339     /**
340      * Set the exitCode field.
341      * 
342      * @param exitCode
343      */
344     public void setExitCode( int exitCode )
345     {
346         this.exitCode = exitCode;
347     } //-- void setExitCode( int )
348 
349     /**
350      * Set the id field.
351      * 
352      * @param id
353      */
354     public void setId( int id )
355     {
356         this.id = id;
357     } //-- void setId( int )
358 
359     /**
360      * Set the project field.
361      * 
362      * @param project
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     } //-- void setProject( Project )
378 
379     /**
380      * Set the scmResult field.
381      * 
382      * @param scmResult
383      */
384     public void setScmResult( ScmResult scmResult )
385     {
386         this.scmResult = scmResult;
387     } //-- void setScmResult( ScmResult )
388 
389     /**
390      * Set the startTime field.
391      * 
392      * @param startTime
393      */
394     public void setStartTime( long startTime )
395     {
396         this.startTime = startTime;
397     } //-- void setStartTime( long )
398 
399     /**
400      * Set the state field.
401      * 
402      * @param state
403      */
404     public void setState( int state )
405     {
406         this.state = state;
407     } //-- void setState( int )
408 
409     /**
410      * Set the success field.
411      * 
412      * @param success
413      */
414     public void setSuccess( boolean success )
415     {
416         this.success = success;
417     } //-- void setSuccess( boolean )
418 
419     /**
420      * Set the testResult field.
421      * 
422      * @param testResult
423      */
424     public void setTestResult( TestResult testResult )
425     {
426         this.testResult = testResult;
427     } //-- void setTestResult( TestResult )
428 
429     /**
430      * Set the trigger field.
431      * 
432      * @param trigger
433      */
434     public void setTrigger( int trigger )
435     {
436         this.trigger = trigger;
437     } //-- void setTrigger( int )
438 
439     /**
440      * Set the username field.
441      * 
442      * @param username
443      */
444     public void setUsername( String username )
445     {
446         this.username = username;
447     } //-- void setUsername( String )
448 
449     /**
450      * Method toString.
451      * 
452      * @return String
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     } //-- java.lang.String toString()
464 
465 }