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

io.tarantool.driver.mappers.converters.ObjectConverter 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.converters;

import org.msgpack.value.Value;

/**
 * Basic interface for converters from Java objects to MessagePack entities for a particular class
 *
 * @param  the source object type
 * @param  the target MessagePack entity type
 * @author Alexey Kuzin
 */
public interface ObjectConverter extends Converter {
    /**
     * Convert Java object to a MessagePack entity
     *
     * @param object object
     * @return entity
     */
    V toValue(O object);

    /**
     * Optional method for determining if this specific object can be converted to the specified {@link Value} type.
     *
     * @param object the object to be converted
     * @return true, if the object csn be converted
     */
    default boolean canConvertObject(O object) {
        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy