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   *         Configures one method for notifying users/developers
26   * when a build breaks.
27   *       
28   * 
29   * @version $Revision$ $Date$
30   */
31  @SuppressWarnings( "all" )
32  public class ProjectNotifier
33      implements java.io.Serializable
34  {
35  
36        //--------------------------/
37       //- Class/Member Variables -/
38      //--------------------------/
39  
40      /**
41       * Field id.
42       */
43      private int id = 0;
44  
45      /**
46       * The mechanism used to deliver notifications.
47       */
48      private String type = "mail";
49  
50      /**
51       * The origin of the notifier (pom or user).
52       */
53      private int from = 0;
54  
55      /**
56       * Field enabled.
57       */
58      private boolean enabled = true;
59  
60      /**
61       * Field recipientType.
62       */
63      private int recipientType = 0;
64  
65      /**
66       * Field sendOnSuccess.
67       */
68      private boolean sendOnSuccess = true;
69  
70      /**
71       * Field sendOnFailure.
72       */
73      private boolean sendOnFailure = true;
74  
75      /**
76       * Field sendOnError.
77       */
78      private boolean sendOnError = true;
79  
80      /**
81       * Field sendOnWarning.
82       */
83      private boolean sendOnWarning = true;
84  
85      /**
86       * Field configuration.
87       */
88      private java.util.Map configuration;
89  
90  
91        //-----------/
92       //- Methods -/
93      //-----------/
94  
95      /**
96       * Method addConfiguration.
97       * 
98       * @param key
99       * @param value
100      */
101     public void addConfiguration( Object key, String value )
102     {
103         getConfiguration().put( key, value );
104     } //-- void addConfiguration( Object, String )
105 
106     /**
107      * Method equals.
108      * 
109      * @param other
110      * @return boolean
111      */
112     public boolean equals( Object other )
113     {
114         if ( this == other )
115         {
116             return true;
117         }
118 
119         if ( !( other instanceof ProjectNotifier ) )
120         {
121             return false;
122         }
123 
124         ProjectNotifier that = (ProjectNotifier) other;
125         boolean result = true;
126 
127         result = result && id == that.id;
128 
129         return result;
130     } //-- boolean equals( Object )
131 
132     /**
133      * Method getConfiguration.
134      * 
135      * @return Map
136      */
137     public java.util.Map getConfiguration()
138     {
139         if ( this.configuration == null )
140         {
141             this.configuration = new java.util.HashMap();
142         }
143 
144         return this.configuration;
145     } //-- java.util.Map getConfiguration()
146 
147     /**
148      * Get the origin of the notifier (pom or user).
149      * 
150      * @return int
151      */
152     public int getFrom()
153     {
154         return this.from;
155     } //-- int getFrom()
156 
157     /**
158      * Get the id field.
159      * 
160      * @return int
161      */
162     public int getId()
163     {
164         return this.id;
165     } //-- int getId()
166 
167     /**
168      * Get the recipientType field.
169      * 
170      * @return int
171      */
172     public int getRecipientType()
173     {
174         return this.recipientType;
175     } //-- int getRecipientType()
176 
177     /**
178      * Get the mechanism used to deliver notifications.
179      * 
180      * @return String
181      */
182     public String getType()
183     {
184         return this.type;
185     } //-- String getType()
186 
187     /**
188      * Method hashCode.
189      * 
190      * @return int
191      */
192     public int hashCode()
193     {
194         int result = 17;
195 
196         result = 37 * result + (int) id;
197 
198         return result;
199     } //-- int hashCode()
200 
201     /**
202      * Get the enabled field.
203      * 
204      * @return boolean
205      */
206     public boolean isEnabled()
207     {
208         return this.enabled;
209     } //-- boolean isEnabled()
210 
211     /**
212      * Get the sendOnError field.
213      * 
214      * @return boolean
215      */
216     public boolean isSendOnError()
217     {
218         return this.sendOnError;
219     } //-- boolean isSendOnError()
220 
221     /**
222      * Get the sendOnFailure field.
223      * 
224      * @return boolean
225      */
226     public boolean isSendOnFailure()
227     {
228         return this.sendOnFailure;
229     } //-- boolean isSendOnFailure()
230 
231     /**
232      * Get the sendOnSuccess field.
233      * 
234      * @return boolean
235      */
236     public boolean isSendOnSuccess()
237     {
238         return this.sendOnSuccess;
239     } //-- boolean isSendOnSuccess()
240 
241     /**
242      * Get the sendOnWarning field.
243      * 
244      * @return boolean
245      */
246     public boolean isSendOnWarning()
247     {
248         return this.sendOnWarning;
249     } //-- boolean isSendOnWarning()
250 
251     /**
252      * Set extended configuration specific to this notifier goes
253      * here.
254      * 
255      * @param configuration
256      */
257     public void setConfiguration( java.util.Map configuration )
258     {
259         this.configuration = configuration;
260     } //-- void setConfiguration( java.util.Map )
261 
262     /**
263      * Set the enabled field.
264      * 
265      * @param enabled
266      */
267     public void setEnabled( boolean enabled )
268     {
269         this.enabled = enabled;
270     } //-- void setEnabled( boolean )
271 
272     /**
273      * Set the origin of the notifier (pom or user).
274      * 
275      * @param from
276      */
277     public void setFrom( int from )
278     {
279         this.from = from;
280     } //-- void setFrom( int )
281 
282     /**
283      * Set the id field.
284      * 
285      * @param id
286      */
287     public void setId( int id )
288     {
289         this.id = id;
290     } //-- void setId( int )
291 
292     /**
293      * Set the recipientType field.
294      * 
295      * @param recipientType
296      */
297     public void setRecipientType( int recipientType )
298     {
299         this.recipientType = recipientType;
300     } //-- void setRecipientType( int )
301 
302     /**
303      * Set the sendOnError field.
304      * 
305      * @param sendOnError
306      */
307     public void setSendOnError( boolean sendOnError )
308     {
309         this.sendOnError = sendOnError;
310     } //-- void setSendOnError( boolean )
311 
312     /**
313      * Set the sendOnFailure field.
314      * 
315      * @param sendOnFailure
316      */
317     public void setSendOnFailure( boolean sendOnFailure )
318     {
319         this.sendOnFailure = sendOnFailure;
320     } //-- void setSendOnFailure( boolean )
321 
322     /**
323      * Set the sendOnSuccess field.
324      * 
325      * @param sendOnSuccess
326      */
327     public void setSendOnSuccess( boolean sendOnSuccess )
328     {
329         this.sendOnSuccess = sendOnSuccess;
330     } //-- void setSendOnSuccess( boolean )
331 
332     /**
333      * Set the sendOnWarning field.
334      * 
335      * @param sendOnWarning
336      */
337     public void setSendOnWarning( boolean sendOnWarning )
338     {
339         this.sendOnWarning = sendOnWarning;
340     } //-- void setSendOnWarning( boolean )
341 
342     /**
343      * Set the mechanism used to deliver notifications.
344      * 
345      * @param type
346      */
347     public void setType( String type )
348     {
349         this.type = type;
350     } //-- void setType( String )
351 
352     /**
353      * Method toString.
354      * 
355      * @return String
356      */
357     public java.lang.String toString()
358     {
359         StringBuilder buf = new StringBuilder( 128 );
360 
361         buf.append( "id = '" );
362         buf.append( getId() );
363         buf.append( "'" );
364 
365         return buf.toString();
366     } //-- java.lang.String toString()
367 
368     
369 
370               public static final int FROM_PROJECT = 1;
371 
372               public static final int FROM_USER = 2;
373 
374               public boolean isFromProject()
375               {
376                   return from == FROM_PROJECT;
377               }
378 
379               public boolean isFromUser()
380               {
381                   return from == FROM_USER;
382               }
383           
384 }