io.tarantool.driver.api.space.options.BaseOptions 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.space.options;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
/**
* Base functional for all operation options.
*
* @author Alexey Kuzin
* @author Artyom Dubinin
*/
public abstract class BaseOptions implements Options {
private final Map resultMap = new HashMap<>();
/**
* Add an option value.
*
* @param option option name
* @param value option value
*/
public void addOption(String option, Object value) {
resultMap.put(option, value);
}
/**
* Get an option value.
*
* @param option option name
* @param optionClass option value type
*/
@SuppressWarnings("unchecked")
public Optional getOption(String option, Class optionClass) {
return Optional.ofNullable((T) resultMap.get(option));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy