public abstract class BaseBuilder<B extends BaseBuilder<B>> extends Object
Modifier and Type | Field and Description |
---|---|
protected List<Capability> |
capabilities |
protected boolean |
closeAfterDecode |
protected Contract |
contract |
protected Decoder |
decoder |
protected boolean |
dismiss404 |
protected Encoder |
encoder |
protected ErrorDecoder |
errorDecoder |
protected InvocationHandlerFactory |
invocationHandlerFactory |
protected Logger |
logger |
protected Logger.Level |
logLevel |
protected Request.Options |
options |
protected ExceptionPropagationPolicy |
propagationPolicy |
protected QueryMapEncoder |
queryMapEncoder |
protected List<RequestInterceptor> |
requestInterceptors |
protected ResponseInterceptor |
responseInterceptor |
protected Retryer |
retryer |
Constructor and Description |
---|
BaseBuilder() |
Modifier and Type | Method and Description |
---|---|
B |
addCapability(Capability capability) |
B |
contract(Contract contract) |
B |
decode404()
Deprecated.
|
B |
decoder(Decoder decoder) |
B |
dismiss404()
This flag indicates that the
decoder should process responses with
404 status, specifically returning null or empty instead of throwing FeignException . |
B |
doNotCloseAfterDecode()
This flag indicates that the response should not be automatically closed upon completion of
decoding the message.
|
B |
encoder(Encoder encoder) |
protected B |
enrich() |
B |
errorDecoder(ErrorDecoder errorDecoder) |
B |
exceptionPropagationPolicy(ExceptionPropagationPolicy propagationPolicy) |
B |
invocationHandlerFactory(InvocationHandlerFactory invocationHandlerFactory)
Allows you to override how reflective dispatch works inside of Feign.
|
B |
logger(Logger logger) |
B |
logLevel(Logger.Level logLevel) |
B |
mapAndDecode(ResponseMapper mapper,
Decoder decoder)
Allows to map the response before passing it to the decoder.
|
B |
options(Request.Options options) |
B |
queryMapEncoder(QueryMapEncoder queryMapEncoder) |
B |
requestInterceptor(RequestInterceptor requestInterceptor)
Adds a single request interceptor to the builder.
|
B |
requestInterceptors(Iterable<RequestInterceptor> requestInterceptors)
Sets the full set of request interceptors for the builder, overwriting any previous
interceptors.
|
B |
responseInterceptor(ResponseInterceptor responseInterceptor)
Adds a single response interceptor to the builder.
|
B |
retryer(Retryer retryer) |
protected final List<RequestInterceptor> requestInterceptors
protected ResponseInterceptor responseInterceptor
protected Logger.Level logLevel
protected Contract contract
protected Retryer retryer
protected Logger logger
protected Encoder encoder
protected Decoder decoder
protected boolean closeAfterDecode
protected QueryMapEncoder queryMapEncoder
protected ErrorDecoder errorDecoder
protected Request.Options options
protected InvocationHandlerFactory invocationHandlerFactory
protected boolean dismiss404
protected ExceptionPropagationPolicy propagationPolicy
protected List<Capability> capabilities
public B logLevel(Logger.Level logLevel)
public B doNotCloseAfterDecode()
Iterator
.
Feign standard decoders do not have built in support for this flag. If you are using this flag,
you MUST also use a custom Decoder, and be sure to close all resources appropriately somewhere
in the Decoder (you can use Util.ensureClosed(java.io.Closeable)
for convenience).public B queryMapEncoder(QueryMapEncoder queryMapEncoder)
public B mapAndDecode(ResponseMapper mapper, Decoder decoder)
public B dismiss404()
decoder
should process responses with
404 status, specifically returning null or empty instead of throwing FeignException
.
All first-party (ex gson) decoders return well-known empty values defined by
Util.emptyValueOf(java.lang.reflect.Type)
. To customize further, wrap an existing decoder
or make your own.
This flag only works with 404, as opposed to all or arbitrary status codes. This was an
explicit decision: 404 -> empty is safe, common and doesn't complicate redirection, retry or
fallback policy. If your server returns a different status for not-found, correct via a custom
client
.@Deprecated public B decode404()
decoder
should process responses with
404 status, specifically returning null or empty instead of throwing FeignException
.
All first-party (ex gson) decoders return well-known empty values defined by
Util.emptyValueOf(java.lang.reflect.Type)
. To customize further, wrap an existing decoder
or make your own.
This flag only works with 404, as opposed to all or arbitrary status codes. This was an
explicit decision: 404 -> empty is safe, common and doesn't complicate redirection, retry or
fallback policy. If your server returns a different status for not-found, correct via a custom
client
.public B errorDecoder(ErrorDecoder errorDecoder)
public B options(Request.Options options)
public B requestInterceptor(RequestInterceptor requestInterceptor)
public B requestInterceptors(Iterable<RequestInterceptor> requestInterceptors)
public B responseInterceptor(ResponseInterceptor responseInterceptor)
public B invocationHandlerFactory(InvocationHandlerFactory invocationHandlerFactory)
public B exceptionPropagationPolicy(ExceptionPropagationPolicy propagationPolicy)
public B addCapability(Capability capability)
protected B enrich()
Copyright © 2012–2022 OpenFeign. All rights reserved.