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.archetype.catalog;
7   
8   /**
9    * Informations to point to an Archetype referenced in the catalog.
10   * 
11   * @version $Revision$ $Date$
12   */
13  @SuppressWarnings( "all" )
14  public class Archetype
15      implements java.io.Serializable
16  {
17  
18        //--------------------------/
19       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * The groupId of the archetype.
24       */
25      private String groupId;
26  
27      /**
28       * The artifactId of the archetype.
29       */
30      private String artifactId;
31  
32      /**
33       * The version of the archetype. <code>RELEASE</code> is a
34       * valid version.
35       */
36      private String version;
37  
38      /**
39       * The URL of the repository where to find the archetype.
40       *            When omitted, the archetype is searched for in
41       * the repository where the catalog comes from.
42       */
43      @Deprecated
44      private String repository;
45  
46      /**
47       * The description of the archetype.
48       */
49      private String description;
50  
51      /**
52       * Field goals.
53       */
54      private java.util.List<String> goals;
55  
56      /**
57       * Field properties.
58       */
59      private java.util.Properties properties;
60  
61  
62        //-----------/
63       //- Methods -/
64      //-----------/
65  
66      /**
67       * Method addGoal.
68       * 
69       * @param string
70       */
71      public void addGoal( String string )
72      {
73          getGoals().add( string );
74      } //-- void addGoal( String )
75  
76      /**
77       * Method addProperty.
78       * 
79       * @param key
80       * @param value
81       */
82      public void addProperty( String key, String value )
83      {
84          getProperties().put( key, value );
85      } //-- void addProperty( String, String )
86  
87      /**
88       * Get the artifactId of the archetype.
89       * 
90       * @return String
91       */
92      public String getArtifactId()
93      {
94          return this.artifactId;
95      } //-- String getArtifactId()
96  
97      /**
98       * Get the description of the archetype.
99       * 
100      * @return String
101      */
102     public String getDescription()
103     {
104         return this.description;
105     } //-- String getDescription()
106 
107     /**
108      * Method getGoals.
109      * 
110      * @return List
111      */
112     public java.util.List<String> getGoals()
113     {
114         if ( this.goals == null )
115         {
116             this.goals = new java.util.ArrayList<String>();
117         }
118 
119         return this.goals;
120     } //-- java.util.List<String> getGoals()
121 
122     /**
123      * Get the groupId of the archetype.
124      * 
125      * @return String
126      */
127     public String getGroupId()
128     {
129         return this.groupId;
130     } //-- String getGroupId()
131 
132     /**
133      * Method getProperties.
134      * 
135      * @return Properties
136      */
137     public java.util.Properties getProperties()
138     {
139         if ( this.properties == null )
140         {
141             this.properties = new java.util.Properties();
142         }
143 
144         return this.properties;
145     } //-- java.util.Properties getProperties()
146 
147     /**
148      * Get the URL of the repository where to find the archetype.
149      *            When omitted, the archetype is searched for in
150      * the repository where the catalog comes from.
151      * 
152      * @return String
153      */
154     public String getRepository()
155     {
156         return this.repository;
157     } //-- String getRepository()
158 
159     /**
160      * Get the version of the archetype. <code>RELEASE</code> is a
161      * valid version.
162      * 
163      * @return String
164      */
165     public String getVersion()
166     {
167         return this.version;
168     } //-- String getVersion()
169 
170     /**
171      * Method removeGoal.
172      * 
173      * @param string
174      */
175     public void removeGoal( String string )
176     {
177         getGoals().remove( string );
178     } //-- void removeGoal( String )
179 
180     /**
181      * Set the artifactId of the archetype.
182      * 
183      * @param artifactId
184      */
185     public void setArtifactId( String artifactId )
186     {
187         this.artifactId = artifactId;
188     } //-- void setArtifactId( String )
189 
190     /**
191      * Set the description of the archetype.
192      * 
193      * @param description
194      */
195     public void setDescription( String description )
196     {
197         this.description = description;
198     } //-- void setDescription( String )
199 
200     /**
201      * Set goals to execute after the creation of the project.
202      * 
203      * @param goals
204      */
205     public void setGoals( java.util.List<String> goals )
206     {
207         this.goals = goals;
208     } //-- void setGoals( java.util.List )
209 
210     /**
211      * Set the groupId of the archetype.
212      * 
213      * @param groupId
214      */
215     public void setGroupId( String groupId )
216     {
217         this.groupId = groupId;
218     } //-- void setGroupId( String )
219 
220     /**
221      * Set properties that will be used during the execution of
222      * addition goals after the creation of the project.
223      * 
224      * @param properties
225      */
226     public void setProperties( java.util.Properties properties )
227     {
228         this.properties = properties;
229     } //-- void setProperties( java.util.Properties )
230 
231     /**
232      * Set the URL of the repository where to find the archetype.
233      *            When omitted, the archetype is searched for in
234      * the repository where the catalog comes from.
235      * 
236      * @param repository
237      */
238     public void setRepository( String repository )
239     {
240         this.repository = repository;
241     } //-- void setRepository( String )
242 
243     /**
244      * Set the version of the archetype. <code>RELEASE</code> is a
245      * valid version.
246      * 
247      * @param version
248      */
249     public void setVersion( String version )
250     {
251         this.version = version;
252     } //-- void setVersion( String )
253 
254     
255     public String toString()
256     {
257         return "[" + groupId + ":" + artifactId + ":" + version + ( repository != null ? " -> " + repository : "" ) + "]";
258     }
259     public int hashCode()
260     {
261         return groupId.hashCode() + 17 * artifactId.hashCode();
262     }
263     public boolean equals( Object object )
264     {
265         if ( object == null || !( object instanceof Archetype ) )
266         {
267             return false;
268         }
269         else
270         {
271             Archetype a = (Archetype) object;
272             return org.codehaus.plexus.util.StringUtils.equals( groupId, a.getGroupId() )
273                    && org.codehaus.plexus.util.StringUtils.equals( artifactId, a.getArtifactId() );
274         }
275     }
276           
277 }