1
2
3
4
5
6 package org.apache.maven.plugins.javadoc.options;
7
8
9
10
11
12
13 @SuppressWarnings( "all" )
14 public class Tag
15 implements java.io.Serializable
16 {
17
18
19
20
21
22
23
24
25 private String name;
26
27
28
29
30 private String head;
31
32
33
34
35 private String placement;
36
37
38
39
40
41
42
43
44
45
46
47
48 public boolean equals( Object other )
49 {
50 if ( this == other )
51 {
52 return true;
53 }
54
55 if ( !( other instanceof Tag ) )
56 {
57 return false;
58 }
59
60 Tag that = (Tag) other;
61 boolean result = true;
62
63 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
64 result = result && ( getHead() == null ? that.getHead() == null : getHead().equals( that.getHead() ) );
65 result = result && ( getPlacement() == null ? that.getPlacement() == null : getPlacement().equals( that.getPlacement() ) );
66
67 return result;
68 }
69
70
71
72
73
74
75 public String getHead()
76 {
77 return this.head;
78 }
79
80
81
82
83
84
85 public String getName()
86 {
87 return this.name;
88 }
89
90
91
92
93
94
95 public String getPlacement()
96 {
97 return this.placement;
98 }
99
100
101
102
103
104
105 public int hashCode()
106 {
107 int result = 17;
108
109 result = 37 * result + ( name != null ? name.hashCode() : 0 );
110 result = 37 * result + ( head != null ? head.hashCode() : 0 );
111 result = 37 * result + ( placement != null ? placement.hashCode() : 0 );
112
113 return result;
114 }
115
116
117
118
119
120
121 public void setHead( String head )
122 {
123 this.head = head;
124 }
125
126
127
128
129
130
131 public void setName( String name )
132 {
133 this.name = name;
134 }
135
136
137
138
139
140
141 public java.lang.String toString()
142 {
143 StringBuilder buf = new StringBuilder( 128 );
144
145 buf.append( "name = '" );
146 buf.append( getName() );
147 buf.append( "'" );
148 buf.append( "\n" );
149 buf.append( "head = '" );
150 buf.append( getHead() );
151 buf.append( "'" );
152 buf.append( "\n" );
153 buf.append( "placement = '" );
154 buf.append( getPlacement() );
155 buf.append( "'" );
156
157 return buf.toString();
158 }
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177 public void setPlacement(String placement)
178 throws IllegalArgumentException
179 {
180 char[] chars = placement.toCharArray();
181 for ( int i = 0; i < chars.length; i++ )
182 {
183 switch ( chars[i] )
184 {
185 case 'X':
186 case 'a':
187 case 'o':
188 case 'p':
189 case 't':
190 case 'c':
191 case 'm':
192 case 'f':
193 break;
194 default:
195 throw new IllegalArgumentException( "Placement should be a combination of the letters 'Xaoptcmf'." );
196 }
197 }
198 this.placement = placement;
199 }
200
201
202 }