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

io.tarantool.driver.mappers.TarantoolSimpleResultMapperFactory 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 TarantoolSimpleResultMapper} instances used for handling box protocol operation results
 *
 * @author Alexey Kuzin
 */
public class TarantoolSimpleResultMapperFactory extends AbstractTarantoolResultMapperFactory {

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy