-
-
Save hellboy81/767a60c4278de5726074b14a2f278bf2 to your computer and use it in GitHub Desktop.
Make MyFeignConfiguration generic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class MyFeignConfiguration { | |
// TODO: generify MyApiClient | |
@Bean | |
public <T extends MyApiClient.Api> T apiClient(final Class<T> api) { | |
... | |
// How to generify MyApiClient ? | |
ApiClient client = new MyApiClient(); | |
... | |
} | |
// TODO: generify MyApiClient | |
@Bean | |
public <T extends MyApiClient.Api> ErrorDecoder getGenericErrorDecoder(final Class<T> api) { | |
return AnnotationErrorDecoder | |
.builderFor(api) | |
.withResponseBodyDecoder(decoder) | |
.build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment