public class DataType extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DataType._type |
| Modifier and Type | Field and Description |
|---|---|
static DataType |
BINARY |
static DataType |
BOOLEAN |
static DataType |
BYTE |
static DataType |
DOUBLE |
static DataType |
ENUM |
static DataType |
INT |
static DataType |
PARAMETER_VALUE |
static DataType |
SHORT |
static DataType |
STRING |
static DataType |
TIMESTAMP |
DataType._type |
val |
| Modifier | Constructor and Description |
|---|---|
protected |
DataType(DataType._type t) |
| Modifier and Type | Method and Description |
|---|---|
static DataType |
byName(String name)
this is the inverse of
name() |
static String |
capitalized(String s) |
static Object |
castAs(DataType sourceType,
DataType targetType,
Object v)
Performs casting of v from type1 to type2
|
static Object |
castAs(DataType targetType,
Object v)
Performs casting:
numbers to numbers
numbers to string
string to numbers
|
static int |
compare(Object v1,
Object v2) |
static boolean |
compatible(DataType dt1,
DataType dt2) |
static boolean |
isNumber(DataType dt) |
String |
javaType() |
static DataType |
list(TupleDefinition td) |
String |
name()
Returns type as string.
|
String |
primitiveJavaType() |
static DataType |
protobuf(String className) |
String |
toString() |
static DataType |
tuple(TupleDefinition td) |
static DataType |
typeOf(Object v) |
public final DataType._type val
public static final DataType BYTE
public static final DataType SHORT
public static final DataType INT
public static final DataType DOUBLE
public static final DataType STRING
public static final DataType BINARY
public static final DataType BOOLEAN
public static final DataType TIMESTAMP
public static final DataType ENUM
public static final DataType PARAMETER_VALUE
protected DataType(DataType._type t)
public static DataType tuple(TupleDefinition td)
public static DataType list(TupleDefinition td)
public static DataType byName(String name) throws IllegalArgumentException
name()name - IllegalArgumentException - thrown in case the name is invalidpublic String javaType()
public String primitiveJavaType()
public String name()
public static Object castAs(DataType sourceType, DataType targetType, Object v) throws IllegalArgumentException
sourceType - targetType - v - IllegalArgumentExceptionpublic static Object castAs(DataType targetType, Object v) throws IllegalArgumentException
targetType - v - IllegalArgumentExceptionpublic static boolean isNumber(DataType dt)
Copyright © 2018 Space Applications Services. All rights reserved.