Package io.dropwizard.jersey.params
Class InstantParam
- java.lang.Object
-
- io.dropwizard.jersey.params.AbstractParam<Instant>
-
- io.dropwizard.jersey.params.InstantParam
-
public class InstantParam extends AbstractParam<Instant>
A parameter encapsulating date/time values. All non-parsable values will return a400 Bad Request
response.
-
-
Constructor Summary
Constructors Constructor Description InstantParam(String input)
InstantParam(String input, String parameterName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
errorMessage(Exception e)
Given a string representation which was unable to be parsed and the exception thrown, produce an entity to be sent to the client.protected Instant
parse(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, get, getErrorStatus, hashCode, mediaType, toString
-
-
-
-
Method Detail
-
errorMessage
protected String errorMessage(Exception e)
Description copied from class:AbstractParam
Given a string representation which was unable to be parsed and the exception thrown, produce an entity to be sent to the client.- Overrides:
errorMessage
in classAbstractParam<Instant>
- Parameters:
e
- the exception thrown while parsinginput
- Returns:
- the error message to be sent the client
-
parse
protected Instant parse(@Nullable String input) throws Exception
Description copied from class:AbstractParam
Given a string representation, parse it and return an instance of the parameter type.- Specified by:
parse
in classAbstractParam<Instant>
- Parameters:
input
- the raw input- Returns:
input
, parsed as an instance ofT
- Throws:
Exception
- if there is an error parsing the input
-
-