mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Add mapreduce cleanup action
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149432516
This commit is contained in:
parent
bd7db61606
commit
5d4287a375
11 changed files with 1171 additions and 2 deletions
|
@ -114,6 +114,19 @@ public final class RequestParameters {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns first GET or POST parameter associated with {@code name} as a boolean.
|
||||
*
|
||||
* @throws BadRequestException if request parameter is present but not a valid boolean
|
||||
*/
|
||||
public static Optional<Boolean> extractOptionalBooleanParameter(
|
||||
HttpServletRequest req, String name) {
|
||||
String stringParam = req.getParameter(name);
|
||||
return isNullOrEmpty(stringParam)
|
||||
? Optional.<Boolean>absent()
|
||||
: Optional.of(Boolean.valueOf(stringParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if parameter is present and not empty and not {@code "false"}.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue