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

org.bcos.web3j.protocol.Service Maven / Gradle / Ivy

There is a newer version: 2.6.6
Show newest version
package org.bcos.web3j.protocol;

import java.util.concurrent.CompletableFuture;

import com.fasterxml.jackson.databind.ObjectMapper;

import org.bcos.web3j.protocol.core.Request;
import org.bcos.web3j.protocol.core.Response;
import org.bcos.web3j.utils.Async;

/**
 * Base service implementation.
 */
public abstract class Service implements Web3jService {

    protected final ObjectMapper objectMapper;

    public Service(boolean includeRawResponses) {
        objectMapper = ObjectMapperFactory.getObjectMapper(includeRawResponses);
    }

    @Override
    public  CompletableFuture sendAsync(
            Request jsonRpc20Request, Class responseType) {
        return Async.run(() -> send(jsonRpc20Request, responseType));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy