public class PortletParametersMap extends LinkedHashMap<String,String[]>
ActionResponse
and
PortletURL
.
The constraints are:
If any of the constraints above are violated, an IllegalArgumentException
is thrown when the parameter is tried to be set.
The String array values are cloned, so changes in the given array instance will not affect the value stored in the map.
For this behavior to be applied, the methods setParameter(String, String)
,
setParameter(String, String[])
or setParameters(Map)
must
be used. The Map
methods do not behave as stated above.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
PortletParametersMap() |
PortletParametersMap(int initialCapacity) |
Modifier and Type | Method and Description |
---|---|
PortletParametersMap |
clone()
Clones this
PortletParametersMap , also cloning the arrays in the
values to prevent the clone from affecting the original. |
void |
setParameter(String key,
String value)
Sets a String parameter.
|
void |
setParameter(String key,
String[] values)
Sets a String array parameter.
|
void |
setParameters(Map<String,String[]> parameters)
Sets a parameter map.
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
public PortletParametersMap()
public PortletParametersMap(int initialCapacity)
public void setParameter(String key, String value)
This method replaces all parameters with the given key.
key
- key of the parametervalue
- value of the parameterIllegalArgumentException
- if key or value are
null
.public void setParameter(String key, String[] values)
This method replaces all parameters with the given key.
key
- key of the parametervalues
- values of the parameterIllegalArgumentException
- if key or value are
null
.public void setParameters(Map<String,String[]> parameters)
All previously set render parameters are cleared.
parameters
- Map containing the parameters. The keys in the
parameter map must be of type String. The values in the
parameter map must be of type String array (String[]
).IllegalArgumentException
- if parameters is
null
, if any of the key/values in the Map
are null
, if any of the keys is not a
String, or if any of the values is not a String array.public PortletParametersMap clone()
PortletParametersMap
, also cloning the arrays in the
values to prevent the clone from affecting the original.
The keys and the array elements are not cloned since they are immutable.
clone
in class HashMap<String,String[]>
PortletParametersMap
.LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.