io.tarantool.driver.core.proxy.ReplaceProxyOperation 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.core.proxy;
import io.tarantool.driver.api.SingleValueCallResult;
import io.tarantool.driver.api.TarantoolCallOperations;
import io.tarantool.driver.api.space.options.ReplaceOptions;
import io.tarantool.driver.mappers.CallResultMapper;
import io.tarantool.driver.mappers.MessagePackObjectMapper;
import io.tarantool.driver.protocol.Packable;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
* Proxy operation for replace
*
* @param result type
* @param result collection type
* @author Sergey Volgin
* @author Artyom Dubinin
*/
public final class ReplaceProxyOperation>
extends AbstractProxyOperation {
ReplaceProxyOperation(
TarantoolCallOperations client,
String functionName,
List> arguments,
MessagePackObjectMapper argumentsMapper,
CallResultMapper> resultMapper) {
super(client, functionName, arguments, argumentsMapper, resultMapper);
}
/**
* The builder for this class.
*/
public static final class Builder>
extends GenericOperationsBuilder> {
private T tuple;
public Builder() {
}
@Override
Builder self() {
return this;
}
public Builder withTuple(T tuple) {
this.tuple = tuple;
return this;
}
public ReplaceProxyOperation build() {
CRUDBucketIdOptions requestOptions = new CRUDReplaceOptions.Builder()
.withTimeout(options.getTimeout())
.withBucketId(options.getBucketId())
.withFields(options.getFields())
.build();
List> arguments = Arrays.asList(spaceName, tuple, requestOptions.asMap());
return new ReplaceProxyOperation<>(
this.client, this.functionName, arguments, this.argumentsMapper, this.resultMapper);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy