Class CachedResponse

  • All Implemented Interfaces:
    java.io.Serializable

    public class CachedResponse
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Method Detail

      • 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,
                                             java.lang.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 java.lang.Integer getErrorStatusCode()
        Returns:
        the response error code
      • getErrorMessage

        public java.lang.String getErrorMessage()
        Returns:
        the response error message