Parameterspublic class ReadOnlyParameters extends java.lang.Object implements Parameters
Parameters.Parameters| Constructor | Description |
|---|---|
ReadOnlyParameters(Parameters parameters) |
Creates an instance from provided multi-map.
|
ReadOnlyParameters(java.util.Map<java.lang.String,java.util.List<java.lang.String>> data) |
Creates an instance from provided multi-map.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(java.lang.String key,
java.lang.Iterable<java.lang.String> values) |
Adds specified values tu association with the specified key (optional operation).
|
void |
add(java.lang.String key,
java.lang.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). |
java.util.List<java.lang.String> |
all(java.lang.String name) |
Returns an unmodifiable List of all of the values of the given named
parameter.
|
java.util.List<java.lang.String> |
computeIfAbsent(java.lang.String key,
java.util.function.Function<java.lang.String,java.lang.Iterable<java.lang.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). |
java.util.List<java.lang.String> |
computeSingleIfAbsent(java.lang.String key,
java.util.function.Function<java.lang.String,java.lang.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.
|
java.util.Optional<java.lang.String> |
first(java.lang.String name) |
Returns an
Optional containing the first value of the given
parameter (and possibly multi-valued) parameter. |
java.util.List<java.lang.String> |
put(java.lang.String key,
java.lang.Iterable<java.lang.String> values) |
Associates specified values with the specified key (optional operation).
|
java.util.List<java.lang.String> |
put(java.lang.String key,
java.lang.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). |
java.util.List<java.lang.String> |
putIfAbsent(java.lang.String key,
java.lang.Iterable<java.lang.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). |
java.util.List<java.lang.String> |
putIfAbsent(java.lang.String key,
java.lang.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). |
java.util.List<java.lang.String> |
remove(java.lang.String key) |
Removes the mapping for a key if it is present (optional operation).
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
toMap() |
Returns a copy of parameters as a Map.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoUnmodifiableParameterspublic ReadOnlyParameters(java.util.Map<java.lang.String,java.util.List<java.lang.String>> data)
data - multi-map data to copy.public ReadOnlyParameters(Parameters parameters)
parameters - parameters to copy.public static ReadOnlyParameters empty()
public java.util.Optional<java.lang.String> first(java.lang.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 java.util.List<java.lang.String> all(java.lang.String name)
Parametersall in interface Parametersname - the parameter nameList of values with zero or greater sizepublic java.util.List<java.lang.String> put(java.lang.String key,
java.lang.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 java.util.List<java.lang.String> put(java.lang.String key,
java.lang.Iterable<java.lang.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 java.util.List<java.lang.String> putIfAbsent(java.lang.String key,
java.lang.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 java.util.List<java.lang.String> putIfAbsent(java.lang.String key,
java.lang.Iterable<java.lang.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 java.util.List<java.lang.String> computeIfAbsent(java.lang.String key,
java.util.function.Function<java.lang.String,java.lang.Iterable<java.lang.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(java.lang.String key,
java.lang.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(java.lang.String key,
java.lang.Iterable<java.lang.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 java.util.List<java.lang.String> computeSingleIfAbsent(java.lang.String key,
java.util.function.Function<java.lang.String,java.lang.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 java.util.List<java.lang.String> remove(java.lang.String key)
Parametersremove in interface Parameterskey - key whose mapping is to be removed.List.public java.util.Map<java.lang.String,java.util.List<java.lang.String>> toMap()
ParameterstoMap in interface ParametersMapCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.