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

io.tarantool.driver.api.space.options.BaseOptions 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.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