View Javadoc

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