org.restlet.data
Class Parameter

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

public class Parameter
extends Object
implements Comparable<Parameter>

Multi-usage parameter.

Author:
Jerome Louvel (contact@noelios.com)

Constructor Summary
Parameter()
          Default constructor.
Parameter(String name, String value)
          Preferred constructor.
 
Method Summary
 int compareTo(Parameter o)
          Compares this object with the specified object for order.
 void encode(Appendable buffer, CharacterSet characterSet)
          Encodes the parameter and appends the result to the given buffer.
 String encode(CharacterSet characterSet)
          Encodes the parameter using the standard URI encoding mechanism.
 boolean equals(Object obj)
          
 String getName()
          Returns the name of this parameter.
 String getValue()
          Returns the value.
 int hashCode()
          
 void setName(String name)
          Sets the name.
 void setValue(String value)
          Sets the value.
 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(String name,
                 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 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.

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

getName

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

Returns:
The name of this parameter.

getValue

public String getValue()
Returns the value.

Returns:
The value.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

setName

public void setName(String name)
Sets the name.

Parameters:
name - The name.

setValue

public void setValue(String value)
Sets the value.

Parameters:
value - The value.

toString

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

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

encode

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

Parameters:
characterSet - The supported character encoding.
Returns:
The encoded string.
Throws:
IOException

encode

public void encode(Appendable buffer,
                   CharacterSet characterSet)
            throws IOException
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:
IOException


Copyright © 2005-2007 Noelios Technologies.