Class Parse<T,​O>

    • Method Detail

      • getType

        public com.google.common.reflect.TypeToken<T> getType()
        The type of object to construct from the request body.
        Returns:
        the type of object to construct from the request body
      • getOpts

        public Optional<O> getOpts()
        The type of object that provides options/configuration for the parsing.

        For any parse request, no options may be specified. Parser implementations should throw an exception if they require an options object when none is supplied.

        Returns:
        the type of object that provides options/configuration for the parsing
      • of

        public static <T,​O> Parse<T,​O> of​(com.google.common.reflect.TypeToken<T> type,
                                                      O opts)
        Creates a parse object.
        Type Parameters:
        T - the type of object to construct from the request body
        O - the type of object that provides options/configuration for the parsing
        Parameters:
        type - the type of object to construct from the request body
        opts - the options object
        Returns:
        a parse instance from the given arguments
      • of

        public static <T> Parse<T,​?> of​(com.google.common.reflect.TypeToken<T> type)
        Creates a parse object, with no options.
        Type Parameters:
        T - the type of object to construct from the request body
        Parameters:
        type - the type of object to construct from the request body
        Returns:
        a parse instance to the given type
      • of

        public static <T,​O> Parse<T,​O> of​(Class<T> type,
                                                      O opts)
        Creates a parse object.
        Type Parameters:
        T - the type of object to construct from the request body
        O - the type of object that provides options/configuration for the parsing
        Parameters:
        type - the type of object to construct from the request body
        opts - the options object
        Returns:
        a parse instance from the given arguments
      • of

        public static <T> Parse<T,​?> of​(Class<T> type)
        Creates a parse object, with no options.
        Type Parameters:
        T - the type of object to construct from the request body
        Parameters:
        type - the type of object to construct from the request body
        Returns:
        a parse instance to the given type