Rev 136 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
78 | soliveira | 1 | package org.kawai.model; |
2 | |||
80 | soliveira | 3 | import java.text.SimpleDateFormat; |
79 | soliveira | 4 | import java.util.Date; |
81 | soliveira | 5 | import java.util.Locale; |
79 | soliveira | 6 | |
194 | helio.frota | 7 | /** |
8 | * Model class Revision. |
||
9 | * |
||
10 | * @author Sergio Oliveira |
||
11 | * |
||
12 | */ |
||
78 | soliveira | 13 | public class Revision { |
14 | |||
194 | helio.frota | 15 | /**Attribute constant FORMATTER of Revision. */ |
16 | private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); |
||
17 | |||
18 | /** Attribute id of Revision. */ |
||
19 | private int id; |
||
20 | /** Attribute revision of Revision. */ |
||
21 | private Integer revision; |
||
22 | /** Attribute name of Revision. */ |
||
23 | private String name; |
||
24 | /** Attribute languageId of Revision. */ |
||
25 | private int languageId; |
||
26 | /** Attribute userId of Revision. */ |
||
27 | private int userId; |
||
28 | /** Attribute user of Revision. */ |
||
29 | private User user; |
||
30 | /** Attribute currTitle of Revision. */ |
||
31 | private String currTitle; |
||
32 | /** Attribute oldTitle of Revision. */ |
||
33 | private String oldTitle; |
||
34 | /** Attribute newTitle of Revision. */ |
||
35 | private String newTitle; |
||
36 | /** Attribute oldBody of Revision. */ |
||
37 | private String oldBody; |
||
38 | /** Attribute newBody of Revision. */ |
||
39 | private String newBody; |
||
40 | /** Attribute createdOn of Revision. */ |
||
41 | private Date createdOn; |
||
42 | /** Attribute comment of Revision. */ |
||
43 | private String comment; |
||
44 | /** Attribute isSystemPage of Revision. */ |
||
45 | private boolean isSystemPage; |
||
46 | /** Attribute isFrontPage of Revision. */ |
||
47 | private boolean isFrontPage; |
||
48 | |||
49 | /** |
||
50 | * Default constructor. |
||
51 | */ |
||
52 | public Revision() { } |
||
53 | |||
54 | /** |
||
55 | * Gets the id of Revision. |
||
56 | * @return int |
||
57 | */ |
||
58 | public int getId() { |
||
59 | return id; |
||
78 | soliveira | 60 | } |
61 | |||
194 | helio.frota | 62 | /** |
63 | * Sets the id of Revision. |
||
64 | * @param s String |
||
65 | */ |
||
66 | public void setTitle(String s) { |
||
67 | this.currTitle = s; |
||
78 | soliveira | 68 | } |
69 | |||
194 | helio.frota | 70 | /** |
71 | * Gets the currTitle of Revision. |
||
72 | * @return String |
||
73 | */ |
||
74 | public String getTitle() { |
||
75 | return currTitle; |
||
78 | soliveira | 76 | } |
77 | |||
194 | helio.frota | 78 | /** |
79 | * Sets if isFrontPage of Revision. |
||
80 | * @param b boolean |
||
81 | */ |
||
82 | public void setFrontPage(boolean b) { |
||
83 | this.isFrontPage = b; |
||
78 | soliveira | 84 | } |
85 | |||
194 | helio.frota | 86 | /** |
87 | * Check if isFrontPage of Revision. |
||
88 | * @return boolean |
||
89 | */ |
||
90 | public boolean isFrontPage() { |
||
91 | return isFrontPage; |
||
78 | soliveira | 92 | } |
93 | |||
194 | helio.frota | 94 | /** |
95 | * Set if isSystemPage of Revision. |
||
96 | * @param b boolean |
||
97 | */ |
||
98 | public void setSystemPage(boolean b) { |
||
99 | this.isSystemPage = b; |
||
78 | soliveira | 100 | } |
101 | |||
194 | helio.frota | 102 | /** |
103 | * Checks if isSystemPage of Revision. |
||
104 | * @return boolean |
||
105 | */ |
||
106 | public boolean isSystemPage() { |
||
107 | return isSystemPage; |
||
78 | soliveira | 108 | } |
109 | |||
194 | helio.frota | 110 | /** |
111 | * Gets the comment of Revision. |
||
112 | * @return String |
||
113 | */ |
||
114 | public String getComment() { |
||
115 | return comment; |
||
78 | soliveira | 116 | } |
117 | |||
194 | helio.frota | 118 | /** |
119 | * Sets the comment of Revision. |
||
120 | * @param s String |
||
121 | */ |
||
122 | public void setComment(String s) { |
||
123 | this.comment = s; |
||
78 | soliveira | 124 | } |
125 | |||
194 | helio.frota | 126 | /** |
127 | * Sets the id of Revision. |
||
128 | * @param id int |
||
129 | */ |
||
130 | public void setId(int id) { |
||
131 | this.id = id; |
||
78 | soliveira | 132 | } |
133 | |||
194 | helio.frota | 134 | /** |
135 | * Gets the revision of Revision. |
||
136 | * @return Integer |
||
137 | */ |
||
138 | public Integer getRevision() { |
||
139 | return revision; |
||
78 | soliveira | 140 | } |
141 | |||
194 | helio.frota | 142 | /** |
143 | * Sets the revision of Revision. |
||
144 | * @param revision int |
||
145 | */ |
||
146 | public void setRevision(int revision) { |
||
147 | this.revision = revision; |
||
78 | soliveira | 148 | } |
149 | |||
194 | helio.frota | 150 | /** |
151 | * Gets the name of Revision. |
||
152 | * @return String |
||
153 | */ |
||
154 | public String getName() { |
||
155 | return name; |
||
78 | soliveira | 156 | } |
157 | |||
194 | helio.frota | 158 | /** |
159 | * Sets the name of Revision. |
||
160 | * @param name String |
||
161 | */ |
||
162 | public void setName(String name) { |
||
163 | this.name = name; |
||
78 | soliveira | 164 | } |
165 | |||
194 | helio.frota | 166 | /** |
167 | * Gets the languageId of Revision. |
||
168 | * @return int |
||
169 | */ |
||
170 | public int getLanguageId() { |
||
171 | return languageId; |
||
78 | soliveira | 172 | } |
173 | |||
194 | helio.frota | 174 | /** |
175 | * Sets the languageId of Revision. |
||
176 | * @param languageId int |
||
177 | */ |
||
178 | public void setLanguageId(int languageId) { |
||
179 | this.languageId = languageId; |
||
78 | soliveira | 180 | } |
181 | |||
194 | helio.frota | 182 | /** |
183 | * Gets the userId of Revision. |
||
184 | * @return int |
||
185 | */ |
||
186 | public int getUserId() { |
||
187 | return userId; |
||
78 | soliveira | 188 | } |
189 | |||
194 | helio.frota | 190 | /** |
191 | * Sets the userId of Revision. |
||
192 | * @param userId int |
||
193 | */ |
||
194 | public void setUserId(int userId) { |
||
195 | this.userId = userId; |
||
78 | soliveira | 196 | } |
197 | |||
194 | helio.frota | 198 | /** |
199 | * Gets the user of Revision. |
||
200 | * @return user |
||
201 | */ |
||
202 | public User getUser() { |
||
203 | return user; |
||
78 | soliveira | 204 | } |
205 | |||
194 | helio.frota | 206 | /** |
207 | * Sets the user of Revision. |
||
208 | * @param user User |
||
209 | */ |
||
210 | public void setUser(User user) { |
||
211 | this.user = user; |
||
78 | soliveira | 212 | } |
79 | soliveira | 213 | |
194 | helio.frota | 214 | /** |
215 | * Gets the oldTitle of Revision. |
||
216 | * @return String |
||
217 | */ |
||
218 | public String getOldTitle() { |
||
219 | return oldTitle; |
||
79 | soliveira | 220 | } |
221 | |||
194 | helio.frota | 222 | /** |
223 | * Sets the oldTitle of Revision. |
||
224 | * @param oldTitle String |
||
225 | */ |
||
226 | public void setOldTitle(String oldTitle) { |
||
227 | this.oldTitle = oldTitle; |
||
79 | soliveira | 228 | } |
194 | helio.frota | 229 | |
230 | /** |
||
231 | * Gets the newTitle of Revision. |
||
232 | * @return String |
||
233 | */ |
||
234 | public String getNewTitle() { |
||
235 | return newTitle; |
||
236 | } |
||
237 | |||
238 | /** |
||
239 | * Sets the newTitle of Revision. |
||
240 | * @param newTitle String |
||
241 | */ |
||
242 | public void setNewTitle(String newTitle) { |
||
243 | this.newTitle = newTitle; |
||
244 | } |
||
245 | |||
246 | /** |
||
247 | * Gets the language of Revision. |
||
248 | * @return Language |
||
249 | */ |
||
250 | public Language getLanguage() { |
||
251 | return Language.fromId(languageId); |
||
252 | } |
||
253 | |||
254 | /** |
||
255 | * Gets the locale of Revision. |
||
256 | * @return Locale |
||
257 | */ |
||
258 | public Locale getLocale() { |
||
259 | return getLanguage() != null ? getLanguage().getLocale() : null; |
||
260 | } |
||
261 | |||
262 | /** |
||
263 | * Gets the lang of Revision. |
||
264 | * @return String |
||
265 | */ |
||
266 | public String getLang() { |
||
267 | return getLocale() != null ? getLocale().toString() : null; |
||
268 | } |
||
269 | |||
270 | /** |
||
271 | * Gets the oldBody of Revision. |
||
272 | * @return String |
||
273 | */ |
||
274 | public String getOldBody() { |
||
275 | return oldBody; |
||
276 | } |
||
277 | |||
278 | /** |
||
279 | * Sets the oldBody of Revision. |
||
280 | * @param oldBody String |
||
281 | */ |
||
282 | public void setOldBody(String oldBody) { |
||
283 | this.oldBody = oldBody; |
||
284 | } |
||
285 | |||
286 | /** |
||
287 | * Gets the newBody of Revision. |
||
288 | * @return String |
||
289 | */ |
||
290 | public String getNewBody() { |
||
291 | return newBody; |
||
292 | } |
||
293 | |||
294 | /** |
||
295 | * Sets the newBody of Revision. |
||
296 | * @param newBody String |
||
297 | */ |
||
298 | public void setNewBody(String newBody) { |
||
299 | this.newBody = newBody; |
||
300 | } |
||
301 | |||
302 | /** |
||
303 | * Gets the createdOn date of Revision. |
||
304 | * @return Date |
||
305 | */ |
||
306 | public Date getCreatedOn() { |
||
307 | return createdOn; |
||
308 | } |
||
309 | |||
310 | /** |
||
311 | * Gets the formatted createdOn date of Revision. |
||
312 | * @return String |
||
313 | */ |
||
314 | public String getFormattedCreatedOn() { |
||
315 | return FORMATTER.format(createdOn); |
||
316 | } |
||
317 | |||
318 | /** |
||
319 | * Sets the createdOn date of Revision. |
||
320 | * @param createdOn Date |
||
321 | */ |
||
322 | public void setCreatedOn(Date createdOn) { |
||
323 | this.createdOn = createdOn; |
||
324 | } |
||
325 | |||
326 | } |