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

io.tarantool.driver.mappers.TarantoolCallResultMapperFactory Maven / Gradle / Ivy

Go to download

Tarantool Cartridge driver for Tarantool versions 1.10+ based on Netty framework

There is a newer version: 0.14.0
Show newest version
package io.tarantool.driver.mappers;

import io.tarantool.driver.api.tuple.TarantoolTuple;
import io.tarantool.driver.metadata.TarantoolSpaceMetadata;
import org.msgpack.value.ArrayValue;

/**
 * Factory for {@link TarantoolCallResultMapper} instances used for calling API functions on Tarantool instance
 *
 * @author Alexey Kuzin
 */
public class TarantoolCallResultMapperFactory extends AbstractTarantoolResultMapperFactory {

    /**
     * Basic constructor
     *
     * @param messagePackMapper mapper for MessagePack entities in tuple fields to Java objects
     */
    public TarantoolCallResultMapperFactory(MessagePackMapper messagePackMapper) {
        super(messagePackMapper);
    }

    /**
     * Basic constructor with empty mapper
     */
    public TarantoolCallResultMapperFactory() {
        super();
    }

    protected  TarantoolCallResultMapper createMapper(ValueConverter valueConverter) {
        return new TarantoolCallResultMapper<>(new DefaultMessagePackMapper(), valueConverter);
    }

    @Override
    public TarantoolCallResultMapper withDefaultTupleValueConverter(
            TarantoolSpaceMetadata spaceMetadata) {
        return (TarantoolCallResultMapper) super.withDefaultTupleValueConverter(spaceMetadata);
    }

    @Override
    public  TarantoolCallResultMapper withConverter(ValueConverter valueConverter) {
        return (TarantoolCallResultMapper) super.withConverter(valueConverter);
    }

    @Override
    public  TarantoolCallResultMapper withConverter(Class tupleClass,
                                                          ValueConverter valueConverter) {
        return (TarantoolCallResultMapper) super.withConverter(tupleClass, valueConverter);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy