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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy