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