Class NullResponseFactory

java.lang.Object
io.github.grumpystuff.grumpyrest.response.standard.NullResponseFactory
All Implemented Interfaces:
ResponseFactory

public final class NullResponseFactory extends Object implements ResponseFactory
Produces an empty 200 response when null is returned as a response value.
  • Constructor Details

    • NullResponseFactory

      public NullResponseFactory()
      Constructor.
  • Method Details

    • createResponse

      public Response createResponse(RequestCycle requestCycle, Object value)
      Description copied from interface: ResponseFactory
      Creates a Response from the specified response value.

      Each factory only supports a specific set of response values. This method returns null if the response value is not supported, causing the next factory to be tried.

      Specified by:
      createResponse in interface ResponseFactory
      Parameters:
      requestCycle - the request cycle to create a response for. This is passed in case the response factory wants to do special stuff like look into request properties.
      value - the response value to convert to a Response. May be null if the handler returned null.
      Returns:
      the response or null