m.c.m.proxyma.resource
Class ProxymaHttpHeader

java.lang.Object
  extended by m.c.m.proxyma.resource.ProxymaHttpHeader
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ProxymaHttpHeader
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This class rappresents a single Http Header that can be sent to a Client.
It is designed to be "rewritable", so you can get it and update its value as much as needed.

NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.

Version:
$Id: ProxymaHttpHeader.java 138 2010-06-20 13:53:32Z marcolinuz $
Author:
Marco Casavecchia Morganti (marcolinuz) [marcolinuz-at-gmail.com]
See Also:
Serialized Form

Constructor Summary
ProxymaHttpHeader(java.lang.String name, java.lang.String value)
          The default constructor for this class.
 
Method Summary
 java.lang.Object clone()
          This method clone the current header.
 java.lang.String getName()
          Returns the name of the header.
 java.lang.String getValue()
          Returns the value of the header
 void setValue(java.lang.String newValue)
          Sets a new value for the header.
 java.lang.String toString()
          This overrides the Object's toString method.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProxymaHttpHeader

public ProxymaHttpHeader(java.lang.String name,
                         java.lang.String value)
                  throws org.apache.commons.lang.NullArgumentException
The default constructor for this class.
It doesnt accept a null value as name.
NOTE: It accepts a null value as "value" but will store an empty string.

Parameters:
name - the header name
value - the value of the header
Throws:
org.apache.commons.lang.NullArgumentException - if the name is null
Method Detail

getName

public java.lang.String getName()
Returns the name of the header.

Returns:
the header name.

getValue

public java.lang.String getValue()
Returns the value of the header

Returns:
the header value

setValue

public void setValue(java.lang.String newValue)
Sets a new value for the header.

Parameters:
newValue - the new value to set

toString

public java.lang.String toString()
This overrides the Object's toString method.
It's done to make the Header able to auto serialize itself into a string ready to be sent to the client.

Overrides:
toString in class java.lang.Object
Returns:

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
This method clone the current header.

Overrides:
clone in class java.lang.Object
Returns:
a new and separate instance of the object.
Throws:
java.lang.CloneNotSupportedException - if the clone operation is not supported


Copyright © 2010. All Rights Reserved.