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

org.tarantool.TarantoolGenericConnection16Impl Maven / Gradle / Ivy

There is a newer version: 1.9.4
Show newest version
package org.tarantool;


import java.io.IOException;
import java.nio.channels.SocketChannel;

public class TarantoolGenericConnection16Impl extends TarantoolConnection16Impl implements TarantoolGenericConnection16 {
    private final Mapper mapper;

    public TarantoolGenericConnection16Impl(String host, int port, Mapper mapper) throws IOException {
        super(host, port);
        this.mapper = mapper;
    }

    public TarantoolGenericConnection16Impl(SocketChannel channel, Mapper mapper) {
        super(channel);
        this.mapper = mapper;
    }

    @Override
    public  T select(Class clz, int space, int index, Object key, int offset, int limit, int iterator) {
        return mapper.toObject(clz, super.select(space, index, key, offset, limit, iterator));
    }

    @Override
    public  T insert(Class clz, int space, Object tuple) {
        return mapper.toObject(clz, super.insert(space, mapper.toTuple(tuple)));
    }

    @Override
    public  T replace(Class clz, int space, Object tuple) {
        return mapper.toObject(clz, super.replace(space, mapper.toTuple(tuple)));
    }

    @Override
    public  T update(Class clz, int space, Object key, Object...args) {
        return mapper.toObject(clz, super.update(space, key, mapper.toTuples(args)));
    }

    @Override
    public  void upsert(Class clz, int space, Object key, Object def, Object... args) {
        super.upsert(space, key, mapper.toTuple(def), mapper.toTuples(args));
    }

    @Override
    public  T delete(Class clz, int space, Object key) {
        return mapper.toObject(clz, super.delete(space, key));
    }

    @Override
    public  T call(Class clz, String function, Object... args) {
        return mapper.toObject(clz, super.call(function, mapper.toTuples(args)));
    }

    @Override
    public  T eval(Class clz, String expression, Object... args) {
        return mapper.toObject(clz, super.eval(expression, mapper.toTuples(args)));
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy