1
2
3
4
5
6
7
8 package org.apache.maven.doxia.document;
9
10
11
12
13
14
15 @SuppressWarnings( "all" )
16 public class DocumentTOCItem
17 implements java.io.Serializable
18 {
19
20
21
22
23
24
25
26
27
28
29 private String name;
30
31
32
33
34
35
36 private String ref;
37
38
39
40
41
42
43
44
45
46
47
48 private boolean collapse = false;
49
50
51
52
53 private java.util.List<DocumentTOCItem> items;
54
55
56
57
58
59
60
61
62
63
64
65 public void addItem( DocumentTOCItem documentTOCItem )
66 {
67 getItems().add( documentTOCItem );
68 }
69
70
71
72
73
74
75
76 public boolean equals( Object other )
77 {
78 if ( this == other )
79 {
80 return true;
81 }
82
83 if ( !( other instanceof DocumentTOCItem ) )
84 {
85 return false;
86 }
87
88 DocumentTOCItem that = (DocumentTOCItem) other;
89 boolean result = true;
90
91 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
92 result = result && ( getRef() == null ? that.getRef() == null : getRef().equals( that.getRef() ) );
93 result = result && collapse == that.collapse;
94 result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) );
95
96 return result;
97 }
98
99
100
101
102
103
104 public java.util.List<DocumentTOCItem> getItems()
105 {
106 if ( this.items == null )
107 {
108 this.items = new java.util.ArrayList<DocumentTOCItem>();
109 }
110
111 return this.items;
112 }
113
114
115
116
117
118
119 public String getName()
120 {
121 return this.name;
122 }
123
124
125
126
127
128
129 public String getRef()
130 {
131 return this.ref;
132 }
133
134
135
136
137
138
139 public int hashCode()
140 {
141 int result = 17;
142
143 result = 37 * result + ( name != null ? name.hashCode() : 0 );
144 result = 37 * result + ( ref != null ? ref.hashCode() : 0 );
145 result = 37 * result + ( collapse ? 0 : 1 );
146 result = 37 * result + ( items != null ? items.hashCode() : 0 );
147
148 return result;
149 }
150
151
152
153
154
155
156
157
158
159
160
161 public boolean isCollapse()
162 {
163 return this.collapse;
164 }
165
166
167
168
169
170
171 public void removeItem( DocumentTOCItem documentTOCItem )
172 {
173 getItems().remove( documentTOCItem );
174 }
175
176
177
178
179
180
181
182
183
184
185
186 public void setCollapse( boolean collapse )
187 {
188 this.collapse = collapse;
189 }
190
191
192
193
194
195
196 public void setItems( java.util.List<DocumentTOCItem> items )
197 {
198 this.items = items;
199 }
200
201
202
203
204
205
206 public void setName( String name )
207 {
208 this.name = name;
209 }
210
211
212
213
214
215
216 public void setRef( String ref )
217 {
218 this.ref = ref;
219 }
220
221
222
223
224
225
226 public java.lang.String toString()
227 {
228 StringBuilder buf = new StringBuilder( 128 );
229
230 buf.append( "name = '" );
231 buf.append( getName() );
232 buf.append( "'" );
233 buf.append( "\n" );
234 buf.append( "ref = '" );
235 buf.append( getRef() );
236 buf.append( "'" );
237 buf.append( "\n" );
238 buf.append( "collapse = '" );
239 buf.append( isCollapse() );
240 buf.append( "'" );
241 buf.append( "\n" );
242 buf.append( "items = '" );
243 buf.append( getItems() );
244 buf.append( "'" );
245
246 return buf.toString();
247 }
248
249 }