public class BaseSchema
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ClientMiddleware |
middleware |
protected java.lang.String |
schema |
Constructor and Description |
---|
BaseSchema(ClientMiddleware middleware,
java.lang.String schema,
LoggerProvider loggerProvider)
Sole constructor, used internally.
|
Modifier and Type | Method and Description |
---|---|
protected <T extends GraphQLRequest<T>> |
createRequestBody(GraphQLRequest<T> request)
Creates the serialized request body to be sent to the platform.
|
protected static <T> GraphQLResponse<T> |
createResult(retrofit2.Response<GraphQLResponse<T>> response)
Processes the retrofit response and returns the GraphQL response.
|
protected <T> java.lang.Object |
createService(java.lang.Class<T> service)
Creates a retrofit service.
|
LoggerProvider |
getLoggerProvider() |
protected <T> java.util.concurrent.CompletableFuture<GraphQLResponse<T>> |
sendRequest(java.util.concurrent.CompletableFuture<retrofit2.Response<GraphQLResponse<T>>> response)
Sends a request and returns a future containing the response.
|
static java.lang.String |
version()
Returns the version.
|
protected final ClientMiddleware middleware
protected final java.lang.String schema
public BaseSchema(ClientMiddleware middleware, java.lang.String schema, LoggerProvider loggerProvider)
middleware
- the middlewareschema
- the schemaloggerProvider
- the logger providerprotected <T extends GraphQLRequest<T>> com.google.gson.JsonObject createRequestBody(GraphQLRequest<T> request)
T
- the type of the requestrequest
- the requestprotected <T> java.lang.Object createService(@NotNull java.lang.Class<T> service)
T
- the type of the serviceservice
- the service classprotected <T> java.util.concurrent.CompletableFuture<GraphQLResponse<T>> sendRequest(java.util.concurrent.CompletableFuture<retrofit2.Response<GraphQLResponse<T>>> response)
T
- the type of the responseresponse
- the future containing the retrofit responseprotected static <T> GraphQLResponse<T> createResult(retrofit2.Response<GraphQLResponse<T>> response)
T
- the type of the responseresponse
- the retrofit responsepublic static java.lang.String version()
public LoggerProvider getLoggerProvider()