Package io.lenses.sql.udf.value
Class Value
- java.lang.Object
-
- io.lenses.sql.udf.value.Value
-
- Direct Known Subclasses:
Container,OptionalValue,Primitive
public abstract class Value extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ContainerasContainer()abstract PrimitiveasPrimitive()abstract RepeatedValueasRepeatedValue()abstract StructValueasStructValue()protected <T extends Value>
Tconvert(TryConversion<T> func, DataType toDataType)abstract java.lang.Objectget()DataTypegetDataType()booleanisContainer()abstract booleanisPrimitive()abstract BigDecimalValuetoBigDecimalValue()Returns this value converted to a BigDecimalValue or throws an exception.abstract BigIntValuetoBigIntValue()Returns this value converted to a BigIntValue or throws an exception.abstract BooleanValuetoBooleanValue()Returns this value converted to a BooleanValue or throws an exception.abstract ByteValuetoByteValue()Returns this value converted to a ByteValue or throws an exception.abstract DoubleValuetoDoubleValue()Returns this value converted to a DoubleValue or throws an exception.abstract FloatValuetoFloatValue()Returns this value converted to a FloatValue or throws an exception.abstract IntValuetoIntValue()Returns this value converted to a IntValue or throws an exception.abstract LongValuetoLongValue()Returns this value converted to a LongValue or throws an exception.OptionalValuetoOptional()Returns this value converted to a NullValue.abstract StringValuetoStringValue()Returns this value converted to a StringValue or throws an exception.
-
-
-
Field Detail
-
dataType
protected DataType dataType
-
-
Constructor Detail
-
Value
public Value(DataType dataType)
-
-
Method Detail
-
convert
protected <T extends Value> T convert(TryConversion<T> func, DataType toDataType) throws UdfException
- Throws:
UdfException
-
get
public abstract java.lang.Object get()
-
asPrimitive
public abstract Primitive asPrimitive() throws UdfException
- Throws:
UdfException
-
asContainer
public abstract Container asContainer() throws UdfException
- Throws:
UdfException
-
asRepeatedValue
public abstract RepeatedValue asRepeatedValue() throws UdfException
- Throws:
UdfException
-
asStructValue
public abstract StructValue asStructValue() throws UdfException
- Throws:
UdfException
-
isPrimitive
public abstract boolean isPrimitive()
-
isContainer
public boolean isContainer()
-
getDataType
public DataType getDataType()
-
toOptional
public OptionalValue toOptional() throws UdfException
Returns this value converted to a NullValue.- Returns:
- Discards this values underlying value and returns a NullValue.
- Throws:
UdfException
-
toBigDecimalValue
public abstract BigDecimalValue toBigDecimalValue() throws UdfException
Returns this value converted to a BigDecimalValue or throws an exception.- Returns:
- this Value converted to a BigDecimalValue
- Throws:
UdfException- if the conversion is not possible
-
toBigIntValue
public abstract BigIntValue toBigIntValue() throws UdfException
Returns this value converted to a BigIntValue or throws an exception.- Returns:
- this Value converted to a BigIntValue
- Throws:
UdfException- if the conversion is not possible
-
toBooleanValue
public abstract BooleanValue toBooleanValue() throws UdfException
Returns this value converted to a BooleanValue or throws an exception.- Returns:
- this Value converted to a BooleanValue
- Throws:
UdfException- if the conversion is not possible
-
toByteValue
public abstract ByteValue toByteValue() throws UdfException
Returns this value converted to a ByteValue or throws an exception.- Returns:
- this Value converted to a ByteValue
- Throws:
UdfException- if the conversion is not possible
-
toDoubleValue
public abstract DoubleValue toDoubleValue() throws UdfException
Returns this value converted to a DoubleValue or throws an exception.- Returns:
- this Value converted to a DoubleValue
- Throws:
UdfException- if the conversion is not possible
-
toFloatValue
public abstract FloatValue toFloatValue() throws UdfException
Returns this value converted to a FloatValue or throws an exception.- Returns:
- this Value converted to a FloatValue
- Throws:
UdfException- if the conversion is not possible
-
toIntValue
public abstract IntValue toIntValue() throws UdfException
Returns this value converted to a IntValue or throws an exception.- Returns:
- this Value converted to a IntValue
- Throws:
UdfException- if the conversion is not possible
-
toLongValue
public abstract LongValue toLongValue() throws UdfException
Returns this value converted to a LongValue or throws an exception.- Returns:
- this Value converted to a LongValue
- Throws:
UdfException- if the conversion is not possible
-
toStringValue
public abstract StringValue toStringValue() throws UdfException
Returns this value converted to a StringValue or throws an exception.- Returns:
- this Value converted to a StringValue
- Throws:
UdfException- if the conversion is not possible
-
-