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 to Optional.of("").
  • Constructor Details

    • NonEmptyStringParam

      public NonEmptyStringParam(@Nullable String input)
    • NonEmptyStringParam

      public NonEmptyStringParam(@Nullable String input, String parameterName)
  • Method Details

    • 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 class AbstractParam<Optional<String>>
      Parameters:
      input - the raw input
      Returns:
      input, parsed as an instance of T