add UnknownNodeIdentifier
[jSite2.git] / src / net / pterodactylus / util / fcp / BaseMessage.java
1 /**
2  * © 2008 INA Service GmbH
3  */
4 package net.pterodactylus.util.fcp;
5
6 /**
7  * A basic message abstraction that wraps a received FCP message.
8  * 
9  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
10  * @version $Id$
11  */
12 public class BaseMessage {
13
14         /** The received message, wrapped here. */
15         private final FcpMessage receivedMessage;
16
17         /**
18          * Creates a new base message that wraps the given message.
19          * 
20          * @param receivedMessage
21          *            The FCP message that was received
22          */
23         BaseMessage(FcpMessage receivedMessage) {
24                 this.receivedMessage = receivedMessage;
25         }
26
27         /**
28          * Returns the name of the message.
29          * 
30          * @return The name of the message
31          */
32         public String getName() {
33                 return receivedMessage.getName();
34         }
35
36         /**
37          * Returns the content of the field.
38          * 
39          * @param field
40          *            The name of the field
41          * @return The content of the field, or <code>null</code> if there is no
42          *         such field
43          */
44         public String getField(String field) {
45                 return receivedMessage.getField(field);
46         }
47
48 }