Package io.dropwizard.jersey.params
Class NonEmptyStringParam
- java.lang.Object
-
- io.dropwizard.jersey.params.AbstractParam<Optional<String>>
-
- io.dropwizard.jersey.params.NonEmptyStringParam
-
public class NonEmptyStringParam extends AbstractParam<Optional<String>>
A parameter encapsulating optional string values with the condition that empty string inputs are interpreted as being absent. This class is useful when it is desired for empty parameters to be synonymous with absent parameters instead of empty parameters evaluating toOptional.of("")
.
-
-
Constructor Summary
Constructors Constructor Description NonEmptyStringParam(@Nullable String input)
NonEmptyStringParam(@Nullable String input, String parameterName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Optional<String>
parse(@Nullable String input)
Given a string representation, parse it and return an instance of the parameter type.-
Methods inherited from class io.dropwizard.jersey.params.AbstractParam
equals, error, errorMessage, generateErrorMessage, get, getErrorStatus, hashCode, mediaType, toString
-
-
-
-
Method Detail
-
parse
protected Optional<String> parse(@Nullable String input)
Description copied from class:AbstractParam
Given a string representation, parse it and return an instance of the parameter type.- Specified by:
parse
in classAbstractParam<Optional<String>>
- Parameters:
input
- the raw input- Returns:
input
, parsed as an instance ofT
-
-