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