001    /*
002     =================== DO NOT EDIT THIS FILE ====================
003     Generated by Modello 1.4.1 on 2012-01-20 18:09:18,
004     any modifications will be overwritten.
005     ==============================================================
006     */
007    
008    package org.apache.maven.model;
009    
010    /**
011     * Configures one method for notifying users/developers when a
012     * build breaks.
013     * 
014     * @version $Revision$ $Date$
015     */
016    @SuppressWarnings( "all" )
017    public class Notifier
018        implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
019    {
020    
021          //--------------------------/
022         //- Class/Member Variables -/
023        //--------------------------/
024    
025        /**
026         * The mechanism used to deliver notifications.
027         */
028        private String type = "mail";
029    
030        /**
031         * Whether to send notifications on error.
032         */
033        private boolean sendOnError = true;
034    
035        /**
036         * Whether to send notifications on failure.
037         */
038        private boolean sendOnFailure = true;
039    
040        /**
041         * Whether to send notifications on success.
042         */
043        private boolean sendOnSuccess = true;
044    
045        /**
046         * Whether to send notifications on warning.
047         */
048        private boolean sendOnWarning = true;
049    
050        /**
051         * 
052         *             
053         *             <b>Deprecated</b>. Where to send the
054         * notification to - eg email address.
055         *             
056         *           
057         */
058        private String address;
059    
060        /**
061         * Field configuration.
062         */
063        private java.util.Properties configuration;
064    
065        /**
066         * Field locations.
067         */
068        private java.util.Map<Object, InputLocation> locations;
069    
070    
071          //-----------/
072         //- Methods -/
073        //-----------/
074    
075        /**
076         * Method addConfiguration.
077         * 
078         * @param key
079         * @param value
080         */
081        public void addConfiguration( String key, String value )
082        {
083            getConfiguration().put( key, value );
084        } //-- void addConfiguration( String, String )
085    
086        /**
087         * Method clone.
088         * 
089         * @return Notifier
090         */
091        public Notifier clone()
092        {
093            try
094            {
095                Notifier copy = (Notifier) super.clone();
096    
097                if ( this.configuration != null )
098                {
099                    copy.configuration = (java.util.Properties) this.configuration.clone();
100                }
101    
102                if ( copy.locations != null )
103                {
104                    copy.locations = new java.util.LinkedHashMap( copy.locations );
105                }
106    
107                return copy;
108            }
109            catch ( java.lang.Exception ex )
110            {
111                throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
112                    + " does not support clone()" ).initCause( ex );
113            }
114        } //-- Notifier clone()
115    
116        /**
117         * Get <b>Deprecated</b>. Where to send the notification to -
118         * eg email address.
119         * 
120         * @return String
121         */
122        public String getAddress()
123        {
124            return this.address;
125        } //-- String getAddress()
126    
127        /**
128         * Method getConfiguration.
129         * 
130         * @return Properties
131         */
132        public java.util.Properties getConfiguration()
133        {
134            if ( this.configuration == null )
135            {
136                this.configuration = new java.util.Properties();
137            }
138    
139            return this.configuration;
140        } //-- java.util.Properties getConfiguration()
141    
142        /**
143         * 
144         * 
145         * @param key
146         * @return InputLocation
147         */
148        public InputLocation getLocation( Object key )
149        {
150            return ( locations != null ) ? locations.get( key ) : null;
151        } //-- InputLocation getLocation( Object )
152    
153        /**
154         * Get the mechanism used to deliver notifications.
155         * 
156         * @return String
157         */
158        public String getType()
159        {
160            return this.type;
161        } //-- String getType()
162    
163        /**
164         * Get whether to send notifications on error.
165         * 
166         * @return boolean
167         */
168        public boolean isSendOnError()
169        {
170            return this.sendOnError;
171        } //-- boolean isSendOnError()
172    
173        /**
174         * Get whether to send notifications on failure.
175         * 
176         * @return boolean
177         */
178        public boolean isSendOnFailure()
179        {
180            return this.sendOnFailure;
181        } //-- boolean isSendOnFailure()
182    
183        /**
184         * Get whether to send notifications on success.
185         * 
186         * @return boolean
187         */
188        public boolean isSendOnSuccess()
189        {
190            return this.sendOnSuccess;
191        } //-- boolean isSendOnSuccess()
192    
193        /**
194         * Get whether to send notifications on warning.
195         * 
196         * @return boolean
197         */
198        public boolean isSendOnWarning()
199        {
200            return this.sendOnWarning;
201        } //-- boolean isSendOnWarning()
202    
203        /**
204         * Set <b>Deprecated</b>. Where to send the notification to -
205         * eg email address.
206         * 
207         * @param address
208         */
209        public void setAddress( String address )
210        {
211            this.address = address;
212        } //-- void setAddress( String )
213    
214        /**
215         * Set extended configuration specific to this notifier goes
216         * here.
217         * 
218         * @param configuration
219         */
220        public void setConfiguration( java.util.Properties configuration )
221        {
222            this.configuration = configuration;
223        } //-- void setConfiguration( java.util.Properties )
224    
225        /**
226         * 
227         * 
228         * @param key
229         * @param location
230         */
231        public void setLocation( Object key, InputLocation location )
232        {
233            if ( location != null )
234            {
235                if ( this.locations == null )
236                {
237                    this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
238                }
239                this.locations.put( key, location );
240            }
241        } //-- void setLocation( Object, InputLocation )
242    
243        /**
244         * Set whether to send notifications on error.
245         * 
246         * @param sendOnError
247         */
248        public void setSendOnError( boolean sendOnError )
249        {
250            this.sendOnError = sendOnError;
251        } //-- void setSendOnError( boolean )
252    
253        /**
254         * Set whether to send notifications on failure.
255         * 
256         * @param sendOnFailure
257         */
258        public void setSendOnFailure( boolean sendOnFailure )
259        {
260            this.sendOnFailure = sendOnFailure;
261        } //-- void setSendOnFailure( boolean )
262    
263        /**
264         * Set whether to send notifications on success.
265         * 
266         * @param sendOnSuccess
267         */
268        public void setSendOnSuccess( boolean sendOnSuccess )
269        {
270            this.sendOnSuccess = sendOnSuccess;
271        } //-- void setSendOnSuccess( boolean )
272    
273        /**
274         * Set whether to send notifications on warning.
275         * 
276         * @param sendOnWarning
277         */
278        public void setSendOnWarning( boolean sendOnWarning )
279        {
280            this.sendOnWarning = sendOnWarning;
281        } //-- void setSendOnWarning( boolean )
282    
283        /**
284         * Set the mechanism used to deliver notifications.
285         * 
286         * @param type
287         */
288        public void setType( String type )
289        {
290            this.type = type;
291        } //-- void setType( String )
292    
293    }