Package io.lenses.sql.udf.value
Class OptionalValue
- java.lang.Object
-
- io.lenses.sql.udf.value.Value
-
- io.lenses.sql.udf.value.OptionalValue
-
public class OptionalValue extends Value
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOptionalValue(java.util.Optional<Value> inner, DataType dataType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerasContainer()PrimitiveasPrimitive()RepeatedValueasRepeatedValue()StructValueasStructValue()static OptionalValueempty(DataType dataType)java.lang.Objectget()java.lang.BooleanisEmpty()booleanisPrimitive()java.lang.BooleannonEmpty()static OptionalValueof(Value value)BigDecimalValuetoBigDecimalValue()Returns this value converted to a BigDecimalValue or throws an exception.BigIntValuetoBigIntValue()Returns this value converted to a BigIntValue or throws an exception.BooleanValuetoBooleanValue()Returns this value converted to a BooleanValue or throws an exception.ByteValuetoByteValue()Returns this value converted to a ByteValue or throws an exception.DoubleValuetoDoubleValue()Returns this value converted to a DoubleValue or throws an exception.FloatValuetoFloatValue()Returns this value converted to a FloatValue or throws an exception.IntValuetoIntValue()Returns this value converted to a IntValue or throws an exception.LongValuetoLongValue()Returns this value converted to a LongValue or throws an exception.StringValuetoStringValue()Returns this value converted to a StringValue or throws an exception.-
Methods inherited from class io.lenses.sql.udf.value.Value
convert, getDataType, isContainer, toOptional
-
-
-
-
Constructor Detail
-
OptionalValue
protected OptionalValue(java.util.Optional<Value> inner, DataType dataType) throws UdfException
- Throws:
UdfException
-
-
Method Detail
-
nonEmpty
public java.lang.Boolean nonEmpty()
-
isEmpty
public java.lang.Boolean isEmpty()
-
asPrimitive
public Primitive asPrimitive() throws UdfException
- Specified by:
asPrimitivein classValue- Throws:
UdfException
-
asContainer
public Container asContainer() throws UdfException
- Specified by:
asContainerin classValue- Throws:
UdfException
-
asRepeatedValue
public RepeatedValue asRepeatedValue() throws UdfException
- Specified by:
asRepeatedValuein classValue- Throws:
UdfException
-
asStructValue
public StructValue asStructValue() throws UdfException
- Specified by:
asStructValuein classValue- Throws:
UdfException
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein classValue
-
toBigDecimalValue
public BigDecimalValue toBigDecimalValue() throws UdfException
Description copied from class:ValueReturns this value converted to a BigDecimalValue or throws an exception.- Specified by:
toBigDecimalValuein classValue- Returns:
- this Value converted to a BigDecimalValue
- Throws:
UdfException- if the conversion is not possible
-
toBigIntValue
public BigIntValue toBigIntValue() throws UdfException
Description copied from class:ValueReturns this value converted to a BigIntValue or throws an exception.- Specified by:
toBigIntValuein classValue- Returns:
- this Value converted to a BigIntValue
- Throws:
UdfException- if the conversion is not possible
-
toBooleanValue
public BooleanValue toBooleanValue() throws UdfException
Description copied from class:ValueReturns this value converted to a BooleanValue or throws an exception.- Specified by:
toBooleanValuein classValue- Returns:
- this Value converted to a BooleanValue
- Throws:
UdfException- if the conversion is not possible
-
toByteValue
public ByteValue toByteValue() throws UdfException
Description copied from class:ValueReturns this value converted to a ByteValue or throws an exception.- Specified by:
toByteValuein classValue- Returns:
- this Value converted to a ByteValue
- Throws:
UdfException- if the conversion is not possible
-
toDoubleValue
public DoubleValue toDoubleValue() throws UdfException
Description copied from class:ValueReturns this value converted to a DoubleValue or throws an exception.- Specified by:
toDoubleValuein classValue- Returns:
- this Value converted to a DoubleValue
- Throws:
UdfException- if the conversion is not possible
-
toFloatValue
public FloatValue toFloatValue() throws UdfException
Description copied from class:ValueReturns this value converted to a FloatValue or throws an exception.- Specified by:
toFloatValuein classValue- Returns:
- this Value converted to a FloatValue
- Throws:
UdfException- if the conversion is not possible
-
toIntValue
public IntValue toIntValue() throws UdfException
Description copied from class:ValueReturns this value converted to a IntValue or throws an exception.- Specified by:
toIntValuein classValue- Returns:
- this Value converted to a IntValue
- Throws:
UdfException- if the conversion is not possible
-
toLongValue
public LongValue toLongValue() throws UdfException
Description copied from class:ValueReturns this value converted to a LongValue or throws an exception.- Specified by:
toLongValuein classValue- Returns:
- this Value converted to a LongValue
- Throws:
UdfException- if the conversion is not possible
-
toStringValue
public StringValue toStringValue() throws UdfException
Description copied from class:ValueReturns this value converted to a StringValue or throws an exception.- Specified by:
toStringValuein classValue- Returns:
- this Value converted to a StringValue
- Throws:
UdfException- if the conversion is not possible
-
empty
public static OptionalValue empty(DataType dataType) throws UdfException
- Throws:
UdfException
-
of
public static OptionalValue of(Value value) throws UdfException
- Throws:
UdfException
-
-