Class DataTypeConverter
java.lang.Object
org.elasticsearch.xpack.esql.core.type.DataTypeConverter
Conversion utility from one Elasticsearch data type to another Elasticsearch data types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumReference to a data type conversion that can be serialized. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataTypestatic ObjectConverts arbitrary object to the desired data type.static ConverterconverterFor(DataType from, DataType to) Get the conversion from one type to another.static booleanconvertToBoolean(String val) static longsafeDoubleToLong(double x) static bytesafeToByte(long x) static intsafeToInt(double x) static intsafeToInt(long x) static LongsafeToLong(Number x) static shortsafeToShort(long x) static BigIntegerstatic BigIntegerstatic BigIntegerstatic Numberstatic BigIntegertoUnsignedLong(Number number)
-
Method Details
-
converterFor
Get the conversion from one type to another. -
safeToByte
public static byte safeToByte(long x) -
safeToShort
public static short safeToShort(long x) -
safeToInt
public static int safeToInt(long x) -
safeToInt
public static int safeToInt(double x) -
safeDoubleToLong
public static long safeDoubleToLong(double x) -
safeToLong
-
safeToUnsignedLong
-
safeToUnsignedLong
-
safeToUnsignedLong
-
toUnsignedLong
-
toInteger
-
convertToBoolean
-
convert
Converts arbitrary object to the desired data type.Throws InvalidArgumentException if such conversion is not possible
-
asInteger
-