Package com.streambase.sb
Enum Class DataType
- All Implemented Interfaces:
Serializable
,Comparable<DataType>
,Constable
An enumeration that represents the types that StreamBase supports.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Validate types against registered typesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionBlob type of undefined length.Boolean type, four bytes.Capture type; opaque, variable lengthDouble type, eight bytes.Function type: variable length, arguments: Schema, return: CompleteDataTypeInteger type, four bytes.List type, variable lengthLong type, eight bytes.String type of user-defined length.Timestamp type, eight byte storage.sub-schema, variable length -
Field Summary
Modifier and TypeFieldDescriptionstatic final DataType[]
The types that have no parameterization, just values.static final int
Indicator for a variable size data type -
Method Summary
Modifier and TypeMethodDescriptionstatic final Collection<DataType>
allTypes()
Deprecated.use DataType.values()static DataType
For the given name return a DataType Object.static final DataType
Return the appropriate DataType for the given clazz.static DataType
Return the appropriate DataType for the given type.getName()
Get the name of this DataType.int
getSize()
Get the size in bytes of this DataType.boolean
Returns true if we guarantee lexical comparisons between values of this type work.boolean
Return whether this DataType is of variable size or nottoString()
Return the name of the DataType.static final String
typeNameFor
(Class<?> clazz) Return the type name for the given Class type.static DataType
Returns the enum constant of this class with the specified name.static DataType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INT
Integer type, four bytes. -
LONG
Long type, eight bytes. -
DOUBLE
Double type, eight bytes. -
STRING
String type of user-defined length. -
BLOB
Blob type of undefined length. -
TIMESTAMP
Timestamp type, eight byte storage. -
BOOL
Boolean type, four bytes. -
LIST
List type, variable length -
TUPLE
sub-schema, variable length -
CAPTURE
Capture type; opaque, variable length -
FUNCTION
Function type: variable length, arguments: Schema, return: CompleteDataType
-
-
Field Details
-
SIMPLE_TYPES
The types that have no parameterization, just values. -
VARIABLE_SIZE
public static final int VARIABLE_SIZEIndicator for a variable size data type- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isLexicallyComparable
public boolean isLexicallyComparable()Returns true if we guarantee lexical comparisons between values of this type work.- Returns:
- if lexical comparison works
-
getSize
public int getSize()Get the size in bytes of this DataType.- Returns:
- the size in bytes of this DataType (VARIABLE_SIZE indicates variable size)
-
getName
Get the name of this DataType.- Returns:
- the name of this DataType
-
forType
Return the appropriate DataType for the given clazz. Will return null if can't determine the appropriate class.- Parameters:
clazz
- an object to determine the class of- Returns:
- appropriate DataType or null if none
-
typeNameFor
Return the type name for the given Class type. If there is no mapping return the original class name- Parameters:
clazz
- an object to determine the class of- Returns:
- appropriate DataType name or class name
-
forType
Return the appropriate DataType for the given type. Will return null if can't determine the appropriate type.- Parameters:
obj
- an object to determine the type of- Returns:
- appropriate DataType or null if none
-
isVariableSize
public boolean isVariableSize()Return whether this DataType is of variable size or not- Returns:
- true if and only if this DataType is of variable size, false otherwise.
-
toString
Return the name of the DataType. -
allTypes
Deprecated.use DataType.values()Return a read-only Collection of all the types that StreamBase supports.- Returns:
- a collection of all the types that StreamBase Supports.
-
forName
For the given name return a DataType Object. Returns null if the name is not a valid DataType- Parameters:
typeName
- DataType name to lookup- Returns:
- DataType found, or null
-