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

ru.tinkoff.kora.json.jackson.module.JacksonModule Maven / Gradle / Ivy

package ru.tinkoff.kora.json.jackson.module;

import com.fasterxml.jackson.databind.ObjectMapper;
import ru.tinkoff.kora.application.graph.TypeRef;
import ru.tinkoff.kora.http.client.common.request.HttpClientRequestMapper;
import ru.tinkoff.kora.http.client.common.response.HttpClientResponseMapper;
import ru.tinkoff.kora.http.server.common.handler.HttpServerRequestMapper;
import ru.tinkoff.kora.http.server.common.handler.HttpServerResponseMapper;
import ru.tinkoff.kora.json.jackson.module.http.client.*;
import ru.tinkoff.kora.json.jackson.module.http.server.JacksonAsyncHttpServerRequestMapper;
import ru.tinkoff.kora.json.jackson.module.http.server.JacksonHttpServerRequestMapper;
import ru.tinkoff.kora.json.jackson.module.http.server.JacksonHttpServerResponseMapper;

import java.util.concurrent.CompletionStage;

public interface JacksonModule {

    default  HttpServerRequestMapper jacksonHttpServerRequestMapper(ObjectMapper objectMapper, TypeRef type) {
        return new JacksonHttpServerRequestMapper<>(objectMapper, type);
    }

    default  HttpServerRequestMapper> jacksonAsyncHttpServerRequestMapper(ObjectMapper objectMapper, TypeRef type) {
        return new JacksonAsyncHttpServerRequestMapper<>(objectMapper, type);
    }

    default  HttpServerResponseMapper jacksonHttpServerResponseMapper(ObjectMapper objectMapper, TypeRef type) {
        return new JacksonHttpServerResponseMapper<>(objectMapper, type);
    }

    default  HttpClientRequestMapper jacksonHttpClientRequestMapper(ObjectMapper objectMapper, TypeRef typeRef) {
        return new JacksonHttpClientRequestMapper<>(objectMapper, typeRef);
    }

    default  HttpClientResponseMapper jacksonHttpClientResponseMapper(ObjectMapper objectMapper, TypeRef typeRef) {
        return new JacksonHttpClientResponseMapper<>(objectMapper, typeRef);
    }

    default  HttpClientResponseMapper> jacksonAsyncHttpClientResponseMapper(ObjectMapper objectMapper, TypeRef typeRef) {
        return new JacksonAsyncHttpClientResponseMapper(objectMapper, typeRef);
    }

    default  JacksonReaderHttpClientResponseEntityMapper jacksonReaderHttpClientResponseEntityMapper(ObjectMapper objectMapper, TypeRef typeRef) {
        return new JacksonReaderHttpClientResponseEntityMapper<>(objectMapper, typeRef);
    }

    default  JacksonAsyncHttpClientResponseEntityMapper jacksonAsyncHttpClientResponseEntityMapper(ObjectMapper objectMapper, TypeRef typeRef) {
        return new JacksonAsyncHttpClientResponseEntityMapper<>(objectMapper, typeRef);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy