[Java] Make Java ApiClient extendable (#21251)

* Make all Java ApiClients in templates extendable

* Make all Java ApiClients in samples extendable

* Fix compilation of enum constructor

* Fix compilation of enum constructor in templates
This commit is contained in:
Alex B
2025-05-11 14:47:40 +00:00
committed by GitHub
parent be17698320
commit 57bf6925bb
89 changed files with 1243 additions and 1243 deletions

View File

@@ -33,13 +33,13 @@ import org.openapitools.client.auth.ApiKeyAuth;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0-SNAPSHOT")
public class ApiClient {
private static final Logger log = Logger.getLogger(ApiClient.class.getName());
protected static final Logger log = Logger.getLogger(ApiClient.class.getName());
public interface Api {}
private String basePath = "http://localhost:3000";
private Map<String, RequestInterceptor> apiAuthorizations;
private Feign.Builder feignBuilder;
protected String basePath = "http://localhost:3000";
protected Map<String, RequestInterceptor> apiAuthorizations;
protected Feign.Builder feignBuilder;
public ApiClient() {
apiAuthorizations = new LinkedHashMap<String, RequestInterceptor>();
@@ -219,7 +219,7 @@ public class ApiClient {
feignBuilder.requestInterceptor(authorization);
}
private <T extends RequestInterceptor> T getAuthorization(Class<T> type) {
protected <T extends RequestInterceptor> T getAuthorization(Class<T> type) {
return (T) apiAuthorizations.values()
.stream()
.filter(requestInterceptor -> type.isAssignableFrom(requestInterceptor.getClass()))