io.tarantool.driver.mappers.ValueConverter 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 org.msgpack.value.Value;
/**
* Basic interface for converters from MessagePack entities to Java objects for a particular class
* @param the source MessagePack entity type
* @param the target object type
* @author Alexey Kuzin
*/
public interface ValueConverter {
/**
* Convert MessagePack entity to a Java object
* @param value entity
* @return object
*/
O fromValue(V value);
/**
* Optional method for determining if this specific entity can be converted to the specified object type.
* @param value MessagePack entity to be converted
* @return true, if the entity csn be converted
*/
default boolean canConvertValue(V value) {
return true;
}
}