Update license to GPLv3, fix header comments
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / ReceivedBookmarkFeed.java
1 /*
2  * jFCPlib - ReceivedBookmarkFeed.java - Copyright © 2009–2016 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 3 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, see <http://www.gnu.org/licenses/>.
16  */
17
18 package net.pterodactylus.fcp;
19
20 /**
21  * Implementation of the “ReceivedBookmarkFeed” FCP message. This message
22  * notifies an FCP client that an update for a bookmark has been found.
23  *
24  * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
25  */
26 public class ReceivedBookmarkFeed extends BaseMessage {
27
28         /**
29          * Creates a new “ReceivedBookmarkFeed” message.
30          *
31          * @param fcpMessage
32          *            The FCP message to get the fields from
33          */
34         public ReceivedBookmarkFeed(FcpMessage fcpMessage) {
35                 super(fcpMessage);
36         }
37
38         /**
39          * Returns the name of the bookmark.
40          *
41          * @return The bookmark’s name
42          */
43         public String getBookmarkName() {
44                 return getField("Name");
45         }
46
47         /**
48          * Returns the URI of the updated bookmark.
49          *
50          * @return The bookmark’s URI
51          */
52         public String getURI() {
53                 return getField("URI");
54         }
55
56         /**
57          * Returns whether the bookmark has an active link image.
58          *
59          * @return {@code true} if the bookmark has an active link image,
60          *         {@code false} otherwise
61          */
62         public boolean hasActiveLink() {
63                 return Boolean.parseBoolean(getField("HasAnActiveLink"));
64         }
65
66         /**
67          * Returns the description of the bookmark. Note that the description may
68          * be {@code null} and if it is not, it is base64-encoded!
69          *
70          * @return The bookmark’s description, or {@code null} if the bookmark has
71          *         no description
72          */
73         public String getDescription() {
74                 return getField("Description");
75         }
76
77 }