Class Parameter

java.lang.Object
org.restlet.data.Parameter
All Implemented Interfaces:
Comparable<Parameter>, NamedValue<String>

public class Parameter extends Object implements Comparable<Parameter>, NamedValue<String>
Multi-usage parameter. Note that the name and value properties are thread safe, stored in volatile members.
Author:
Jerome Louvel
  • Constructor Details

    • Parameter

      public Parameter()
      Default constructor.
    • Parameter

      public Parameter(String name, String value)
      Preferred constructor.
      Parameters:
      name - The name.
      value - The value.
  • Method Details

    • createSeries

      public Series<Parameter> createSeries()
      Creates a series that includes the current parameter as the initial entry.
      Returns:
      A series that includes the current parameter as the initial entry.
    • create

      public static Parameter create(CharSequence name, CharSequence value)
      Creates a parameter.
      Parameters:
      name - The parameter name buffer.
      value - The parameter value buffer (can be null).
      Returns:
      The created parameter.
      Throws:
      IOException
    • compareTo

      public int compareTo(Parameter o)
      Specified by:
      compareTo in interface Comparable<Parameter>
    • encode

      public void encode(Appendable buffer, CharacterSet characterSet) throws IOException
      Encodes the parameter into the target buffer.
      Parameters:
      buffer - The target buffer.
      characterSet - The character set to use.
      Throws:
      IOException
    • encode

      public String encode(CharacterSet characterSet) throws IOException
      Encodes the parameter as a string.
      Parameters:
      characterSet - The character set to use.
      Returns:
      The encoded string?
      Throws:
      IOException
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getName

      public String getName()
      Description copied from interface: NamedValue
      Returns the name of this parameter.
      Specified by:
      getName in interface NamedValue<String>
      Returns:
      The name of this parameter.
    • getValue

      public String getValue()
      Description copied from interface: NamedValue
      Returns the value.
      Specified by:
      getValue in interface NamedValue<String>
      Returns:
      The value.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setName

      public void setName(String name)
    • setValue

      public void setValue(String value)
      Description copied from interface: NamedValue
      Sets the value.
      Specified by:
      setValue in interface NamedValue<String>
      Parameters:
      value - The value.
    • toString

      public String toString()
      Overrides:
      toString in class Object