|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.oxf.util.web.MultimapRequestParameters
public abstract class MultimapRequestParameters
Constructor Summary | |
---|---|
protected |
MultimapRequestParameters()
|
Method Summary | |
---|---|
boolean |
addBulkParameterValues(String parameter,
Iterable<String> values)
Adds a bulk of parameter values to the given parameter. |
boolean |
addBulkParameterValues(String parameter,
String... values)
Adds a bulk of parameter values to the given parameter. |
boolean |
addNonEmpty(String key,
String value)
Adds a required parameter to the map doing a non-null check beforehand. |
boolean |
addParameterValue(String parameter,
String value)
Adds a new parameter value to the given parameter. |
boolean |
contains(String key)
Checks if the given parameter is present in the assembly. |
boolean |
containsValue(String value)
Checks if the assembly contains the given value. |
Iterable<String> |
getAllValues(String parameter)
Get read-only access to all parameter values associated with the given parameter. |
Collection<String> |
getAvailableKeys()
Returns all parameter keys available in this parameter assembly wrapped via Collections.unmodifiableCollection(Collection) . |
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()
|
protected boolean |
isEmptyString(String value)
|
protected boolean |
isEmptyValue(String parameter)
Checks if value of the given parameter is empty. |
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. |
boolean |
overrideSingleValue(String parameter,
String value)
Overrides a a value already associated with the given parameter. |
boolean |
remove(String parameter,
String value)
Removes a particular parameter value for the given parameter. |
void |
removeAll()
Performs a complete clean of this assembly instance. |
Collection<String> |
removeValues(String parameter)
Removes all parameter values associated with the given parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.n52.oxf.util.web.RequestParameters |
---|
isValid |
Constructor Detail |
---|
protected MultimapRequestParameters()
Method Detail |
---|
public boolean isEmpty()
isEmpty
in interface RequestParameters
true
if there are no key-value pairs available, false
if the assembly
contains at least one key-value pair.public boolean contains(String key)
RequestParameters
contains
in interface RequestParameters
key
- the parameter name to check.
true
if the passed parameter has one or more associated value(s),
false
if parameter is not present.public boolean containsValue(String value)
RequestParameters
containsValue
in interface RequestParameters
value
- the value to check.
true
if the passed value is available. false
if no parameter is
associated with the given value.public boolean isSingleValue(String parameter)
RequestParameters
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.
isSingleValue
in interface RequestParameters
parameter
- the parameter name 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.public boolean hasMultipleValues(String parameter)
RequestParameters
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.
hasMultipleValues
in interface RequestParameters
parameter
- the parameter name 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.public boolean overrideSingleValue(String parameter, String value)
RequestParameters
RequestParameters.addParameterValue(String, String)
.
overrideSingleValue
in interface RequestParameters
parameter
- the parameter which value shall be overridden.value
- the new value.
true
if the size of the assembly has changed.public String getSingleValue(String parameter)
RequestParameters
null
will be
returned! Any null
value associated to a parameter will be hold as en empty string:
getSingleValue
in interface RequestParameters
parameter
- the parameter name to check.
to ensure if the parameter is contained by assembly.
public Iterable<String> getAllValues(String parameter)
RequestParameters
Iterable
is one from an emtpy Collection
.
getAllValues
in interface RequestParameters
parameter
- the parameter to check.
public boolean addNonEmpty(String key, String value)
key
- the parameter's name.value
- the non-null value.
IllegalArgumentException
- if the key
's associated value
is null
or empty.public Collection<String> getAvailableKeys()
RequestParameters
Collections.unmodifiableCollection(Collection)
.
getAvailableKeys
in interface RequestParameters
public boolean mergeWith(RequestParameters parameters)
RequestParameters
mergeWith
in interface RequestParameters
parameters
- the parameter assembly to merge with.
true
if the assembly has changed, false
otherwise.public boolean addParameterValue(String parameter, String value)
RequestParameters
RequestParameters.remove(String, String)
.null
values are stored as empty Strings.
addParameterValue
in interface RequestParameters
parameter
- the parameter key.value
- the value to associate the with parameter.
true
if the assembly has changed (size has increased).public boolean addBulkParameterValues(String parameter, String... values)
RequestParameters
RequestParameters.remove(String, String)
.null
values are stored as empty Strings.
addBulkParameterValues
in interface RequestParameters
parameter
- the parameter key.values
- the values to associate with the parameter.
true
if the assembly has changed (size has increased).public boolean addBulkParameterValues(String parameter, Iterable<String> values)
RequestParameters
RequestParameters.remove(String, String)
.null
values are stored as empty Strings.
addBulkParameterValues
in interface RequestParameters
parameter
- the parameter key.values
- the values to associate with the parameter.
true
if the assembly has changed (size has increased).public boolean remove(String parameter, String value)
RequestParameters
remove
in interface RequestParameters
parameter
- the parameter to remove the value from.value
- the value to remove.
true
if the assembly has changed, false
otherwise.public Collection<String> removeValues(String parameter)
RequestParameters
removeValues
in interface RequestParameters
parameter
- the parameter to remove all values from.
public void removeAll()
RequestParameters
removeAll
in interface RequestParameters
protected boolean isEmptyValue(String parameter)
parameterName
- the parameter name.
true
if parameter value is null
or empty, false
otherwise.protected boolean isEmptyString(String value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |