public class PropertyMappingHelper extends Object
| Constructor and Description |
|---|
PropertyMappingHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
getCassandraColumnValue(com.datastax.driver.core.Row row,
String col,
Class clazz,
Serializer serializer)
Returns value of specific column in the row returned by CQL statement.
|
static com.datastax.driver.core.DataType.Name |
getCassandraType(Class clazz)
Maps Cassandra type to specified Java type.
|
static PropertyDescriptor |
getPojoPropertyDescriptor(Class clazz,
String prop)
Returns property descriptor by class property name.
|
static List<PropertyDescriptor> |
getPojoPropertyDescriptors(Class clazz,
boolean primitive)
Extracts all property descriptors from a class.
|
static <T extends Annotation> |
getPojoPropertyDescriptors(Class clazz,
Class<T> annotation,
boolean primitive)
Extracts all property descriptors having specific annotation from a class.
|
static boolean |
isPrimitivePropertyDescriptor(PropertyDescriptor desc)
Checks if property descriptor describes primitive property (int, boolean, long and etc.)
|
public static com.datastax.driver.core.DataType.Name getCassandraType(Class clazz)
clazz - java class.public static PropertyDescriptor getPojoPropertyDescriptor(Class clazz, String prop)
clazz - class from which to get property descriptor.prop - name of the property.public static List<PropertyDescriptor> getPojoPropertyDescriptors(Class clazz, boolean primitive)
clazz - class which property descriptors should be extracted.primitive - boolean flag indicating that only property descriptors for primitive properties should be extracted.public static <T extends Annotation> List<PropertyDescriptor> getPojoPropertyDescriptors(Class clazz, Class<T> annotation, boolean primitive)
clazz - class which property descriptors should be extracted.annotation - annotation to look for.primitive - boolean flag indicating that only property descriptors for primitive properties should be extracted.public static boolean isPrimitivePropertyDescriptor(PropertyDescriptor desc)
desc - property descriptor.true property is primitivepublic static Object getCassandraColumnValue(com.datastax.driver.core.Row row, String col, Class clazz, Serializer serializer)
row - row returned by CQL statement.col - column name.clazz - java class to which column value should be casted.serializer - serializer to use if column stores BLOB otherwise could be null.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.8.12 Release Date : October 2 2017