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