T
- the model of the data fieldpublic class GraphQLResponse<T>
extends java.lang.Object
GraphQLError
Constructor and Description |
---|
GraphQLResponse(java.lang.String raw,
T data,
java.util.List<GraphQLError> errors,
PaginationCursor cursor)
Constructs a representation of a response from a GraphQL request.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(java.lang.Object other) |
boolean |
equals(java.lang.Object o) |
PaginationCursor |
getCursor() |
T |
getData() |
java.util.List<GraphQLError> |
getErrors() |
java.lang.String |
getRaw() |
boolean |
hasErrors()
Returns whether the response contains any errors.
|
int |
hashCode() |
boolean |
isEmpty()
Returns whether the response is empty or not.
|
boolean |
isPaginated()
Returns whether the response is paginated.
|
boolean |
isSuccess()
Returns whether the response was successful.
|
java.lang.String |
toString() |
public GraphQLResponse(java.lang.String raw, T data, java.util.List<GraphQLError> errors, PaginationCursor cursor)
raw
- the raw response bodydata
- the deserialized response dataerrors
- the deserialized response errorscursor
- the deserialized response pagination cursorpublic boolean isEmpty()
public boolean hasErrors()
public boolean isPaginated()
public boolean isSuccess()
A response is considered successful if there are no errors and there exists a data value.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getRaw()
public T getData()
public java.util.List<GraphQLError> getErrors()
public PaginationCursor getCursor()
public java.lang.String toString()
toString
in class java.lang.Object