Class InstantParam


  • public class InstantParam
    extends AbstractParam<Instant>
    A parameter encapsulating date/time values. All non-parsable values will return a 400 Bad Request response.
    • Constructor Detail

      • InstantParam

        public InstantParam​(@Nullable
                            String input)
      • InstantParam

        public InstantParam​(@Nullable
                            String input,
                            String parameterName)
    • 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 class AbstractParam<Instant>
        Parameters:
        e - the exception thrown while parsing input
        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 class AbstractParam<Instant>
        Parameters:
        input - the raw input
        Returns:
        input, parsed as an instance of T
        Throws:
        Exception - if there is an error parsing the input