public class DataTypeImpl extends Object
DataTypeImpl class provides definition for Cassandra data types
used for columns when one cannot rely on the default behavior where the type is
inferred from the field type.| Modifier and Type | Class and Description |
|---|---|
static class |
DataTypeImpl.Definition
The
Definition class provides a data type definition for a CQL
data type. |
| Constructor and Description |
|---|
DataTypeImpl() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
anyArgumentsInferred(List<CQLDataType> args)
Checks if at least one argument from the given list is defined to be inferred.
|
static Class<?> |
findClass(String name)
Finds and loads the specified class.
|
static DataTypeImpl.Definition |
inferDataTypeFrom(StatementManagerImpl mgr,
DataType type,
boolean isFrozen,
Class<?> clazz)
Infers the data type from the specified class' superclass.
|
static DataTypeImpl.Definition |
inferDataTypeFrom(StatementManagerImpl mgr,
Field field,
boolean isFrozen)
Infers the data type from the specified field.
|
static Class<?> |
unwrapOptionalIfPresent(Class<?> clazz,
Type type)
Unwraps the specific class if it is an
Optional. |
static Type |
unwrapOptionalIfPresent(Type type)
Unwraps the specific type if it is an
Optional. |
public static Class<?> findClass(String name) throws ClassNotFoundException
Note: This method is designed to use the thread context class loader if set; otherwise it falls back to the primordial class loader.
name - the name of the class to find and loadnull classLinkageError - if the linkage failsExceptionInInitializerError - if the initialization provoked by this
method failsClassNotFoundException - if the class cannot be locatedpublic static Class<?> unwrapOptionalIfPresent(Class<?> clazz, Type type)
Optional.clazz - the class to unwrap if requiredtype - the corresponding type for the classpublic static Type unwrapOptionalIfPresent(Type type)
Optional.type - the type to unwrap if requiredpublic static boolean anyArgumentsInferred(List<CQLDataType> args)
args - the list of arguments to checktrue if at least one argument is defined to be
inferred; false otherwisepublic static DataTypeImpl.Definition inferDataTypeFrom(StatementManagerImpl mgr, Field field, boolean isFrozen)
mgr - the non-null statement managerfield - the field from which to infer the data typeisFrozen - true if the data type is frozen; false
otherwisenull data type definitionNullPointerException - if field is nullIllegalArgumentException - if the data type cannot be inferred from
the field or it is persisted but the persister cannot be instantiatepublic static DataTypeImpl.Definition inferDataTypeFrom(StatementManagerImpl mgr, DataType type, boolean isFrozen, Class<?> clazz)
mgr - the non-null statement managertype - the collection type being inferredisFrozen - true if the data type is frozen; false
otherwiseclazz - the class from which to infer the data type of its superclassnull data type definitionNullPointerException - if type or clazz is
nullIllegalArgumentException - if the argument data type cannot be inferred
from the superclass or the specified type is not a collection data typeCopyright (C) 2015-2017 The Helenus Driver Project Authors.