View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.8.1,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * A repository contains the information needed for establishing
10   * connections with
11   *         remote repository.
12   * 
13   * @version $Revision$ $Date$
14   */
15  @SuppressWarnings( "all" )
16  public class RepositoryBase
17      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
18  {
19  
20        //--------------------------/
21       //- Class/Member Variables -/
22      //--------------------------/
23  
24      /**
25       * 
26       *             
27       *             A unique identifier for a repository. This is
28       * used to match the repository
29       *             to configuration in the
30       * <code>settings.xml</code> file, for example. Furthermore,
31       * the identifier is
32       *             used during POM inheritance and profile
33       * injection to detect repositories that should be merged.
34       *             
35       *           
36       */
37      private String id;
38  
39      /**
40       * Human readable name of the repository.
41       */
42      private String name;
43  
44      /**
45       * 
46       *             
47       *             The url of the repository, in the form
48       * <code>protocol://hostname/path</code>.
49       *             
50       *           
51       */
52      private String url;
53  
54      /**
55       * 
56       *             
57       *             The type of layout this repository uses for
58       * locating and storing artifacts -
59       *             can be <code>legacy</code> or
60       * <code>default</code>.
61       *             
62       *           
63       */
64      private String layout = "default";
65  
66      /**
67       * Field locations.
68       */
69      private java.util.Map<Object, InputLocation> locations;
70  
71  
72        //-----------/
73       //- Methods -/
74      //-----------/
75  
76      /**
77       * Method clone.
78       * 
79       * @return RepositoryBase
80       */
81      public RepositoryBase clone()
82      {
83          try
84          {
85              RepositoryBase copy = (RepositoryBase) super.clone();
86  
87              if ( copy.locations != null )
88              {
89                  copy.locations = new java.util.LinkedHashMap( copy.locations );
90              }
91  
92              return copy;
93          }
94          catch ( java.lang.Exception ex )
95          {
96              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
97                  + " does not support clone()" ).initCause( ex );
98          }
99      } //-- 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 }