io.tarantool.driver.core.proxy.CRUDBucketIdOptions Maven / Gradle / Ivy
Show all versions of cartridge-driver Show documentation
package io.tarantool.driver.core.proxy;
import java.util.Optional;
/**
* This class is not part of the public API.
*
* Represent bucket id options for cluster proxy operations.
* Options for functions that uses bucket id to find storage location.
*
* @author Alexey Kuzin
* @author Artyom Dubinin
*/
class CRUDBucketIdOptions extends CRUDBaseOptions {
public static final String BUCKET_ID = "bucket_id";
protected >
CRUDBucketIdOptions(CRUDBucketIdOptions.AbstractBuilder builder) {
super(builder);
addOption(BUCKET_ID, builder.bucketId);
}
protected abstract static
class AbstractBuilder>
extends CRUDBaseOptions.AbstractBuilder {
private Optional bucketId = Optional.empty();
public B withBucketId(Optional bucketId) {
this.bucketId = bucketId;
return self();
}
}
protected static final class Builder extends AbstractBuilder {
@Override
CRUDBucketIdOptions.Builder self() {
return this;
}
@Override
public CRUDBucketIdOptions build() {
return new CRUDBucketIdOptions(this);
}
}
}