View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.11,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * Describes where an artifact has moved to. If any of the values
10   * are omitted, it is
11   *         assumed to be the same as it was before.
12   * 
13   * @version $Revision$ $Date$
14   */
15  @SuppressWarnings( "all" )
16  public class Relocation
17      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
18  {
19  
20        //--------------------------/
21       //- Class/Member Variables -/
22      //--------------------------/
23  
24      /**
25       * The group ID the artifact has moved to.
26       */
27      private String groupId;
28  
29      /**
30       * The new artifact ID of the artifact.
31       */
32      private String artifactId;
33  
34      /**
35       * The new version of the artifact.
36       */
37      private String version;
38  
39      /**
40       * An additional message to show the user about the move, such
41       * as the reason.
42       */
43      private String message;
44  
45      /**
46       * Field locations.
47       */
48      private java.util.Map<Object, InputLocation> locations;
49  
50      /**
51       * Field location.
52       */
53      private InputLocation location;
54  
55      /**
56       * Field groupIdLocation.
57       */
58      private InputLocation groupIdLocation;
59  
60      /**
61       * Field artifactIdLocation.
62       */
63      private InputLocation artifactIdLocation;
64  
65      /**
66       * Field versionLocation.
67       */
68      private InputLocation versionLocation;
69  
70      /**
71       * Field messageLocation.
72       */
73      private InputLocation messageLocation;
74  
75  
76        //-----------/
77       //- Methods -/
78      //-----------/
79  
80      /**
81       * Method clone.
82       * 
83       * @return Relocation
84       */
85      public Relocation clone()
86      {
87          try
88          {
89              Relocation copy = (Relocation) super.clone();
90  
91              if ( copy.locations != null )
92              {
93                  copy.locations = new java.util.LinkedHashMap( copy.locations );
94              }
95  
96              return copy;
97          }
98          catch ( java.lang.Exception ex )
99          {
100             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
101                 + " does not support clone()" ).initCause( ex );
102         }
103     } //-- Relocation clone()
104 
105     /**
106      * Get the new artifact ID of the artifact.
107      * 
108      * @return String
109      */
110     public String getArtifactId()
111     {
112         return this.artifactId;
113     } //-- String getArtifactId()
114 
115     /**
116      * Get the group ID the artifact has moved to.
117      * 
118      * @return String
119      */
120     public String getGroupId()
121     {
122         return this.groupId;
123     } //-- String getGroupId()
124 
125     /**
126      * 
127      * 
128      * @param key
129      * @return InputLocation
130      */
131     public InputLocation getLocation( Object key )
132     {
133         if ( key instanceof String )
134         {
135             switch ( ( String ) key )
136             {
137                 case "" :
138                 {
139                     return this.location;
140                 }
141                 case "groupId" :
142                 {
143                     return groupIdLocation;
144                 }
145                 case "artifactId" :
146                 {
147                     return artifactIdLocation;
148                 }
149                 case "version" :
150                 {
151                     return versionLocation;
152                 }
153                 case "message" :
154                 {
155                     return messageLocation;
156                 }
157                 default :
158                 {
159                     return getOtherLocation( key );
160                 }
161                 }
162             }
163             else
164             {
165                 return getOtherLocation( key );
166             }
167     } //-- InputLocation getLocation( Object )
168 
169     /**
170      * Get an additional message to show the user about the move,
171      * such as the reason.
172      * 
173      * @return String
174      */
175     public String getMessage()
176     {
177         return this.message;
178     } //-- String getMessage()
179 
180     /**
181      * 
182      * 
183      * @param key
184      * @param location
185      */
186     public void setLocation( Object key, InputLocation location )
187     {
188         if ( key instanceof String )
189         {
190             switch ( ( String ) key )
191             {
192                 case "" :
193                 {
194                     this.location = location;
195                     return;
196                 }
197                 case "groupId" :
198                 {
199                     groupIdLocation = location;
200                     return;
201                 }
202                 case "artifactId" :
203                 {
204                     artifactIdLocation = location;
205                     return;
206                 }
207                 case "version" :
208                 {
209                     versionLocation = location;
210                     return;
211                 }
212                 case "message" :
213                 {
214                     messageLocation = location;
215                     return;
216                 }
217                 default :
218                 {
219                     setOtherLocation( key, location );
220                     return;
221                 }
222                 }
223             }
224             else
225             {
226                 setOtherLocation( key, location );
227             }
228     } //-- void setLocation( Object, InputLocation )
229 
230     /**
231      * 
232      * 
233      * @param key
234      * @param location
235      */
236     public void setOtherLocation( Object key, InputLocation location )
237     {
238         if ( location != null )
239         {
240             if ( this.locations == null )
241             {
242                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
243             }
244             this.locations.put( key, location );
245         }
246     } //-- void setOtherLocation( Object, InputLocation )
247 
248     /**
249      * 
250      * 
251      * @param key
252      * @return InputLocation
253      */
254     private InputLocation getOtherLocation( Object key )
255     {
256         return ( locations != null ) ? locations.get( key ) : null;
257     } //-- InputLocation getOtherLocation( Object )
258 
259     /**
260      * Get the new version of the artifact.
261      * 
262      * @return String
263      */
264     public String getVersion()
265     {
266         return this.version;
267     } //-- String getVersion()
268 
269     /**
270      * Set the new artifact ID of the artifact.
271      * 
272      * @param artifactId
273      */
274     public void setArtifactId( String artifactId )
275     {
276         this.artifactId = artifactId;
277     } //-- void setArtifactId( String )
278 
279     /**
280      * Set the group ID the artifact has moved to.
281      * 
282      * @param groupId
283      */
284     public void setGroupId( String groupId )
285     {
286         this.groupId = groupId;
287     } //-- void setGroupId( String )
288 
289     /**
290      * Set an additional message to show the user about the move,
291      * such as the reason.
292      * 
293      * @param message
294      */
295     public void setMessage( String message )
296     {
297         this.message = message;
298     } //-- void setMessage( String )
299 
300     /**
301      * Set the new version of the artifact.
302      * 
303      * @param version
304      */
305     public void setVersion( String version )
306     {
307         this.version = version;
308     } //-- void setVersion( String )
309 
310 }