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.5.1,
20   any modifications will be overwritten.
21   ==============================================================
22   */
23  
24  package org.apache.maven.plugin.doap.options;
25  
26  /**
27   * An Maven artifact object used by DOAP.
28   * 
29   * @version $Revision$ $Date$
30   */
31  @SuppressWarnings( "all" )
32  public class DoapArtifact
33      implements java.io.Serializable
34  {
35  
36        //--------------------------/
37       //- Class/Member Variables -/
38      //--------------------------/
39  
40      /**
41       * The id of the group of the Maven artifact.
42       */
43      private String groupId;
44  
45      /**
46       * The artifact id of the Maven artifact.
47       */
48      private String artifactId;
49  
50      /**
51       * The version of the Maven artifact.
52       */
53      private String version;
54  
55      /**
56       * The name of the DOAP file that will be generated, no notion
57       * of path.
58       */
59      private String doapFileName;
60  
61  
62        //-----------/
63       //- Methods -/
64      //-----------/
65  
66      /**
67       * Method equals.
68       * 
69       * @param other a other object.
70       * @return boolean
71       */
72      public boolean equals( Object other )
73      {
74          if ( this == other )
75          {
76              return true;
77          }
78  
79          if ( !( other instanceof DoapArtifact ) )
80          {
81              return false;
82          }
83  
84          DoapArtifact that = (DoapArtifact) other;
85          boolean result = true;
86  
87          result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) );
88          result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) );
89          result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) );
90          result = result && ( getDoapFileName() == null ? that.getDoapFileName() == null : getDoapFileName().equals( that.getDoapFileName() ) );
91  
92          return result;
93      } //-- boolean equals( Object )
94  
95      /**
96       * Get the artifact id of the Maven artifact.
97       * 
98       * @return String
99       */
100     public String getArtifactId()
101     {
102         return this.artifactId;
103     } //-- String getArtifactId()
104 
105     /**
106      * Get the id of the group of the Maven artifact.
107      * 
108      * @return String
109      */
110     public String getGroupId()
111     {
112         return this.groupId;
113     } //-- String getGroupId()
114 
115     /**
116      * Get the version of the Maven artifact.
117      * 
118      * @return String
119      */
120     public String getVersion()
121     {
122         return this.version;
123     } //-- String getVersion()
124 
125     /**
126      * Method hashCode.
127      * 
128      * @return int
129      */
130     public int hashCode()
131     {
132         int result = 17;
133 
134         result = 37 * result + ( groupId != null ? groupId.hashCode() : 0 );
135         result = 37 * result + ( artifactId != null ? artifactId.hashCode() : 0 );
136         result = 37 * result + ( version != null ? version.hashCode() : 0 );
137         result = 37 * result + ( doapFileName != null ? doapFileName.hashCode() : 0 );
138 
139         return result;
140     } //-- int hashCode()
141 
142     /**
143      * Set the artifact id of the Maven artifact.
144      * 
145      * @param artifactId a artifactId object.
146      */
147     public void setArtifactId( String artifactId )
148     {
149         this.artifactId = artifactId;
150     } //-- void setArtifactId( String )
151 
152     /**
153      * Set the name of the DOAP file that will be generated, no
154      * notion of path.
155      * 
156      * @param doapFileName a doapFileName object.
157      */
158     public void setDoapFileName( String doapFileName )
159     {
160         this.doapFileName = doapFileName;
161     } //-- void setDoapFileName( String )
162 
163     /**
164      * Set the id of the group of the Maven artifact.
165      * 
166      * @param groupId a groupId object.
167      */
168     public void setGroupId( String groupId )
169     {
170         this.groupId = groupId;
171     } //-- void setGroupId( String )
172 
173     /**
174      * Set the version of the Maven artifact.
175      * 
176      * @param version a version object.
177      */
178     public void setVersion( String version )
179     {
180         this.version = version;
181     } //-- void setVersion( String )
182 
183     /**
184      * Method toString.
185      * 
186      * @return String
187      */
188     public java.lang.String toString()
189     {
190         StringBuilder buf = new StringBuilder( 128 );
191 
192         buf.append( "groupId = '" );
193         buf.append( getGroupId() );
194         buf.append( "'" );
195         buf.append( "\n" ); 
196         buf.append( "artifactId = '" );
197         buf.append( getArtifactId() );
198         buf.append( "'" );
199         buf.append( "\n" ); 
200         buf.append( "version = '" );
201         buf.append( getVersion() );
202         buf.append( "'" );
203         buf.append( "\n" ); 
204         buf.append( "doapFileName = '" );
205         buf.append( getDoapFileName() );
206         buf.append( "'" );
207 
208         return buf.toString();
209     } //-- java.lang.String toString()
210 
211     
212             
213     /**
214      * Get the path of the DOAP file that will be generated, no notion of path. <br>
215      * If not specified, return <code>"doap_" + this.artifactId + ".rdf"</code> <br>
216      *
217      * @return String
218      */
219     public String getDoapFileName()
220     {
221         if ( org.codehaus.plexus.util.StringUtils.isEmpty( this.doapFileName ) )
222         {
223             return "doap_" + this.artifactId + ".rdf";
224         }
225         return this.doapFileName;
226     }
227 
228     /**
229      * @return String the configuration of this class.
230      */
231     public String toConfiguration()
232     {
233         java.lang.StringBuilder sb = new java.lang.StringBuilder();
234         sb.append( "<artifact>" );
235         sb.append( "<groupId>" ).append( this.groupId ).append( "</groupId>" );
236         sb.append( "<artifactId>" ).append( this.artifactId ).append( "</artifactId>" );
237         sb.append( "<version>" ).append( this.version ).append( "</version>" );
238         sb.append( "</artifact>" );
239 
240         return sb.toString();
241     }
242             
243           
244 }