2 * © 2008 INA Service GmbH
4 package net.pterodactylus.util.fcp.message;
6 import net.pterodactylus.util.fcp.FcpMessage;
9 * The “PeerNote” message contains a private note that has been entered for a
12 * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
15 public class PeerNote extends BaseMessage {
17 /** The type for base64 encoded peer notes. */
18 public static final int NOTE_TYPE_BASE64 = 1;
21 * Creates a “PeerNote” message that wraps the recevied message.
23 * @param receivedMessage
24 * The received message
26 public PeerNote(FcpMessage receivedMessage) {
27 super(receivedMessage);
31 * Returns the note text in whatever format is specified by
32 * {@link #getPeerNoteType()}.
34 * @return The note text
36 public String getNoteText() {
37 return getField("NoteText");
41 * Returns the type of the peer note. The type <code>1</code> means that
42 * the text of the note is base64-encoded.
44 * @return The type of the peer note
45 * @throws NumberFormatException
46 * if the field can not be parsed
48 public int getPeerNoteType() throws NumberFormatException {
49 return Integer.valueOf(getField("PeerNoteType"));