rabbit.http
Class Header

java.lang.Object
  extended by rabbit.http.Header
All Implemented Interfaces:
Storable

public class Header
extends Object
implements Storable

This class holds a single header value, that is a "type: some text"

Author:
Robert Olofsson

Field Summary
static String CRLF
          The String consisting of \r and \n
 
Constructor Summary
Header()
          Used for externalization.
Header(String type, String value)
          Create a new header
 
Method Summary
 void append(String s)
          Update the value by appending the given string to it.
 boolean equals(Object o)
           
 String getType()
          Get the type of this header.
 String getValue()
          Get the value of this header.
 int hashCode()
           
 void read(DataInput in)
          Fill in this object with data from the given input.
 void setValue(String newValue)
          Set the value of this header to the new value given.
 void write(DataOutput out)
          Write this object to the given output.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRLF

public static final String CRLF
The String consisting of \r and \n

See Also:
Constant Field Values
Constructor Detail

Header

public Header()
Used for externalization.


Header

public Header(String type,
              String value)
Create a new header

Parameters:
type - the type of this header
value - the actual value
Method Detail

getType

public String getType()
Get the type of this header.

Returns:
the type of this header

getValue

public String getValue()
Get the value of this header.

Returns:
the value of this header

setValue

public void setValue(String newValue)
Set the value of this header to the new value given.

Parameters:
newValue - the new value

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

append

public void append(String s)
Update the value by appending the given string to it.

Parameters:
s - the String to append to the current value

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Storable
Write this object to the given output.

Specified by:
write in interface Storable
Parameters:
out - the output to write to
Throws:
IOException - if writing fails

read

public void read(DataInput in)
          throws IOException
Description copied from interface: Storable
Fill in this object with data from the given input.

Specified by:
read in interface Storable
Parameters:
in - the input to read from
Throws:
IOException - if reading fails