io.tarantool.driver.api.tuple.operations.TupleOperationSubtract 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.api.tuple.operations;
/**
* Represents subtraction operation on tuple field
*
* @author Sergey Volgin
*/
public class TupleOperationSubtract extends TupleUpdateOperation {
public TupleOperationSubtract(int fieldIndex, Number value) {
super(TarantoolUpdateOperationType.SUBTRACT, fieldIndex, value);
}
public TupleOperationSubtract(String fieldName, Number value) {
super(TarantoolUpdateOperationType.SUBTRACT, fieldName, value);
}
private TupleOperationSubtract(
TarantoolUpdateOperationType operationType, Integer fieldIndex,
String fieldName, Object value, boolean isProxyOperation) {
super(operationType, fieldIndex, fieldName, value, isProxyOperation);
}
@Override
public TupleOperation toProxyTupleOperation() {
return new TupleOperationSubtract(
this.getOperationType(),
this.getFieldNumber(),
this.getFieldName(),
this.getValue(),
true
);
}
@Override
public TupleOperation cloneWithIndex(int fieldMetadataIndex) {
return new TupleOperationSubtract(
this.getOperationType(),
fieldMetadataIndex,
this.getFieldName(),
this.getValue(),
this.isProxyOperation()
);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy