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