View Javadoc

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