io.tarantool.driver.mappers.TarantoolSimpleResultMapperFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cartridge-driver Show documentation
Show all versions of cartridge-driver Show documentation
Tarantool Cartridge driver for Tarantool versions 1.10+ based on Netty framework
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);
}
}