Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
RevisionInfo | 32 | 7 | 0% | 6 | 4 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package com.xpn.xwiki.api; | |
21 | ||
22 | import java.util.Date; | |
23 | ||
24 | import com.xpn.xwiki.XWikiContext; | |
25 | import com.xpn.xwiki.doc.rcs.XWikiRCSNodeInfo; | |
26 | ||
27 | /** | |
28 | * API object for get info about some version of Document. | |
29 | * | |
30 | * @version $Id: 796cf0181bb79688898fd4285d6b0fa771729a1d $ | |
31 | */ | |
32 | public class RevisionInfo extends Api | |
33 | { | |
34 | /** used for get all information. */ | |
35 | private XWikiRCSNodeInfo nodeInfo; | |
36 | ||
37 | /** | |
38 | * @param nodeInfo - from that nodeinfo all information is getting | |
39 | * @param context - needed for {@link Api} | |
40 | */ | |
41 | 11 | public RevisionInfo(XWikiRCSNodeInfo nodeInfo, XWikiContext context) |
42 | { | |
43 | 11 | super(context); |
44 | 11 | this.nodeInfo = nodeInfo; |
45 | } | |
46 | ||
47 | /** @return version of this revision */ | |
48 | 0 | public String getVersion() |
49 | { | |
50 | 0 | return this.nodeInfo.getId().getVersion().toString(); |
51 | } | |
52 | ||
53 | /** @return date of this revision */ | |
54 | 11 | public Date getDate() |
55 | { | |
56 | 11 | return this.nodeInfo.getDate(); |
57 | } | |
58 | ||
59 | /** @return author of this revision */ | |
60 | 11 | public String getAuthor() |
61 | { | |
62 | 11 | return this.nodeInfo.getAuthor(); |
63 | } | |
64 | ||
65 | /** @return revision comment */ | |
66 | 11 | public String getComment() |
67 | { | |
68 | 11 | return this.nodeInfo.getComment(); |
69 | } | |
70 | ||
71 | /** @return is revision is minor */ | |
72 | 0 | public boolean isMinorEdit() |
73 | { | |
74 | 0 | return this.nodeInfo.isMinorEdit(); |
75 | } | |
76 | } |