1
2
3
4
5
6 package org.apache.maven.doxia.site;
7
8
9
10
11
12
13 @SuppressWarnings( "all" )
14 public class Menu
15 implements java.io.Serializable, java.lang.Cloneable
16 {
17
18
19
20
21
22
23
24
25 private String name;
26
27
28
29
30
31
32
33 private String inherit;
34
35
36
37
38
39
40
41
42
43
44 private boolean inheritAsRef = false;
45
46
47
48
49
50
51
52
53
54 private String ref;
55
56
57
58
59 private Image image;
60
61
62
63
64 private java.util.List<MenuItem> items;
65
66
67
68
69
70
71
72
73
74
75
76 public void addItem( MenuItem menuItem )
77 {
78 getItems().add( menuItem );
79 }
80
81
82
83
84
85
86 public Menu clone()
87 {
88 try
89 {
90 Menu copy = (Menu) super.clone();
91
92 if ( this.image != null )
93 {
94 copy.image = (Image) this.image.clone();
95 }
96
97 if ( this.items != null )
98 {
99 copy.items = new java.util.ArrayList<MenuItem>();
100 for ( MenuItem item : this.items )
101 {
102 copy.items.add( ( (MenuItem) item).clone() );
103 }
104 }
105
106 return copy;
107 }
108 catch ( java.lang.Exception ex )
109 {
110 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
111 + " does not support clone()" ).initCause( ex );
112 }
113 }
114
115
116
117
118
119
120
121 public boolean equals( Object other )
122 {
123 if ( this == other )
124 {
125 return true;
126 }
127
128 if ( !( other instanceof Menu ) )
129 {
130 return false;
131 }
132
133 Menu that = (Menu) other;
134 boolean result = true;
135
136 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
137 result = result && ( getInherit() == null ? that.getInherit() == null : getInherit().equals( that.getInherit() ) );
138 result = result && ( getRef() == null ? that.getRef() == null : getRef().equals( that.getRef() ) );
139 result = result && ( getImage() == null ? that.getImage() == null : getImage().equals( that.getImage() ) );
140 result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) );
141
142 return result;
143 }
144
145
146
147
148
149
150 public Image getImage()
151 {
152 return this.image;
153 }
154
155
156
157
158
159
160
161 public String getInherit()
162 {
163 return this.inherit;
164 }
165
166
167
168
169
170
171 public java.util.List<MenuItem> getItems()
172 {
173 if ( this.items == null )
174 {
175 this.items = new java.util.ArrayList<MenuItem>();
176 }
177
178 return this.items;
179 }
180
181
182
183
184
185
186 public String getName()
187 {
188 return this.name;
189 }
190
191
192
193
194
195
196
197
198
199 public String getRef()
200 {
201 return this.ref;
202 }
203
204
205
206
207
208
209 public int hashCode()
210 {
211 int result = 17;
212
213 result = 37 * result + ( name != null ? name.hashCode() : 0 );
214 result = 37 * result + ( inherit != null ? inherit.hashCode() : 0 );
215 result = 37 * result + ( ref != null ? ref.hashCode() : 0 );
216 result = 37 * result + ( image != null ? image.hashCode() : 0 );
217 result = 37 * result + ( items != null ? items.hashCode() : 0 );
218
219 return result;
220 }
221
222
223
224
225
226
227
228
229
230
231 public boolean isInheritAsRef()
232 {
233 return this.inheritAsRef;
234 }
235
236
237
238
239
240
241 public void removeItem( MenuItem menuItem )
242 {
243 getItems().remove( menuItem );
244 }
245
246
247
248
249
250
251 public void setImage( Image image )
252 {
253 this.image = image;
254 }
255
256
257
258
259
260
261
262 public void setInherit( String inherit )
263 {
264 this.inherit = inherit;
265 }
266
267
268
269
270
271
272
273
274
275
276 public void setInheritAsRef( boolean inheritAsRef )
277 {
278 this.inheritAsRef = inheritAsRef;
279 }
280
281
282
283
284
285
286 public void setItems( java.util.List<MenuItem> items )
287 {
288 this.items = items;
289 }
290
291
292
293
294
295
296 public void setName( String name )
297 {
298 this.name = name;
299 }
300
301
302
303
304
305
306
307
308
309 public void setRef( String ref )
310 {
311 this.ref = ref;
312 }
313
314
315
316
317
318
319 public java.lang.String toString()
320 {
321 StringBuilder buf = new StringBuilder( 128 );
322
323 buf.append( "name = '" );
324 buf.append( getName() );
325 buf.append( "'" );
326 buf.append( "\n" );
327 buf.append( "inherit = '" );
328 buf.append( getInherit() );
329 buf.append( "'" );
330 buf.append( "\n" );
331 buf.append( "ref = '" );
332 buf.append( getRef() );
333 buf.append( "'" );
334 buf.append( "\n" );
335 buf.append( "image = '" );
336 buf.append( getImage() );
337 buf.append( "'" );
338 buf.append( "\n" );
339 buf.append( "items = '" );
340 buf.append( getItems() );
341 buf.append( "'" );
342
343 return buf.toString();
344 }
345
346 }