Package graphql.kickstart.servlet.cache
Class CachedResponse
java.lang.Object
graphql.kickstart.servlet.cache.CachedResponse
- All Implemented Interfaces:
Serializable
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]booleanisError()static CachedResponseofContent(byte[] contentBytes) Constructor for success responsestatic CachedResponseConstructor for error response
-
Method Details
-
ofContent
Constructor for success response- Parameters:
contentBytes- bytes array of graphql json response
-
ofError
Constructor for error response- Parameters:
errorStatusCode- the status code for the error responseerrorMessage- 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
- Returns:
- the response error code
-
getErrorMessage
- Returns:
- the response error message
-