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