public abstract class AbstractGraphQlClientBuilder<B extends AbstractGraphQlClientBuilder<B>> extends Object implements GraphQlClient.Builder<B>
GraphQlClient.Builder
implementations.
Subclasses must implement GraphQlClient.Builder.build() and call
buildGraphQlClient(GraphQlTransport) to obtain a default, transport
agnostic GraphQlClient. A transport specific extension can then wrap
this default tester by extending AbstractDelegatingGraphQlClient.
AbstractDelegatingGraphQlClient| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractGraphQlClientBuilder.DefaultJackson2Codecs |
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
jackson2Present |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGraphQlClientBuilder()
Default constructor for use from subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
protected GraphQlClient |
buildGraphQlClient(GraphQlTransport transport)
Build the default transport-agnostic client that subclasses can then wrap
with
AbstractDelegatingGraphQlClient. |
B |
documentSource(DocumentSource contentLoader)
Configure a
DocumentSource for use with
GraphQlClient.documentName(String) for resolving a document by name. |
protected Consumer<AbstractGraphQlClientBuilder<?>> |
getBuilderInitializer()
Return a
Consumer to initialize new builders from "this" builder. |
protected List<GraphQlClientInterceptor> |
getInterceptors()
Return the configured interceptors.
|
protected Decoder<?> |
getJsonDecoder()
Access to the configured JSON encoder.
|
protected Encoder<?> |
getJsonEncoder()
Access to the configured JSON encoder.
|
B |
interceptor(GraphQlClientInterceptor... interceptors)
Configure interceptors to be invoked before delegating to the
GraphQlTransport to perform the request. |
B |
interceptors(Consumer<List<GraphQlClientInterceptor>> interceptorsConsumer)
Customize the list of interceptors.
|
protected void |
setJsonCodecs(Encoder<?> encoder,
Decoder<?> decoder)
Transport-specific subclasses can provide their JSON
Encoder and
Decoder for use at the client level, for mapping response data
to some target entity type. |
protected void |
setJsonDecoder(Decoder<?> decoder)
Variant of
setJsonCodecs(org.springframework.core.codec.Encoder<?>, org.springframework.core.codec.Decoder<?>) for setting each codec individually. |
protected void |
setJsonEncoder(Encoder<?> encoder)
Variant of
setJsonCodecs(org.springframework.core.codec.Encoder<?>, org.springframework.core.codec.Decoder<?>) for setting each codec individually. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildprotected AbstractGraphQlClientBuilder()
Subclasses must set the transport to use before GraphQlClient.Builder.build() or
during, by overriding GraphQlClient.Builder.build().
public B interceptor(GraphQlClientInterceptor... interceptors)
GraphQlClient.BuilderGraphQlTransport to perform the request.interceptor in interface GraphQlClient.Builder<B extends AbstractGraphQlClientBuilder<B>>interceptors - the interceptors to addpublic B interceptors(Consumer<List<GraphQlClientInterceptor>> interceptorsConsumer)
GraphQlClient.Builderinterceptors in interface GraphQlClient.Builder<B extends AbstractGraphQlClientBuilder<B>>interceptorsConsumer - consumer to customize the interceptors withpublic B documentSource(DocumentSource contentLoader)
GraphQlClient.BuilderDocumentSource for use with
GraphQlClient.documentName(String) for resolving a document by name.
By default, this is set to ResourceDocumentSource with
classpath location "graphql-documents/" and
ResourceDocumentSource.FILE_EXTENSIONS as extensions.
documentSource in interface GraphQlClient.Builder<B extends AbstractGraphQlClientBuilder<B>>protected void setJsonCodecs(Encoder<?> encoder, Decoder<?> decoder)
Encoder and
Decoder for use at the client level, for mapping response data
to some target entity type.protected void setJsonEncoder(Encoder<?> encoder)
setJsonCodecs(org.springframework.core.codec.Encoder<?>, org.springframework.core.codec.Decoder<?>) for setting each codec individually.protected Encoder<?> getJsonEncoder()
protected void setJsonDecoder(Decoder<?> decoder)
setJsonCodecs(org.springframework.core.codec.Encoder<?>, org.springframework.core.codec.Decoder<?>) for setting each codec individually.protected Decoder<?> getJsonDecoder()
protected List<GraphQlClientInterceptor> getInterceptors()
protected GraphQlClient buildGraphQlClient(GraphQlTransport transport)
AbstractDelegatingGraphQlClient.protected Consumer<AbstractGraphQlClientBuilder<?>> getBuilderInitializer()
Consumer to initialize new builders from "this" builder.