Package io.smallrye.graphql.client.impl
Class ResponseImpl
- java.lang.Object
-
- io.smallrye.graphql.client.impl.ResponseImpl
-
-
Field Summary
Fields Modifier and Type Field Description static StringSTATUS_CODEstatic StringSTATUS_MESSAGE
-
Constructor Summary
Constructors Constructor Description ResponseImpl(jakarta.json.JsonObject data, List<GraphQLError> errors, jakarta.json.JsonObject extensions, Map<String,List<String>> headers)ResponseImpl(jakarta.json.JsonObject data, List<GraphQLError> errors, jakarta.json.JsonObject extensions, Map<String,List<String>> headers, Integer statusCode, String statusMessage)ResponseImpl(jakarta.json.JsonObject data, List<GraphQLError> errors, Map<String,List<String>> headers)ResponseImpl(jakarta.json.JsonObject data, List<GraphQLError> errors, Map<String,List<String>> headers, Integer statusCode, String statusMessage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.json.JsonObjectgetData()List<GraphQLError>getErrors()jakarta.json.JsonObjectgetExtensions()Map<String,List<String>>getHeaders()<T> List<T>getList(Class<T> dataType, String rootField)<T> TgetObject(Class<T> dataType, String rootField)IntegergetStatusCode()Returns the HTTP status code.StringgetStatusMessage()Returns the HTTP status message.Map<String,List<String>>getTransportMeta()booleanhasData()booleanhasError()booleanhasExtensions()voidthrowExceptionIfErrors()If there are application errors inside this response, this method converts these errors into a `GraphQLClientException` and throws it.StringtoString()
-
-
-
Field Detail
-
STATUS_CODE
public static final String STATUS_CODE
- See Also:
- Constant Field Values
-
STATUS_MESSAGE
public static final String STATUS_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResponseImpl
public ResponseImpl(jakarta.json.JsonObject data, List<GraphQLError> errors, Map<String,List<String>> headers)
-
ResponseImpl
public ResponseImpl(jakarta.json.JsonObject data, List<GraphQLError> errors, jakarta.json.JsonObject extensions, Map<String,List<String>> headers)
-
ResponseImpl
public ResponseImpl(jakarta.json.JsonObject data, List<GraphQLError> errors, Map<String,List<String>> headers, Integer statusCode, String statusMessage)
-
-
Method Detail
-
getErrors
public List<GraphQLError> getErrors()
-
getExtensions
public jakarta.json.JsonObject getExtensions()
- Specified by:
getExtensionsin interfaceResponse
-
throwExceptionIfErrors
public void throwExceptionIfErrors()
If there are application errors inside this response, this method converts these errors into a `GraphQLClientException` and throws it. If there are no errors, then this method does nothing.
-
hasExtensions
public boolean hasExtensions()
- Specified by:
hasExtensionsin interfaceResponse
-
getTransportMeta
public Map<String,List<String>> getTransportMeta()
- Specified by:
getTransportMetain interfaceResponse
-
getStatusCode
public Integer getStatusCode()
Returns the HTTP status code. Returns null if no HTTP status code is known, for example when this response corresponds to an operation executed over a websocket rather than a simple HTTP exchange.
-
getStatusMessage
public String getStatusMessage()
Returns the HTTP status message. Returns null if no HTTP status message is known, for example when this response corresponds to an operation executed over a websocket rather than a simple HTTP exchange.
-
-