Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
Feign.Builder |
addCapability(Capability capability) |
Feign |
build() |
Feign.Builder |
client(Client client) |
Feign.Builder |
contract(Contract contract) |
Feign.Builder |
decode404()
This flag indicates that the
decoder should process responses with
404 status, specifically returning null or empty instead of throwing FeignException . |
Feign.Builder |
decoder(Decoder decoder) |
Feign.Builder |
doNotCloseAfterDecode()
This flag indicates that the response should not be automatically closed upon completion of
decoding the message.
|
Feign.Builder |
encoder(Encoder encoder) |
Feign.Builder |
errorDecoder(ErrorDecoder errorDecoder) |
Feign.Builder |
exceptionPropagationPolicy(ExceptionPropagationPolicy propagationPolicy) |
Feign.Builder |
invocationHandlerFactory(InvocationHandlerFactory invocationHandlerFactory)
Allows you to override how reflective dispatch works inside of Feign.
|
Feign.Builder |
logger(Logger logger) |
Feign.Builder |
logLevel(Logger.Level logLevel) |
Feign.Builder |
mapAndDecode(ResponseMapper mapper,
Decoder decoder)
Allows to map the response before passing it to the decoder.
|
Feign.Builder |
options(Request.Options options) |
Feign.Builder |
queryMapEncoder(QueryMapEncoder queryMapEncoder) |
Feign.Builder |
requestInterceptor(RequestInterceptor requestInterceptor)
Adds a single request interceptor to the builder.
|
Feign.Builder |
requestInterceptors(Iterable<RequestInterceptor> requestInterceptors)
Sets the full set of request interceptors for the builder, overwriting any previous
interceptors.
|
Feign.Builder |
retryer(Retryer retryer) |
<T> T |
target(Class<T> apiType,
String url) |
<T> T |
target(Target<T> target) |
public Feign.Builder logLevel(Logger.Level logLevel)
public Feign.Builder contract(Contract contract)
public Feign.Builder client(Client client)
public Feign.Builder retryer(Retryer retryer)
public Feign.Builder logger(Logger logger)
public Feign.Builder encoder(Encoder encoder)
public Feign.Builder decoder(Decoder decoder)
public Feign.Builder queryMapEncoder(QueryMapEncoder queryMapEncoder)
public Feign.Builder mapAndDecode(ResponseMapper mapper, Decoder decoder)
public Feign.Builder 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 Feign.Builder errorDecoder(ErrorDecoder errorDecoder)
public Feign.Builder options(Request.Options options)
public Feign.Builder requestInterceptor(RequestInterceptor requestInterceptor)
public Feign.Builder requestInterceptors(Iterable<RequestInterceptor> requestInterceptors)
public Feign.Builder invocationHandlerFactory(InvocationHandlerFactory invocationHandlerFactory)
public Feign.Builder 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 Feign.Builder exceptionPropagationPolicy(ExceptionPropagationPolicy propagationPolicy)
public Feign.Builder addCapability(Capability capability)
public <T> T target(Target<T> target)
public Feign build()
Copyright © 2012–2020 OpenFeign. All rights reserved.