Interface MutablePortletParameters
-
- All Superinterfaces:
Mutable,PortletParameters
- All Known Subinterfaces:
MutableActionParameters,MutableRenderParameters,MutableResourceParameters
- All Known Implementing Classes:
MutableActionParametersWrapper,MutablePortletParametersWrapper,MutableRenderParametersWrapper,MutableResourceParametersWrapper
public interface MutablePortletParameters extends PortletParameters, Mutable
TheMutablePortletParametersprovides methods that allow setting parameters to define a potential future render state.RenderStateprovides a description of the render state.PortletParametersprovides a description of the parameter concept.- Since:
- 3.0
- See Also:
RenderState,PortletParameters,MutableRenderState
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MutablePortletParametersadd(PortletParameters params)Adds the parameters from the inputPortletParametersobject if they are not already present.voidclear()Clears all parameters.Set<String>getNames()Returns aSetofStringobjects containing the names of the parameters contained in this object.booleanremoveParameter(String name)Removes the given public or private parameter.MutablePortletParametersset(PortletParameters params)Makes the public and private parameters identical to those of the input PortletParameters object.StringsetValue(String name, String value)Sets a String parameter.String[]setValues(String name, String... values)Sets a multivalued String parameter.
-
-
-
Method Detail
-
getNames
Set<String> getNames()
Returns aSetofStringobjects containing the names of the parameters contained in this object.A parameter cannot be added through use of the set. However, removing a parameter from the set will remove the underlying parameter.
Only parameter names targeted to the current portlet are returned.
- Specified by:
getNamesin interfacePortletParameters- Returns:
- a
SetofStringobjects, eachStringcontaining the name of a parameter; or an emptySetif the MutablePortletParameters object has no parameters.
-
setValue
String setValue(String name, String value)
Sets a String parameter.If the parameter already exists, this method replaces all existing values with the new value.
A parameter value of
nullis valid.To remove a parameter, use
removeParameter(String).- Parameters:
name- the parameter namevalue- the parameter value- Returns:
- The previous parameter value, or
nullif there was no previous value. - Throws:
IllegalArgumentException- if name isnull.
-
setValues
String[] setValues(String name, String... values)
Sets a multivalued String parameter.If the parameter already exists, this method replaces all existing values with the new value array.
An input value of null or an empty array is valid. These values will be preserved when reading the parameter through
PortletParameters.getValues(String), but will be mapped to the valuenullwhen the parameter is read throughPortletParameters.getValue(String).A parameter value of
nullwithin the array is valid.To remove a parameter, use
removeParameter(String).- Parameters:
name- the parameter namevalues- An array of parameter values- Returns:
- The previous parameter value array, or
nullif there was no previous value. - Throws:
IllegalArgumentException- if name isnull
-
removeParameter
boolean removeParameter(String name)
Removes the given public or private parameter. All values associated with the name are removed.- Parameters:
name- the parameter name- Returns:
trueif the parameter name was present.- Throws:
IllegalArgumentException- if name isnull.
-
set
MutablePortletParameters set(PortletParameters params)
Makes the public and private parameters identical to those of the input PortletParameters object.The parameters are copied so that after the operation completes, there is no linkage to the input object.
- Parameters:
params- - input portlet parameters- Returns:
- MutablePortletParameters object containing the previous values
-
add
MutablePortletParameters add(PortletParameters params)
Adds the parameters from the inputPortletParametersobject if they are not already present. If a parameter from the input object is already present, its value will be updated with the input value.The parameters are copied so that after the operation completes, there is no linkage to the input object.
- Parameters:
params- - input portlet parameters- Returns:
- MutablePortletParameters object containing the previous values
-
clear
void clear()
Clears all parameters.
-
-