org.restlet.gwt.data
Class Parameter

java.lang.Object
  extended by org.restlet.gwt.data.Parameter
All Implemented Interfaces:
java.lang.Comparable<Parameter>
Direct Known Subclasses:
Cookie

public class Parameter
extends java.lang.Object
implements java.lang.Comparable<Parameter>

Multi-usage parameter.

Author:
Jerome Louvel

Constructor Summary
Parameter()
          Default constructor.
Parameter(java.lang.String name, java.lang.String value)
          Preferred constructor.
 
Method Summary
 int compareTo(Parameter o)
          Compares this object with the specified object for order.
 java.lang.String encode(CharacterSet characterSet)
          Encodes the parameter using the standard URI encoding mechanism.
 void encode(java.lang.StringBuilder buffer, CharacterSet characterSet)
          Encodes the parameter and appends the result to the given buffer.
 boolean equals(java.lang.Object obj)
          
 java.lang.String getName()
          Returns the name of this parameter.
 java.lang.String getValue()
          Returns the value.
 int hashCode()
          
 void setName(java.lang.String name)
          Sets the name.
 void setValue(java.lang.String value)
          Sets the value.
 java.lang.String toString()
          Returns a string with the name and value of the parameter.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter()
Default constructor.


Parameter

public Parameter(java.lang.String name,
                 java.lang.String value)
Preferred constructor.

Parameters:
name - The name.
value - The value.
Method Detail

compareTo

public int compareTo(Parameter o)
Compares this object with the specified object for order.

Specified by:
compareTo in interface java.lang.Comparable<Parameter>
Parameters:
o - The object to be compared.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

encode

public java.lang.String encode(CharacterSet characterSet)
                        throws java.lang.Exception
Encodes the parameter using the standard URI encoding mechanism.

Parameters:
characterSet - The supported character encoding.
Returns:
The encoded string.
Throws:
java.io.IOException
java.lang.Exception

encode

public void encode(java.lang.StringBuilder buffer,
                   CharacterSet characterSet)
            throws java.lang.Exception
Encodes the parameter and appends the result to the given buffer. Uses the standard URI encoding mechanism.

Parameters:
buffer - The buffer to append.
characterSet - The supported character encoding
Throws:
java.io.IOException
java.lang.Exception

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

getName

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

Returns:
The name of this parameter.

getValue

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

Returns:
The value.

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - The name.

setValue

public void setValue(java.lang.String value)
Sets the value.

Parameters:
value - The value.

toString

public java.lang.String toString()
Returns a string with the name and value of the parameter.

Overrides:
toString in class java.lang.Object
Returns:
A string with the name and value of the parameter.


Copyright © 2005-2008 Noelios Technologies.