Class CachedResponse

java.lang.Object
graphql.kickstart.servlet.cache.CachedResponse
All Implemented Interfaces:
Serializable

public class CachedResponse extends Object implements Serializable
See Also:
  • Method Details

    • ofContent

      public static CachedResponse ofContent(byte[] contentBytes)
      Constructor for success response
      Parameters:
      contentBytes - bytes array of graphql json response
    • ofError

      public static CachedResponse ofError(int errorStatusCode, String errorMessage)
      Constructor for error response
      Parameters:
      errorStatusCode - the status code for the error response
      errorMessage - the error message for the error response
    • isError

      public boolean isError()
      Returns:
      true when this request was failed
    • getContentBytes

      public byte[] getContentBytes()
      Returns:
      the response body for success requests, null when isError() is true
    • getErrorStatusCode

      public Integer getErrorStatusCode()
      Returns:
      the response error code
    • getErrorMessage

      public String getErrorMessage()
      Returns:
      the response error message