|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RequestParameters
Represents an assembly of request parameters (key-value pairs). Multiple parameter values are allowed, i.e.
one key can be associated to one or more parameter values. null
values are hold as empty
strings.
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 |
addParameterValue(String parameter,
String value)
Adds a new parameter value to the given parameter. |
boolean |
contains(String parameter)
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()
|
boolean |
isSingleValue(String parameter)
Checks if the assembly has exact one parameter value associated to the given key. |
boolean |
isValid()
Performs a check if this parameter assembly is valid according to a defined schema. |
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. |
Method Detail |
---|
boolean isValid()
true
if the assembly is valie, false
otherwise.boolean isEmpty()
true
if there are no key-value pairs available, false
if the assembly
contains at least one key-value pair.boolean contains(String parameter)
parameter
- the parameter name to check.
true
if the passed parameter has one or more associated value(s),
false
if parameter is not present.boolean containsValue(String value)
value
- the value to check.
true
if the passed value is available. false
if no parameter is
associated with the given value.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 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.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 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.boolean overrideSingleValue(String parameter, String value)
addParameterValue(String, String)
.
parameter
- the parameter which value shall be overridden.value
- the new value.
true
if the size of the assembly has changed.String getSingleValue(String parameter)
null
will be
returned! Any null
value associated to a parameter will be hold as en empty string:
parameter
- the parameter name to check.
to ensure if the parameter is contained by assembly.
Collection<String> getAvailableKeys()
Collections.unmodifiableCollection(Collection)
.
Iterable<String> getAllValues(String parameter)
Iterable
is one from an emtpy Collection
.
parameter
- the parameter 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, 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 addBulkParameterValues(String parameter, String... values)
remove(String, 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 addBulkParameterValues(String parameter, Iterable<String> values)
remove(String, 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 remove(String parameter, String value)
parameter
- the parameter to remove the value from.value
- the value to remove.
true
if the assembly has changed, false
otherwise.Collection<String> removeValues(String parameter)
parameter
- the parameter to remove all values from.
void removeAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |