mirror of
https://github.com/google/nomulus.git
synced 2025-05-20 11:19:35 +02:00
Make dry run parameter documentation more understandable
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=162373834
This commit is contained in:
parent
882db28ee0
commit
b671dd6451
1 changed files with 2 additions and 3 deletions
|
@ -128,15 +128,14 @@ public final class RequestParameters {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if parameter is present and not empty and not {@code "false"}.
|
||||
* Returns {@code true} iff the given parameter is present, not empty, and not {@code "false"}.
|
||||
*
|
||||
* <p>This considers a parameter with a non-existent value true, for situations where the request
|
||||
* URI is something like {@code /foo?bar}, where the mere presence of the {@code bar} parameter
|
||||
* without a value indicates that it's true.
|
||||
*/
|
||||
public static boolean extractBooleanParameter(HttpServletRequest req, String name) {
|
||||
return req.getParameterMap().containsKey(name)
|
||||
&& !equalsFalse(req.getParameter(name));
|
||||
return req.getParameterMap().containsKey(name) && !equalsFalse(req.getParameter(name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue