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.artifact.repository.metadata;
25  
26  /**
27   * Versioning information for a sub-artifact of the current
28   * snapshot artifact.
29   * 
30   * @version $Revision$ $Date$
31   */
32  @SuppressWarnings( "all" )
33  public class SnapshotVersion
34      implements java.io.Serializable, java.lang.Cloneable
35  {
36  
37        //--------------------------/
38       //- Class/Member Variables -/
39      //--------------------------/
40  
41      /**
42       * The classifier of the sub-artifact. Each classifier and
43       * extension pair may only appear once.
44       */
45      private String classifier = "";
46  
47      /**
48       * The file extension of the sub-artifact. Each classifier and
49       * extension pair may only appear once.
50       */
51      private String extension;
52  
53      /**
54       * The resolved snapshot version of the sub-artifact.
55       */
56      private String version;
57  
58      /**
59       * The timestamp when this version information was last
60       * updated. The timestamp is expressed using UTC in the format
61       * yyyyMMddHHmmss.
62       */
63      private String updated;
64  
65  
66        //-----------/
67       //- Methods -/
68      //-----------/
69  
70      /**
71       * Method clone.
72       * 
73       * @return SnapshotVersion
74       */
75      public SnapshotVersion clone()
76      {
77          try
78          {
79              SnapshotVersion copy = (SnapshotVersion) super.clone();
80  
81              return copy;
82          }
83          catch ( java.lang.Exception ex )
84          {
85              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
86                  + " does not support clone()" ).initCause( ex );
87          }
88      } //-- SnapshotVersion clone()
89  
90      /**
91       * Method equals.
92       * 
93       * @param other a other object.
94       * @return boolean
95       */
96      public boolean equals( Object other )
97      {
98          if ( this == other )
99          {
100             return true;
101         }
102 
103         if ( !( other instanceof SnapshotVersion ) )
104         {
105             return false;
106         }
107 
108         SnapshotVersion that = (SnapshotVersion) other;
109         boolean result = true;
110 
111         result = result && ( getClassifier() == null ? that.getClassifier() == null : getClassifier().equals( that.getClassifier() ) );
112         result = result && ( getExtension() == null ? that.getExtension() == null : getExtension().equals( that.getExtension() ) );
113         result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) );
114         result = result && ( getUpdated() == null ? that.getUpdated() == null : getUpdated().equals( that.getUpdated() ) );
115 
116         return result;
117     } //-- boolean equals( Object )
118 
119     /**
120      * Get the classifier of the sub-artifact. Each classifier and
121      * extension pair may only appear once.
122      * 
123      * @return String
124      */
125     public String getClassifier()
126     {
127         return this.classifier;
128     } //-- String getClassifier()
129 
130     /**
131      * Get the file extension of the sub-artifact. Each classifier
132      * and extension pair may only appear once.
133      * 
134      * @return String
135      */
136     public String getExtension()
137     {
138         return this.extension;
139     } //-- String getExtension()
140 
141     /**
142      * Get the timestamp when this version information was last
143      * updated. The timestamp is expressed using UTC in the format
144      * yyyyMMddHHmmss.
145      * 
146      * @return String
147      */
148     public String getUpdated()
149     {
150         return this.updated;
151     } //-- String getUpdated()
152 
153     /**
154      * Get the resolved snapshot version of the sub-artifact.
155      * 
156      * @return String
157      */
158     public String getVersion()
159     {
160         return this.version;
161     } //-- String getVersion()
162 
163     /**
164      * Method hashCode.
165      * 
166      * @return int
167      */
168     public int hashCode()
169     {
170         int result = 17;
171 
172         result = 37 * result + ( classifier != null ? classifier.hashCode() : 0 );
173         result = 37 * result + ( extension != null ? extension.hashCode() : 0 );
174         result = 37 * result + ( version != null ? version.hashCode() : 0 );
175         result = 37 * result + ( updated != null ? updated.hashCode() : 0 );
176 
177         return result;
178     } //-- int hashCode()
179 
180     /**
181      * Set the classifier of the sub-artifact. Each classifier and
182      * extension pair may only appear once.
183      * 
184      * @param classifier a classifier object.
185      */
186     public void setClassifier( String classifier )
187     {
188         this.classifier = classifier;
189     } //-- void setClassifier( String )
190 
191     /**
192      * Set the file extension of the sub-artifact. Each classifier
193      * and extension pair may only appear once.
194      * 
195      * @param extension a extension object.
196      */
197     public void setExtension( String extension )
198     {
199         this.extension = extension;
200     } //-- void setExtension( String )
201 
202     /**
203      * Set the timestamp when this version information was last
204      * updated. The timestamp is expressed using UTC in the format
205      * yyyyMMddHHmmss.
206      * 
207      * @param updated a updated object.
208      */
209     public void setUpdated( String updated )
210     {
211         this.updated = updated;
212     } //-- void setUpdated( String )
213 
214     /**
215      * Set the resolved snapshot version of the sub-artifact.
216      * 
217      * @param version a version object.
218      */
219     public void setVersion( String version )
220     {
221         this.version = version;
222     } //-- void setVersion( String )
223 
224     /**
225      * Method toString.
226      * 
227      * @return String
228      */
229     public java.lang.String toString()
230     {
231         StringBuilder buf = new StringBuilder( 128 );
232 
233         buf.append( "classifier = '" );
234         buf.append( getClassifier() );
235         buf.append( "'" );
236         buf.append( "\n" ); 
237         buf.append( "extension = '" );
238         buf.append( getExtension() );
239         buf.append( "'" );
240         buf.append( "\n" ); 
241         buf.append( "version = '" );
242         buf.append( getVersion() );
243         buf.append( "'" );
244         buf.append( "\n" ); 
245         buf.append( "updated = '" );
246         buf.append( getUpdated() );
247         buf.append( "'" );
248 
249         return buf.toString();
250     } //-- java.lang.String toString()
251 
252 }