Interface RestResponse

All Superinterfaces:
CustomTransformer
All Known Implementing Classes:
AbstractRestResponse, DefaultRestResponse

public interface RestResponse extends CustomTransformer
Base class that represents an HTTP response for a REST resource.
Since:
6.2.0
  • Method Details

    • getName

      String getName()
    • getData

      Object getData()
    • setData

      RestResponse setData(Object data)
      Specifies response data.
      Parameters:
      data - the response data
    • setData

      RestResponse setData(String name, Object data)
      Specifies response data with a name.
      Parameters:
      name - the name of the response data
      data - the response data
    • isPrettyPrint

      boolean isPrettyPrint()
    • setPrettyPrint

      void setPrettyPrint(boolean prettyPrint)
      Sets whether to apply indentations and line breaks when generating response data.
      Parameters:
      prettyPrint - true if responding with indentations and line breaks; otherwise false
    • prettyPrint

      RestResponse prettyPrint(boolean prettyPrint)
    • isFavorPathExtension

      boolean isFavorPathExtension()
    • setFavorPathExtension

      void setFavorPathExtension(boolean favorPathExtension)
    • favorPathExtension

      RestResponse favorPathExtension(boolean favorPathExtension)
    • isIgnoreUnknownPathExtensions

      boolean isIgnoreUnknownPathExtensions()
    • setIgnoreUnknownPathExtensions

      void setIgnoreUnknownPathExtensions(boolean ignoreUnknownPathExtensions)
    • ignoreUnknownPathExtensions

      RestResponse ignoreUnknownPathExtensions(boolean ignoreUnknownPathExtensions)
    • isIgnoreAcceptHeader

      boolean isIgnoreAcceptHeader()
    • setIgnoreAcceptHeader

      void setIgnoreAcceptHeader(boolean ignoreAcceptHeader)
    • ignoreAcceptHeader

      RestResponse ignoreAcceptHeader(boolean ignoreAcceptHeader)
    • getDefaultContentType

      MediaType getDefaultContentType()
    • setDefaultContentType

      void setDefaultContentType(MediaType defaultContentType)
    • setDefaultContentType

      void setDefaultContentType(String defaultContentType)
    • defaultContentType

      RestResponse defaultContentType(MediaType defaultContentType)
    • ok

    • created

      RestResponse created()
    • created

      RestResponse created(String location)
    • accepted

      RestResponse accepted()
    • noContent

      RestResponse noContent()
    • movedPermanently

      RestResponse movedPermanently()
    • seeOther

      RestResponse seeOther()
    • notModified

      RestResponse notModified()
    • temporaryRedirect

      RestResponse temporaryRedirect()
    • badRequest

      RestResponse badRequest()
    • unauthorized

      RestResponse unauthorized()
    • forbidden

      RestResponse forbidden()
    • notFound

      RestResponse notFound()
    • methodNotAllowed

      RestResponse methodNotAllowed()
    • notAcceptable

      RestResponse notAcceptable()
    • conflict

      RestResponse conflict()
    • preconditionFailed

      RestResponse preconditionFailed()
    • unsupportedMediaType

      RestResponse unsupportedMediaType()
    • internalServerError

      RestResponse internalServerError()
    • getStatus

      int getStatus()
    • setStatus

      RestResponse setStatus(int status)
    • setStatus

      RestResponse setStatus(HttpStatus status)
    • setHeader

      RestResponse setHeader(String name, String value)
      Set the given single header value under the given header name.
      Parameters:
      name - the header name
      value - the header value to set
    • addHeader

      RestResponse addHeader(String name, String value)
      Add the given single header value to the current list of values for the given header.
      Parameters:
      name - the header name
      value - the header value to be added