Class MutablePortletParametersWrapper
- java.lang.Object
-
- jakarta.portlet.filter.PortletParametersWrapper
-
- jakarta.portlet.filter.MutablePortletParametersWrapper
-
- All Implemented Interfaces:
Mutable,MutablePortletParameters,PortletParameters
- Direct Known Subclasses:
MutableActionParametersWrapper,MutableRenderParametersWrapper,MutableResourceParametersWrapper
public class MutablePortletParametersWrapper extends PortletParametersWrapper implements MutablePortletParameters, Mutable
TheMutablePortletParametersWrapperprovides a convenient implementation of theMutablePortletParametersinterface that can be subclassed by developers. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.- Since:
- 3.0
-
-
Field Summary
-
Fields inherited from class jakarta.portlet.filter.PortletParametersWrapper
wrapped
-
-
Constructor Summary
Constructors Constructor Description MutablePortletParametersWrapper(MutablePortletParameters wrapped)
-
Method Summary
All Methods Instance Methods Concrete 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.MutablePortletParametersgetWrapped()Gets the wrapped 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.voidsetWrapped(MutablePortletParameters wrapped)Sets the wrapped object.-
Methods inherited from class jakarta.portlet.filter.PortletParametersWrapper
clone, getNames, getValue, getValues, isEmpty, setWrapped, size
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jakarta.portlet.MutablePortletParameters
getNames
-
-
-
-
Constructor Detail
-
MutablePortletParametersWrapper
public MutablePortletParametersWrapper(MutablePortletParameters wrapped)
- Parameters:
wrapped- the wrapped object to set.- Throws:
IllegalArgumentException- if the MutablePortletParameters is null.
-
-
Method Detail
-
getWrapped
public MutablePortletParameters getWrapped()
Gets the wrapped object.- Overrides:
getWrappedin classPortletParametersWrapper- Returns:
- the wrapped object.
-
setWrapped
public void setWrapped(MutablePortletParameters wrapped)
Sets the wrapped object.- Parameters:
wrapped- the wrapped object to set.- Throws:
IllegalArgumentException- if the MutablePortletParameters is null.
-
setValue
public String setValue(String name, String value)
Description copied from interface:MutablePortletParametersSets 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
MutablePortletParameters.removeParameter(String).- Specified by:
setValuein interfaceMutablePortletParameters- Parameters:
name- the parameter namevalue- the parameter value- Returns:
- The previous parameter value, or
nullif there was no previous value.
-
setValues
public String[] setValues(String name, String... values)
Description copied from interface:MutablePortletParametersSets 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
MutablePortletParameters.removeParameter(String).- Specified by:
setValuesin interfaceMutablePortletParameters- Parameters:
name- the parameter namevalues- An array of parameter values- Returns:
- The previous parameter value array, or
nullif there was no previous value.
-
removeParameter
public boolean removeParameter(String name)
Description copied from interface:MutablePortletParametersRemoves the given public or private parameter. All values associated with the name are removed.- Specified by:
removeParameterin interfaceMutablePortletParameters- Parameters:
name- the parameter name- Returns:
trueif the parameter name was present.
-
set
public MutablePortletParameters set(PortletParameters params)
Description copied from interface:MutablePortletParametersMakes 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.
- Specified by:
setin interfaceMutablePortletParameters- Parameters:
params- - input portlet parameters- Returns:
- MutablePortletParameters object containing the previous values
-
add
public MutablePortletParameters add(PortletParameters params)
Description copied from interface:MutablePortletParametersAdds 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.
- Specified by:
addin interfaceMutablePortletParameters- Parameters:
params- - input portlet parameters- Returns:
- MutablePortletParameters object containing the previous values
-
clear
public void clear()
Description copied from interface:MutablePortletParametersClears all parameters.- Specified by:
clearin interfaceMutablePortletParameters
-
-