tech.ydb.jdbc.settings.YdbValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-jdbc-driver Show documentation
Show all versions of ydb-jdbc-driver Show documentation
JDBC Driver over YDB Java SDK
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;
}
}