Class JsonResponse

java.lang.Object
org.restheart.exchange.Exchange<com.google.gson.JsonElement>
org.restheart.exchange.Response<com.google.gson.JsonElement>
org.restheart.exchange.ServiceResponse<com.google.gson.JsonElement>
org.restheart.exchange.JsonResponse

public class JsonResponse extends ServiceResponse<com.google.gson.JsonElement>
Author:
Andrea Di Cesare <andrea@softinstigate.com>
  • Constructor Details

    • JsonResponse

      protected JsonResponse(io.undertow.server.HttpServerExchange exchange)
  • Method Details

    • init

      public static JsonResponse init(io.undertow.server.HttpServerExchange exchange)
    • of

      public static JsonResponse of(io.undertow.server.HttpServerExchange exchange)
    • readContent

      public String readContent()
      Description copied from class: ServiceResponse
      Reads the content as a String. This method is used by ResponseSender to generate the response content to send to the client.
      Specified by:
      readContent in class ServiceResponse<com.google.gson.JsonElement>
      Returns:
      the content as string
    • setContent

      public void setContent(GsonUtils.ObjectBuilder builder)
    • setContent

      public void setContent(GsonUtils.ArrayBuilder builder)
    • setInError

      public void setInError(int code, String message, Throwable t)
      Specified by:
      setInError in class ServiceResponse<com.google.gson.JsonElement>
      Parameters:
      code -
      message -
      t -