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

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

import io.tarantool.driver.protocol.Packable;

import java.util.List;
import java.util.Optional;

/**
 * This class is not part of the public API.
 * 

* Represent options for select cluster proxy operation * * @author Sergey Volgin * @author Alexey Kuzin * @author Artyom Dubinin */ final class CRUDSelectOptions extends CRUDBucketIdOptions { public static final String SELECT_LIMIT = "first"; public static final String SELECT_AFTER = "after"; public static final String SELECT_BATCH_SIZE = "batch_size"; public static final String FIELDS = "fields"; private > CRUDSelectOptions(AbstractBuilder builder) { super(builder); addOption(SELECT_LIMIT, builder.selectLimit); addOption(SELECT_AFTER, builder.after); addOption(SELECT_BATCH_SIZE, builder.selectBatchSize); addOption(FIELDS, builder.fields); } /** * Inheritable Builder for select cluster proxy operation options. * * @see CRUDAbstractOperationOptions.AbstractBuilder */ protected abstract static class AbstractBuilder> extends CRUDBucketIdOptions.AbstractBuilder { private Optional selectLimit = Optional.empty(); private Optional after = Optional.empty(); private Optional selectBatchSize = Optional.empty(); private Optional fields = Optional.empty(); public B withSelectLimit(Optional selectLimit) { this.selectLimit = selectLimit; return self(); } public B withSelectBatchSize(Optional selectBatchSize) { this.selectBatchSize = selectBatchSize; return self(); } public B withSelectAfter(Optional startTuple) { this.after = startTuple; return self(); } public B withFields(Optional fields) { this.fields = fields; return self(); } } /** * Concrete Builder implementation for select cluster proxy operation options. */ protected static final class Builder extends AbstractBuilder { @Override Builder self() { return this; } @Override public CRUDSelectOptions build() { return new CRUDSelectOptions(this); } } }