org.jboss.portal.portlet
Class PortletParametersStateString

java.lang.Object
  extended by org.jboss.portal.portlet.StateString
      extended by org.jboss.portal.portlet.PortletParametersStateString
All Implemented Interfaces:
java.io.Serializable

public class PortletParametersStateString
extends StateString
implements java.io.Serializable

A set of parameters.

Version:
$Revision: 6549 $
Author:
Julien Viet
See Also:
Serialized Form

Field Summary
static java.lang.String JBPNS_PREFIX
          .
 
Constructor Summary
PortletParametersStateString()
          Creates an empty parameter set.
PortletParametersStateString(PortletParameters parameterMap)
          Copy the parameter map to initialize the object state.
PortletParametersStateString(java.lang.String opaqueValue)
           
 
Method Summary
 void clear()
          Clear all the parameters.
static PortletParametersStateString create(java.util.Map parameterMap)
           
static StateString create(java.lang.String opaqueValue)
          Factory method that will create the most appropriate form.
 boolean equals(java.lang.Object o)
           
 PortletParameters getParameters()
          Return the underlying parameter object.
 int getSize()
          Return the size.
 java.lang.String getStringValue()
          Retrieves the opaque version associated with this navigational state.
 java.lang.String getValue(java.lang.String name)
          Return the parameter value or null if it does not exist.
 java.lang.String[] getValues(java.lang.String name)
          Return the parameter values or null if it does not exist.
 int hashCode()
           
 void remove(java.lang.String name)
          Remove a parameter.
 void replace(java.util.Map map)
          Replace all the parameters.
 void setValue(java.lang.String name, java.lang.String value)
          Set the a parameter value.
 void setValues(java.lang.String name, java.lang.String[] values)
          Set the parameter values.
 java.lang.String toString()
           
 
Methods inherited from class org.jboss.portal.portlet.StateString
createFrom
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

JBPNS_PREFIX

public static final java.lang.String JBPNS_PREFIX
.

See Also:
Constant Field Values
Constructor Detail

PortletParametersStateString

public PortletParametersStateString(java.lang.String opaqueValue)

PortletParametersStateString

public PortletParametersStateString()
Creates an empty parameter set.


PortletParametersStateString

public PortletParametersStateString(PortletParameters parameterMap)
Copy the parameter map to initialize the object state.

Throws:
java.lang.IllegalArgumentException - if the parameter map is null or not valid
Method Detail

create

public static StateString create(java.lang.String opaqueValue)
Factory method that will create the most appropriate form.


create

public static PortletParametersStateString create(java.util.Map parameterMap)

getValue

public java.lang.String getValue(java.lang.String name)
                          throws java.lang.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:
java.lang.IllegalArgumentException - if the name is null

getValues

public java.lang.String[] getValues(java.lang.String name)
                             throws java.lang.IllegalArgumentException
Return the parameter values or null if it does not exist.

Parameters:
name - the value to get
Returns:
the parameter values
Throws:
java.lang.IllegalArgumentException - if the name is null

clear

public void clear()
Clear all the parameters.


replace

public void replace(java.util.Map map)
Replace all the parameters.

Throws:
java.lang.IllegalArgumentException - if the map is not valid

setValue

public void setValue(java.lang.String name,
                     java.lang.String value)
Set the a parameter value.

Parameters:
name - the parameter name
value - the parameter value
Throws:
java.lang.IllegalArgumentException - if the name is null
java.lang.IllegalArgumentException - if the value is null

setValues

public void setValues(java.lang.String name,
                      java.lang.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:
java.lang.IllegalArgumentException - if the name is null

remove

public void remove(java.lang.String name)
Remove a parameter.

Throws:
java.lang.IllegalArgumentException - if the name is null

getSize

public int getSize()
Return the size.


getParameters

public PortletParameters getParameters()
Return the underlying parameter object.

Returns:
the parameter object

getStringValue

public java.lang.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.

hashCode

public int hashCode()
Specified by:
hashCode in class StateString

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in class StateString

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object