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

tech.ydb.jdbc.settings.YdbValue Maven / Gradle / Ivy

There is a newer version: 2.3.5
Show newest version
package tech.ydb.jdbc.settings;

import java.util.Objects;

class YdbValue {
    private final boolean isPresent;
    private final String rawValue;
    private final T value;

    YdbValue(boolean isPresent, String rawValue, T value) {
        this.isPresent = isPresent;
        this.rawValue = Objects.requireNonNull(rawValue);
        this.value = value;
    }

    public T getValue() {
        return value;
    }

    public T getValueOrOther(T other) {
        return isPresent ? value : other;
    }

    public boolean hasValue() {
        return isPresent;
    }

    String rawValue() {
        return rawValue;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy