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