001    /*
002     =================== DO NOT EDIT THIS FILE ====================
003     Generated by Modello 1.4.1 on 2013-02-24 03:32:14,
004     any modifications will be overwritten.
005     ==============================================================
006     */
007    
008    package org.apache.maven.model;
009    
010    /**
011     * A repository contains the information needed for establishing
012     * connections with
013     *         remote repository.
014     * 
015     * @version $Revision$ $Date$
016     */
017    @SuppressWarnings( "all" )
018    public class RepositoryBase
019        implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
020    {
021    
022          //--------------------------/
023         //- Class/Member Variables -/
024        //--------------------------/
025    
026        /**
027         * 
028         *             
029         *             A unique identifier for a repository. This is
030         * used to match the repository
031         *             to configuration in the
032         * <code>settings.xml</code> file, for example. Furthermore,
033         * the identifier is
034         *             used during POM inheritance and profile
035         * injection to detect repositories that should be merged.
036         *             
037         *           
038         */
039        private String id;
040    
041        /**
042         * Human readable name of the repository.
043         */
044        private String name;
045    
046        /**
047         * 
048         *             
049         *             The url of the repository, in the form
050         * <code>protocol://hostname/path</code>.
051         *             
052         *           
053         */
054        private String url;
055    
056        /**
057         * 
058         *             
059         *             The type of layout this repository uses for
060         * locating and storing artifacts -
061         *             can be <code>legacy</code> or
062         * <code>default</code>.
063         *             
064         *           
065         */
066        private String layout = "default";
067    
068        /**
069         * Field locations.
070         */
071        private java.util.Map<Object, InputLocation> locations;
072    
073    
074          //-----------/
075         //- Methods -/
076        //-----------/
077    
078        /**
079         * Method clone.
080         * 
081         * @return RepositoryBase
082         */
083        public RepositoryBase clone()
084        {
085            try
086            {
087                RepositoryBase copy = (RepositoryBase) super.clone();
088    
089                if ( copy.locations != null )
090                {
091                    copy.locations = new java.util.LinkedHashMap( copy.locations );
092                }
093    
094                return copy;
095            }
096            catch ( java.lang.Exception ex )
097            {
098                throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
099                    + " does not support clone()" ).initCause( ex );
100            }
101        } //-- RepositoryBase clone()
102    
103        /**
104         * Method equals.
105         * 
106         * @param other
107         * @return boolean
108         */
109        public boolean equals( Object other )
110        {
111            if ( this == other )
112            {
113                return true;
114            }
115    
116            if ( !( other instanceof RepositoryBase ) )
117            {
118                return false;
119            }
120    
121            RepositoryBase that = (RepositoryBase) other;
122            boolean result = true;
123    
124            result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
125    
126            return result;
127        } //-- boolean equals( Object )
128    
129        /**
130         * Get a unique identifier for a repository. This is used to
131         * match the repository
132         *             to configuration in the
133         * <code>settings.xml</code> file, for example. Furthermore,
134         * the identifier is
135         *             used during POM inheritance and profile
136         * injection to detect repositories that should be merged.
137         * 
138         * @return String
139         */
140        public String getId()
141        {
142            return this.id;
143        } //-- String getId()
144    
145        /**
146         * Get the type of layout this repository uses for locating and
147         * storing artifacts -
148         *             can be <code>legacy</code> or
149         * <code>default</code>.
150         * 
151         * @return String
152         */
153        public String getLayout()
154        {
155            return this.layout;
156        } //-- String getLayout()
157    
158        /**
159         * 
160         * 
161         * @param key
162         * @return InputLocation
163         */
164        public InputLocation getLocation( Object key )
165        {
166            return ( locations != null ) ? locations.get( key ) : null;
167        } //-- InputLocation getLocation( Object )
168    
169        /**
170         * Get human readable name of the repository.
171         * 
172         * @return String
173         */
174        public String getName()
175        {
176            return this.name;
177        } //-- String getName()
178    
179        /**
180         * Get the url of the repository, in the form
181         * <code>protocol://hostname/path</code>.
182         * 
183         * @return String
184         */
185        public String getUrl()
186        {
187            return this.url;
188        } //-- String getUrl()
189    
190        /**
191         * Method hashCode.
192         * 
193         * @return int
194         */
195        public int hashCode()
196        {
197            int result = 17;
198    
199            result = 37 * result + ( id != null ? id.hashCode() : 0 );
200    
201            return result;
202        } //-- int hashCode()
203    
204        /**
205         * Set a unique identifier for a repository. This is used to
206         * match the repository
207         *             to configuration in the
208         * <code>settings.xml</code> file, for example. Furthermore,
209         * the identifier is
210         *             used during POM inheritance and profile
211         * injection to detect repositories that should be merged.
212         * 
213         * @param id
214         */
215        public void setId( String id )
216        {
217            this.id = id;
218        } //-- void setId( String )
219    
220        /**
221         * Set the type of layout this repository uses for locating and
222         * storing artifacts -
223         *             can be <code>legacy</code> or
224         * <code>default</code>.
225         * 
226         * @param layout
227         */
228        public void setLayout( String layout )
229        {
230            this.layout = layout;
231        } //-- void setLayout( String )
232    
233        /**
234         * 
235         * 
236         * @param key
237         * @param location
238         */
239        public void setLocation( Object key, InputLocation location )
240        {
241            if ( location != null )
242            {
243                if ( this.locations == null )
244                {
245                    this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
246                }
247                this.locations.put( key, location );
248            }
249        } //-- void setLocation( Object, InputLocation )
250    
251        /**
252         * Set human readable name of the repository.
253         * 
254         * @param name
255         */
256        public void setName( String name )
257        {
258            this.name = name;
259        } //-- void setName( String )
260    
261        /**
262         * Set the url of the repository, in the form
263         * <code>protocol://hostname/path</code>.
264         * 
265         * @param url
266         */
267        public void setUrl( String url )
268        {
269            this.url = url;
270        } //-- void setUrl( String )
271    
272        /**
273         * Method toString.
274         * 
275         * @return String
276         */
277        public java.lang.String toString()
278        {
279            StringBuilder buf = new StringBuilder( 128 );
280    
281            buf.append( "id = '" );
282            buf.append( getId() );
283            buf.append( "'" );
284    
285            return buf.toString();
286        } //-- java.lang.String toString()
287    
288    }