Reformat source code, new line length for comments (79), some trailing whitespace...
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / ReceivedBookmarkFeed.java
1 /*
2  * jFCPlib - ReceivedBookmarkFeed.java - Copyright © 2009 David Roden
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18
19 package net.pterodactylus.fcp;
20
21 /**
22  * Implementation of the “ReceivedBookmarkFeed” FCP message. This message
23  * notifies an FCP client that an update for a bookmark has been found.
24  *
25  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
26  */
27 public class ReceivedBookmarkFeed extends BaseMessage {
28
29         /**
30          * Creates a new “ReceivedBookmarkFeed” message.
31          *
32          * @param fcpMessage
33          *            The FCP message to get the fields from
34          */
35         public ReceivedBookmarkFeed(FcpMessage fcpMessage) {
36                 super(fcpMessage);
37         }
38
39         /**
40          * Returns the name of the bookmark.
41          *
42          * @return The bookmark’s name
43          */
44         public String getBookmarkName() {
45                 return getField("Name");
46         }
47
48         /**
49          * Returns the URI of the updated bookmark.
50          *
51          * @return The bookmark’s URI
52          */
53         public String getURI() {
54                 return getField("URI");
55         }
56
57         /**
58          * Returns whether the bookmark has an active link image.
59          *
60          * @return {@code true} if the bookmark has an active link image,
61          *         {@code false} otherwise
62          */
63         public boolean hasActiveLink() {
64                 return Boolean.parseBoolean(getField("HasAnActiveLink"));
65         }
66
67         /**
68          * Returns the description of the bookmark. Note that the description may
69          * be {@code null} and if it is not, it is base64-encoded!
70          *
71          * @return The bookmark’s description, or {@code null} if the bookmark has
72          *         no description
73          */
74         public String getDescription() {
75                 return getField("Description");
76         }
77
78 }