public final class OptionalValue extends java.lang.Object implements DataValue
Modifier and Type | Field and Description |
---|---|
static OptionalValue |
UNSET
OptionalValue instance which is not set, i.e. |
Constructor and Description |
---|
OptionalValue() |
OptionalValue(boolean value) |
OptionalValue(java.lang.Boolean value) |
OptionalValue(char[] value) |
OptionalValue(DataValue value) |
OptionalValue(double value) |
OptionalValue(java.lang.Double value) |
OptionalValue(long value) |
OptionalValue(java.lang.Long value) |
OptionalValue(java.lang.String value) |
Modifier and Type | Method and Description |
---|---|
void |
accept(ValueVisitor visitor) |
OptionalValue |
copy() |
boolean |
equals(java.lang.Object o) |
boolean |
getBoolean() |
boolean |
getBooleanOrElse(boolean orElse) |
java.lang.Boolean |
getBooleanOrNull() |
double |
getDouble() |
double |
getDoubleOrElse(double orElse) |
java.lang.Double |
getDoubleOrNull() |
long |
getInteger() |
long |
getIntegerOrElse(long orElse) |
java.lang.Long |
getIntegerOrNull() |
ListValue |
getList() |
OptionalValue |
getOptional() |
char[] |
getSecret() |
char[] |
getSecretOrElse(char[] orElse) |
char[] |
getSecretOrNull() |
java.lang.String |
getString() |
java.lang.String |
getStringOrElse(java.lang.String orElse) |
java.lang.String |
getStringOrNull() |
StructValue |
getStruct() |
DataType |
getType() |
DataValue |
getValue() |
int |
hashCode() |
boolean |
isSet() |
java.lang.String |
toString() |
public static final OptionalValue UNSET
OptionalValue
instance which is not set, i.e. getValue()
is guaranteed to return null
.
This immutable instance can be safely used in any context to avoid excessive class instantiation.
public OptionalValue()
public OptionalValue(DataValue value)
public OptionalValue(boolean value)
public OptionalValue(long value)
public OptionalValue(double value)
public OptionalValue(java.lang.String value)
public OptionalValue(char[] value)
public OptionalValue(java.lang.Boolean value)
public OptionalValue(java.lang.Long value)
public OptionalValue(java.lang.Double value)
public boolean isSet()
public DataValue getValue()
OptionalValue
if it holds one
or null
if it is not set.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public long getInteger()
public long getIntegerOrElse(long orElse)
public java.lang.Long getIntegerOrNull()
public double getDouble()
public double getDoubleOrElse(double orElse)
public java.lang.Double getDoubleOrNull()
public boolean getBoolean()
public boolean getBooleanOrElse(boolean orElse)
public java.lang.Boolean getBooleanOrNull()
public java.lang.String getString()
public java.lang.String getStringOrElse(java.lang.String orElse)
public java.lang.String getStringOrNull()
public char[] getSecret()
public char[] getSecretOrElse(char[] orElse)
public char[] getSecretOrNull()
public OptionalValue getOptional()
public ListValue getList()
public StructValue getStruct()
public void accept(ValueVisitor visitor)
public OptionalValue copy()