public interface RequestParameters
null
values are hold as empty
strings.
TODO check how duplicates are handledModifier and Type | Method and Description |
---|---|
boolean |
addParameterEnumValues(String parameter,
Enum<?>... values)
Adds a bulk of parameter values (from a particular codelist) to the given parameter.
|
boolean |
addParameterStringValues(String parameter,
String... values)
Adds a bulk of parameter values to the given parameter.
|
boolean |
addParameterValue(String parameter,
String value)
Adds a new parameter value to the given parameter.
|
boolean |
addParameterValues(String parameter,
Iterable<String> values)
Adds a bulk of parameter values to the given parameter.
|
boolean |
contains(String parameter)
Checks if the given parameter is present in the assembly.
|
Collection<String> |
getAllValues(String parameter)
Get read-only access to all parameter values associated with the given parameter.
|
Collection<String> |
getParameterNames()
Returns all parameter names available in this parameter assembly.
|
String |
getSingleValue(String parameter)
Gets the first parameter value for the given parameter.
|
boolean |
hasMultipleValues(String parameter)
Checks if the assembly has more than one parameter value associated to the given key.
|
boolean |
isEmpty()
Checks if the assembly is empty at all.
|
boolean |
isEmpty(String parameter)
Checks if the given parameter has at least one associated value.
|
boolean |
isSingleValue(String parameter)
Checks if the assembly has exact one parameter value associated to the given key.
|
boolean |
mergeWith(RequestParameters parameters)
Merge the given parameter assembly with this instance.
|
Collection<String> |
remove(String parameter)
Removes the given parameter and its associated values.
|
void |
removeAll()
Performs a complete clean of this assembly instance.
|
boolean isEmpty()
true
if there are no key-value pairs available,false
if the assembly contains at least one key-value pair.boolean isEmpty(String parameter)
parameter
- the parameter key to check.true
if the passed parameter has zero associated values
or is not present in the assembly,false
if the parameter is has one or more associated values.boolean contains(String parameter)
parameter
- the parameter key to check.true
if the passed parameter has one or more associated value(s),false
if parameter is not present.boolean isSingleValue(String parameter)
false
. This method is not threadsafe, so do not
expect it as a reliable check; other threads may have added new values in the meantime.parameter
- the parameter key to check.true
if there is exact one value associated with the given parameter,false
if there are more than one parameter value, or the parameter is not present.NullPointerException
- may be thrown if no entry for the given parameter can be found.boolean hasMultipleValues(String parameter)
false
. This method is not threadsafe, so do not
expect it as a reliable check; other threads may have added new values in the meantime.parameter
- the parameter key to check.true
if more than one value is associated with the given parameter,false
if there is only one parameter value, or the parameter is not present.NullPointerException
- may be thrown if no entry for the given parameter can be found.String getSingleValue(String parameter)
null
value
associated to it an empty string "" will be returned. Use contains(String)
to
ensure if the parameter is contained by this assembly.parameter
- the parameter key to check.contains(String)
Collection<String> getParameterNames()
Collection<String> getAllValues(String parameter)
parameter
- the parameter key to check.boolean mergeWith(RequestParameters parameters)
parameters
- the parameter assembly to merge with.true
if the assembly has changed,false
otherwise.boolean addParameterValue(String parameter, String value)
remove(String)
.null
values are stored as empty Strings.parameter
- the parameter key.value
- the value to associate the with parameter.true
if the assembly has changed (size has increased).boolean addParameterEnumValues(String parameter, Enum<?>... values)
remove(String)
.null
values are stored as empty Strings.parameter
- the parameter key.values
- the Enum.toString()
values to associate with the parameter.true
if the assembly has changed (size has increased).boolean addParameterStringValues(String parameter, String... values)
remove(String)
.null
values are stored as empty Strings.parameter
- the parameter key.values
- the values to associate with the parameter.true
if the assembly has changed (size has increased).boolean addParameterValues(String parameter, Iterable<String> values)
remove(String)
.null
values are stored as empty Strings.parameter
- the parameter key.values
- the values to associate with the parameter.true
if the assembly has changed (size has increased).Collection<String> remove(String parameter)
parameter
- the parameter key.void removeAll()
Copyright © 2012–2017 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.