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

io.tarantool.driver.core.TarantoolResultFactory 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.core;

import io.tarantool.driver.api.metadata.TarantoolSpaceMetadata;
import io.tarantool.driver.mappers.converters.ValueConverter;
import io.tarantool.driver.mappers.converters.value.ArrayValueToTarantoolTupleConverter;
import org.msgpack.value.ArrayValue;
import org.msgpack.value.Value;

/**
 * Singleton Factory implementation to provide instance of TarantoolResultImpl objects.
 *
 * @author Rishal Dev Singh
 */
public class TarantoolResultFactory {
    private static final TarantoolResultFactory INSTANCE = new TarantoolResultFactory();

    public static TarantoolResultFactory getInstance() {
        return INSTANCE;
    }

    public  TarantoolResultImpl createTarantoolResultImpl(ArrayValue value,
            ValueConverter valueConverter) {
        return new TarantoolResultImpl<>(value, valueConverter);
    }

    public TarantoolTupleResultImpl createTarantoolTupleResultImpl(Value value,
            ArrayValueToTarantoolTupleConverter tupleConverter) {
        return new TarantoolTupleResultImpl(value, tupleConverter);
    }

    public TarantoolTupleResultImpl createTarantoolTupleResultImpl(ArrayValue rawTuples,
            TarantoolSpaceMetadata metadata,
            ArrayValueToTarantoolTupleConverter tupleConverter) {
        return new TarantoolTupleResultImpl(rawTuples, metadata, tupleConverter);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy