io.tarantool.driver.mappers.TarantoolCallResultMapperFactory 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 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);
}
}