public interface RequestParameters
Modifier and Type | Method and Description |
---|---|
Map<String,List<String>> |
all()
Gets all the parameters as a map
|
boolean |
contains(String name)
Returns true if the given parameter is specified with any value
|
String |
get(String name)
Gets the value with the given name, or null if there is no parameter with that name.
|
String |
get(String name,
String defaultValue)
Gets the value with the given name, or the default value if there is no parameter with that name.
|
List<String> |
getAll(String name)
Gets all the parameters with the given name, or an empty list if none are found.
|
boolean |
getBoolean(String name)
Gets a parameter as a boolean, where values such as
true , on and yes as
considered true, and other values (or no parameter with the name) is considered false. |
double |
getDouble(String name,
double defaultValue)
Gets the parameter as a double, or returns the default value if it was not specified or was in an invalid format.
|
float |
getFloat(String name,
float defaultValue)
Gets the parameter as a float, or returns the default value if it was not specified or was in an invalid format.
|
int |
getInt(String name,
int defaultValue)
Gets the parameter as an integer, or returns the default value if it was not specified or was in an invalid format.
|
long |
getLong(String name,
long defaultValue)
Gets the parameter as a long, or returns the default value if it was not specified or was in an invalid format.
|
Map<String,List<String>> all()
String get(String name)
Gets the value with the given name, or null if there is no parameter with that name.
If there are multiple parameters with the same name, the first one is returned.
name
- The name of the parameter to getString get(String name, String defaultValue)
Gets the value with the given name, or the default value if there is no parameter with that name.
If there are multiple parameters with the same name, the first one is returned.
name
- The name of the parameter to getdefaultValue
- The default value to use if there is no given valueint getInt(String name, int defaultValue)
name
- The name of the parameter.defaultValue
- The value to use if none was specified, or an invalid format was used.long getLong(String name, long defaultValue)
name
- The name of the parameter.defaultValue
- The value to use if none was specified, or an invalid format was used.float getFloat(String name, float defaultValue)
name
- The name of the parameter.defaultValue
- The value to use if none was specified, or an invalid format was used.double getDouble(String name, double defaultValue)
name
- The name of the parameter.defaultValue
- The value to use if none was specified, or an invalid format was used.boolean getBoolean(String name)
Gets a parameter as a boolean, where values such as true
, on
and yes
as
considered true, and other values (or no parameter with the name) is considered false.
This can be used to access checkbox values as booleans.
name
- The name of the parameter.List<String> getAll(String name)
name
- The parameter name to getboolean contains(String name)
name
- The name of the valueCopyright © 2017–2019. All rights reserved.