Class ErrorResponse<T>

  • Type Parameters:
    T - The type of the wrapped object

    public class ErrorResponse<T>
    extends Object
    A meta-object that can be returned by a handle() implementation to specify both a return object and a status in the return value.

    This should prevent implementers from needing to return a Response in most cases.

    • Constructor Detail

      • ErrorResponse

        public ErrorResponse​(int responseCode,
                             T wrappedObject)
        Constructs a new error response wrapper object
        Parameters:
        responseCode - The response code to return to the REST client
        wrappedObject - The object to return to the REST client
    • Method Detail

      • getResponseCode

        public int getResponseCode()
        Gets the response code for this error response
        Returns:
        The response code
      • getWrappedObject

        public T getWrappedObject()
        Gets the wrapped object for this error response
        Returns:
        The wrapped object