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