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