Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
JavadocPathArtifact |
|
| 1.3636363636363635;1,364 |
1 | /* | |
2 | * $Id: org.apache.maven.plugin.javadoc.options.JavadocPathArtifact.html 829389 2012-08-19 17:23:07Z hboutemy $ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.plugin.javadoc.options; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * An artifact object used by Javadoc path options like -docletpath | |
15 | * or -tagletpath. | |
16 | * | |
17 | * @version $Revision: 829389 $ $Date: 2012-08-19 17:23:07 +0000 (Sun, 19 Aug 2012) $ | |
18 | */ | |
19 | 6 | public class JavadocPathArtifact implements java.io.Serializable { |
20 | ||
21 | ||
22 | //--------------------------/ | |
23 | //- Class/Member Variables -/ | |
24 | //--------------------------/ | |
25 | ||
26 | /** | |
27 | * The id of the group of the artifact. | |
28 | */ | |
29 | private String groupId; | |
30 | ||
31 | /** | |
32 | * The id of the artifact. | |
33 | */ | |
34 | private String artifactId; | |
35 | ||
36 | /** | |
37 | * The version of the artifact. | |
38 | */ | |
39 | private String version; | |
40 | ||
41 | ||
42 | //-----------/ | |
43 | //- Methods -/ | |
44 | //-----------/ | |
45 | ||
46 | /** | |
47 | * Method equals. | |
48 | * | |
49 | * @param other | |
50 | * @return boolean | |
51 | */ | |
52 | public boolean equals(Object other) | |
53 | { | |
54 | 0 | if ( this == other) |
55 | { | |
56 | 0 | return true; |
57 | } | |
58 | ||
59 | 0 | if ( !(other instanceof JavadocPathArtifact) ) |
60 | { | |
61 | 0 | return false; |
62 | } | |
63 | ||
64 | 0 | JavadocPathArtifact that = (JavadocPathArtifact) other; |
65 | 0 | boolean result = true; |
66 | ||
67 | 0 | result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) ); |
68 | 0 | result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); |
69 | 0 | result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) ); |
70 | ||
71 | 0 | return result; |
72 | } //-- boolean equals(Object) | |
73 | ||
74 | /** | |
75 | * Get the id of the artifact. | |
76 | * | |
77 | * @return String | |
78 | */ | |
79 | public String getArtifactId() | |
80 | { | |
81 | 13 | return this.artifactId; |
82 | } //-- String getArtifactId() | |
83 | ||
84 | /** | |
85 | * Get the id of the group of the artifact. | |
86 | * | |
87 | * @return String | |
88 | */ | |
89 | public String getGroupId() | |
90 | { | |
91 | 22 | return this.groupId; |
92 | } //-- String getGroupId() | |
93 | ||
94 | /** | |
95 | * Get the version of the artifact. | |
96 | * | |
97 | * @return String | |
98 | */ | |
99 | public String getVersion() | |
100 | { | |
101 | 13 | return this.version; |
102 | } //-- String getVersion() | |
103 | ||
104 | /** | |
105 | * Method hashCode. | |
106 | * | |
107 | * @return int | |
108 | */ | |
109 | public int hashCode() | |
110 | { | |
111 | 0 | int result = 17; |
112 | ||
113 | 0 | result = 37 * result + ( groupId != null ? groupId.hashCode() : 0 ); |
114 | 0 | result = 37 * result + ( artifactId != null ? artifactId.hashCode() : 0 ); |
115 | 0 | result = 37 * result + ( version != null ? version.hashCode() : 0 ); |
116 | ||
117 | 0 | return result; |
118 | } //-- int hashCode() | |
119 | ||
120 | /** | |
121 | * Set the id of the artifact. | |
122 | * | |
123 | * @param artifactId | |
124 | */ | |
125 | public void setArtifactId(String artifactId) | |
126 | { | |
127 | 6 | this.artifactId = artifactId; |
128 | 6 | } //-- void setArtifactId(String) |
129 | ||
130 | /** | |
131 | * Set the id of the group of the artifact. | |
132 | * | |
133 | * @param groupId | |
134 | */ | |
135 | public void setGroupId(String groupId) | |
136 | { | |
137 | 6 | this.groupId = groupId; |
138 | 6 | } //-- void setGroupId(String) |
139 | ||
140 | /** | |
141 | * Set the version of the artifact. | |
142 | * | |
143 | * @param version | |
144 | */ | |
145 | public void setVersion(String version) | |
146 | { | |
147 | 6 | this.version = version; |
148 | 6 | } //-- void setVersion(String) |
149 | ||
150 | /** | |
151 | * Method toString. | |
152 | * | |
153 | * @return java.lang.String | |
154 | */ | |
155 | public java.lang.String toString() | |
156 | { | |
157 | 0 | StringBuffer buf = new StringBuffer(); |
158 | ||
159 | 0 | buf.append( "groupId = '" ); |
160 | 0 | buf.append( getGroupId() ); |
161 | 0 | buf.append( "'" ); |
162 | 0 | buf.append( "\n" ); |
163 | 0 | buf.append( "artifactId = '" ); |
164 | 0 | buf.append( getArtifactId() ); |
165 | 0 | buf.append( "'" ); |
166 | 0 | buf.append( "\n" ); |
167 | 0 | buf.append( "version = '" ); |
168 | 0 | buf.append( getVersion() ); |
169 | 0 | buf.append( "'" ); |
170 | ||
171 | 0 | return buf.toString(); |
172 | } //-- java.lang.String toString() | |
173 | ||
174 | ||
175 | 6 | private String modelEncoding = "UTF-8"; |
176 | ||
177 | /** | |
178 | * Set an encoding used for reading/writing the model. | |
179 | * | |
180 | * @param modelEncoding the encoding used when reading/writing the model. | |
181 | */ | |
182 | public void setModelEncoding( String modelEncoding ) | |
183 | { | |
184 | 0 | this.modelEncoding = modelEncoding; |
185 | 0 | } |
186 | ||
187 | /** | |
188 | * @return the current encoding used when reading/writing this model. | |
189 | */ | |
190 | public String getModelEncoding() | |
191 | { | |
192 | 0 | return modelEncoding; |
193 | } | |
194 | } |