public abstract class BaseBuilder<B extends BaseBuilder<B,T>,T> extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
protected List<Capability> |
capabilities |
protected boolean |
closeAfterDecode |
protected Contract |
contract |
protected Decoder |
decoder |
protected boolean |
decodeVoid |
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 List<ResponseInterceptor> |
responseInterceptors |
protected Retryer |
retryer |
Constructor and Description |
---|
BaseBuilder() |
Modifier and Type | Method and Description |
---|---|
B |
addCapability(Capability capability) |
T |
build() |
B |
contract(Contract contract) |
B |
decode404()
Deprecated.
use
dismiss404() instead. |
B |
decoder(Decoder decoder) |
B |
decodeVoid() |
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) |
B |
errorDecoder(ErrorDecoder errorDecoder) |
B |
exceptionPropagationPolicy(ExceptionPropagationPolicy propagationPolicy) |
protected abstract T |
internalBuild() |
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.
|
protected ResponseInterceptor.Chain |
responseInterceptorChain() |
B |
responseInterceptors(Iterable<ResponseInterceptor> responseInterceptors)
Sets the full set of request interceptors for the builder, overwriting any previous
interceptors.
|
B |
retryer(Retryer retryer) |
protected final List<RequestInterceptor> requestInterceptors
protected final List<ResponseInterceptor> responseInterceptors
protected Logger.Level logLevel
protected Contract contract
protected Retryer retryer
protected Logger logger
protected Encoder encoder
protected Decoder decoder
protected boolean closeAfterDecode
protected boolean decodeVoid
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 decodeVoid()
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()
dismiss404()
instead.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 responseInterceptors(Iterable<ResponseInterceptor> responseInterceptors)
public B responseInterceptor(ResponseInterceptor responseInterceptor)
public B invocationHandlerFactory(InvocationHandlerFactory invocationHandlerFactory)
public B exceptionPropagationPolicy(ExceptionPropagationPolicy propagationPolicy)
public B addCapability(Capability capability)
public final T build()
protected abstract T internalBuild()
protected ResponseInterceptor.Chain responseInterceptorChain()
Copyright © 2012–2025 OpenFeign. All rights reserved.