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 DocumentTOC
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
37
38
39
40
41
42
43
44 private int depth = 0;
45
46
47
48
49 private java.util.List<DocumentTOCItem> items;
50
51
52
53
54
55
56
57
58
59
60
61 public void addItem( DocumentTOCItem documentTOCItem )
62 {
63 getItems().add( documentTOCItem );
64 }
65
66
67
68
69
70
71
72 public boolean equals( Object other )
73 {
74 if ( this == other )
75 {
76 return true;
77 }
78
79 if ( !( other instanceof DocumentTOC ) )
80 {
81 return false;
82 }
83
84 DocumentTOC that = (DocumentTOC) other;
85 boolean result = true;
86
87 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
88 result = result && depth == that.depth;
89 result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) );
90
91 return result;
92 }
93
94
95
96
97
98
99
100
101
102
103
104
105
106 public int getDepth()
107 {
108 return this.depth;
109 }
110
111
112
113
114
115
116 public java.util.List<DocumentTOCItem> getItems()
117 {
118 if ( this.items == null )
119 {
120 this.items = new java.util.ArrayList<DocumentTOCItem>();
121 }
122
123 return this.items;
124 }
125
126
127
128
129
130
131 public String getName()
132 {
133 return this.name;
134 }
135
136
137
138
139
140
141 public int hashCode()
142 {
143 int result = 17;
144
145 result = 37 * result + ( name != null ? name.hashCode() : 0 );
146 result = 37 * result + (int) depth;
147 result = 37 * result + ( items != null ? items.hashCode() : 0 );
148
149 return result;
150 }
151
152
153
154
155
156
157 public void removeItem( DocumentTOCItem documentTOCItem )
158 {
159 getItems().remove( documentTOCItem );
160 }
161
162
163
164
165
166
167
168
169
170
171
172
173
174 public void setDepth( int depth )
175 {
176 this.depth = depth;
177 }
178
179
180
181
182
183
184 public void setItems( java.util.List<DocumentTOCItem> items )
185 {
186 this.items = items;
187 }
188
189
190
191
192
193
194 public void setName( String name )
195 {
196 this.name = name;
197 }
198
199
200
201
202
203
204 public java.lang.String toString()
205 {
206 StringBuilder buf = new StringBuilder( 128 );
207
208 buf.append( "name = '" );
209 buf.append( getName() );
210 buf.append( "'" );
211 buf.append( "\n" );
212 buf.append( "depth = '" );
213 buf.append( getDepth() );
214 buf.append( "'" );
215 buf.append( "\n" );
216 buf.append( "items = '" );
217 buf.append( getItems() );
218 buf.append( "'" );
219
220 return buf.toString();
221 }
222
223 }