Formatting fixes.
[jFCPlib.git] / src / net / pterodactylus / fcp / FcpMessage.java
index ff65a98..a2ac894 100644 (file)
@@ -32,9 +32,8 @@ import java.util.Map.Entry;
  * An FCP message. FCP messages consist of a name, an arbitrary amount of
  * “fields” (i.e. key-value pairs), a message end marker, and optional payload
  * data that follows the marker.
- *
+ * 
  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
- * @version $Id$
  */
 public class FcpMessage implements Iterable<String> {
 
@@ -52,7 +51,7 @@ public class FcpMessage implements Iterable<String> {
 
        /**
         * Creates a new FCP message with the given name.
-        *
+        * 
         * @param name
         *            The name of the FCP message
         */
@@ -64,7 +63,7 @@ public class FcpMessage implements Iterable<String> {
         * Creates a new FCP message with the given name and the given payload input
         * stream. The payload input stream is not read until the message is sent to
         * the node using {@link FcpConnection#sendMessage(FcpMessage)}.
-        *
+        * 
         * @param name
         *            The name of the message
         * @param payloadInputStream
@@ -77,7 +76,7 @@ public class FcpMessage implements Iterable<String> {
 
        /**
         * Returns the name of the message.
-        *
+        * 
         * @return The name of the message
         */
        public String getName() {
@@ -86,11 +85,11 @@ public class FcpMessage implements Iterable<String> {
 
        /**
         * Checks whether this message has a field with the given name.
-        *
+        * 
         * @param field
         *            The name of the field to check for
-        * @return <code>true</code> if the message has a field with the given
-        *         name, <code>false</code> otherwise
+        * @return <code>true</code> if the message has a field with the given name,
+        *         <code>false</code> otherwise
         */
        public boolean hasField(String field) {
                return fields.containsKey(field);
@@ -99,7 +98,7 @@ public class FcpMessage implements Iterable<String> {
        /**
         * Sets the field with the given name to the given value. If the field
         * already exists in this message it is overwritten.
-        *
+        * 
         * @param field
         *            The name of the field
         * @param value
@@ -114,11 +113,11 @@ public class FcpMessage implements Iterable<String> {
 
        /**
         * Returns the value of the given field.
-        *
+        * 
         * @param field
         *            The name of the field
-        * @return The value of the field, or <code>null</code> if there is no
-        *         such field
+        * @return The value of the field, or <code>null</code> if there is no such
+        *         field
         */
        public String getField(String field) {
                return fields.get(field);
@@ -126,7 +125,7 @@ public class FcpMessage implements Iterable<String> {
 
        /**
         * Returns all fields of this message.
-        *
+        * 
         * @return All fields of this message
         */
        public Map<String, String> getFields() {
@@ -142,7 +141,7 @@ public class FcpMessage implements Iterable<String> {
 
        /**
         * Sets the payload input stream of the message.
-        *
+        * 
         * @param payloadInputStream
         *            The payload input stream
         */
@@ -152,11 +151,11 @@ public class FcpMessage implements Iterable<String> {
 
        /**
         * Writes this message to the given output stream. If the message has a
-        * payload (i.e. {@link #payloadInputStream} is not <code>null</code>)
-        * the payload is written to the given output stream after the message as
-        * well. That means that this method can only be called once because on the
-        * second invocation the payload input stream could not be read (again).
-        *
+        * payload (i.e. {@link #payloadInputStream} is not <code>null</code>) the
+        * payload is written to the given output stream after the message as well.
+        * That means that this method can only be called once because on the second
+        * invocation the payload input stream could not be read (again).
+        * 
         * @param outputStream
         *            The output stream to write the message to
         * @throws IOException
@@ -164,7 +163,7 @@ public class FcpMessage implements Iterable<String> {
         */
        public void write(OutputStream outputStream) throws IOException {
                writeLine(outputStream, name);
-               for (Entry<String, String> fieldEntry: fields.entrySet()) {
+               for (Entry<String, String> fieldEntry : fields.entrySet()) {
                        writeLine(outputStream, fieldEntry.getKey() + "=" + fieldEntry.getValue());
                }
                writeLine(outputStream, "EndMessage");
@@ -182,7 +181,7 @@ public class FcpMessage implements Iterable<String> {
        /**
         * Writes the given line (followed by {@link #LINEFEED} to the given output
         * stream, using UTF-8 as encoding.
-        *
+        * 
         * @param outputStream
         *            The output stream to write to
         * @param line