public class ReadOnlyParameters extends Object implements Parameters
Parameters.Parameters| Constructor and Description |
|---|
ReadOnlyParameters(Map<String,List<String>> data)
Creates an instance from provided multi-map.
|
ReadOnlyParameters(Parameters parameters)
Creates an instance from provided multi-map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String key,
Iterable<String> values)
Adds specified values tu association with the specified key (optional operation).
|
void |
add(String key,
String... values)
Adds specified values tu association with the specified key (optional operation).
|
void |
addAll(Parameters parameters)
Copies all of the mappings from the specified
parameters to this instance adding values to existing associations
(optional operation). |
List<String> |
all(String name)
Returns an unmodifiable List of all of the values of the given named
parameter.
|
List<String> |
computeIfAbsent(String key,
Function<String,Iterable<String>> values)
If the specified key is not already associated with a value computes new association using the given function and returns
empty
List, else returns the current value (optional operation). |
List<String> |
computeSingleIfAbsent(String key,
Function<String,String> value)
If the specified key is not already associated with a value computes new association using the given function and returns
empty
List, else returns the current value (optional operation). |
static ReadOnlyParameters |
empty()
Returns empty and immutable singleton.
|
Optional<String> |
first(String name)
Returns an
Optional containing the first value of the given
parameter (and possibly multi-valued) parameter. |
List<String> |
put(String key,
Iterable<String> values)
Associates specified values with the specified key (optional operation).
|
List<String> |
put(String key,
String... values)
Associates specified values with the specified key (optional operation).
|
void |
putAll(Parameters parameters)
Copies all of the mappings from the specified
parameters to this instance replacing values of existing associations
(optional operation). |
List<String> |
putIfAbsent(String key,
Iterable<String> values)
If the specified key is not already associated with a value associates it with the given value and returns empty
List, else returns the current value (optional operation). |
List<String> |
putIfAbsent(String key,
String... values)
If the specified key is not already associated with a value associates it with the given value and returns empty
List, else returns the current value (optional operation). |
List<String> |
remove(String key)
Removes the mapping for a key if it is present (optional operation).
|
Map<String,List<String>> |
toMap()
Returns a copy of parameters as a Map.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoUnmodifiableParameterspublic ReadOnlyParameters(Map<String,List<String>> data)
data - multi-map data to copy.public ReadOnlyParameters(Parameters parameters)
parameters - parameters to copy.public static ReadOnlyParameters empty()
public Optional<String> first(String name)
ParametersOptional containing the first value of the given
parameter (and possibly multi-valued) parameter. If the parameter is
not present, then the returned Optional is empty.first in interface Parametersname - the parameter nameOptional<V> for the first named valuepublic List<String> all(String name)
Parametersall in interface Parametersname - the parameter nameList of values with zero or greater sizepublic List<String> put(String key, String... values)
Parametersput in interface Parameterskey - key with which the specified value is to be associatedvalues - value to be associated with the specified keyList if there was no mapping for key.public List<String> put(String key, Iterable<String> values)
Parametersput in interface Parameterskey - key with which the specified value is to be associatedvalues - value to be associated with the specified key. If null then association will be removed.List if there was no mapping for key.public List<String> putIfAbsent(String key, String... values)
ParametersList, else returns the current value (optional operation).putIfAbsent in interface Parameterskey - key with which the specified value is to be associatedvalues - value to be associated with the specified keyList if there was no mapping for key.public List<String> putIfAbsent(String key, Iterable<String> values)
ParametersList, else returns the current value (optional operation).putIfAbsent in interface Parameterskey - key with which the specified value is to be associatedvalues - value to be associated with the specified keyList if there was no mapping for key.public List<String> computeIfAbsent(String key, Function<String,Iterable<String>> values)
ParametersList, else returns the current value (optional operation).computeIfAbsent in interface Parameterskey - key with which the specified value is to be associatedvalues - value to be associated with the specified keyList if function returns nullpublic void putAll(Parameters parameters)
Parametersparameters to this instance replacing values of existing associations
(optional operation).putAll in interface Parametersparameters - to copy.public void add(String key, String... values)
Parametersadd in interface Parameterskey - key with which the specified value is to be associatedvalues - value to be add to association with the specified keypublic void add(String key, Iterable<String> values)
Parametersadd in interface Parameterskey - key with which the specified value is to be associatedvalues - value to be add to association with the specified key. If null then noting will be add.public List<String> computeSingleIfAbsent(String key, Function<String,String> value)
ParametersList, else returns the current value (optional operation).computeSingleIfAbsent in interface Parameterskey - a key with which the specified value is to be associatedvalue - a single value to be associated with the specified keyList if function returns nullpublic void addAll(Parameters parameters)
Parametersparameters to this instance adding values to existing associations
(optional operation).addAll in interface Parametersparameters - to copy.public List<String> remove(String key)
Parametersremove in interface Parameterskey - key whose mapping is to be removed.List.public Map<String,List<String>> toMap()
ParameterstoMap in interface ParametersMapCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.