Class ParametersStateString

java.lang.Object
org.gatein.pc.api.StateString
org.gatein.pc.api.ParametersStateString
All Implemented Interfaces:
Serializable

public class ParametersStateString extends StateString implements Serializable
A set of parameters.
Version:
$Revision: 6549 $
Author:
Julien Viet
See Also:
  • Constructor Details

    • ParametersStateString

      protected ParametersStateString(DataInputStream in) throws IOException
      Throws:
      IOException
    • ParametersStateString

      protected ParametersStateString(String opaqueValue)
    • ParametersStateString

      protected ParametersStateString()
      Creates an empty parameter set.
  • Method Details

    • create

      public static ParametersStateString create()
    • create

      public static ParametersStateString create(Map<String,String[]> parameters)
    • create

      public static ParametersStateString create(StateString stateString) throws IllegalArgumentException
      Create a parameters state string. It assumes that the argument is either an instance of ParametersStateString or that it is the string encoded value of a ParametersStateString.
      Parameters:
      stateString - the state string
      Returns:
      a new parameter state string
      Throws:
      IllegalArgumentException - if the state string is opaque and does not represent parameters
    • getValue

      public String getValue(String name) throws IllegalArgumentException
      Return the parameter value or null if it does not exist.
      Parameters:
      name - the parameter name
      Returns:
      the parameter value or null if it does not exist
      Throws:
      IllegalArgumentException - if the name is null
    • getValues

      public String[] getValues(String name) throws IllegalArgumentException
      Return the parameter values or null if it does not exist.
      Parameters:
      name - the value to get
      Returns:
      the parameter values
      Throws:
      IllegalArgumentException - if the name is null
    • clear

      public void clear()
      Clear all the parameters.
    • replace

      public void replace(Map<String,String[]> map)
      Replace all the parameters.
      Parameters:
      map - the map to replace
      Throws:
      IllegalArgumentException - if the map is not valid
    • setValue

      public void setValue(String name, String value)
      Set the a parameter value.
      Parameters:
      name - the parameter name
      value - the parameter value
      Throws:
      IllegalArgumentException - if the name or the value is null
    • setValues

      public void setValues(String name, String[] values)
      Set the parameter values. This method does not make a defensive copy of the values.
      Parameters:
      name - the parameter name
      values - the parameter values
      Throws:
      IllegalArgumentException - if the name is null
    • remove

      public void remove(String name)
      Remove a parameter.
      Parameters:
      name - the parameter name
      Throws:
      IllegalArgumentException - if the name is null
    • getSize

      public int getSize()
      Return the size.
      Returns:
      the size
    • getParameters

      public Map<String,String[]> getParameters()
      Return the underlying parameter object.
      Returns:
      the parameter object
    • getStringValue

      public String getStringValue()
      Retrieves the opaque version associated with this navigational state.
      Specified by:
      getStringValue in class StateString
      Returns:
      a URL-safe String representation of this navigational state.
    • writeTo

      public void writeTo(DataOutputStream out) throws IOException
      Specified by:
      writeTo in class StateString
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object