All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.tinkoff.kora.http.client.ok.OkHttpClientModule Maven / Gradle / Ivy

There is a newer version: 1.1.16
Show newest version
package ru.tinkoff.kora.http.client.ok;

import ru.tinkoff.kora.common.DefaultComponent;
import ru.tinkoff.kora.config.common.Config;
import ru.tinkoff.kora.config.common.extractor.ConfigValueExtractor;
import ru.tinkoff.kora.http.client.common.HttpClientConfig;
import ru.tinkoff.kora.http.client.common.HttpClientModule;

public interface OkHttpClientModule extends HttpClientModule {

    default OkHttpClient okHttpClient(okhttp3.OkHttpClient client) {
        return new OkHttpClient(client);
    }

    default OkHttpClientConfig okHttpClientConfig(Config config, ConfigValueExtractor extractor) {
        return extractor.extract(config.get("httpClient.ok"));
    }

    @DefaultComponent
    default OkHttpClientWrapper okHttpClientWrapper(OkHttpClientConfig config, HttpClientConfig baseConfig) {
        return new OkHttpClientWrapper(config, baseConfig);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy