public static < T > CellValidator cellValidator ( T obj ) { if ( obj == null ) { return null ; } Kind kind = Kind . objectToKind ( obj ) ; AbstractType < ? > tAbstractType = CassandraUtils . marshallerInstance ( obj ) ; String validatorClassName = tAbstractType . getClass ( ) . getCanonicalName ( ) ; Collection < String > validatorTypes = null ; DataType . Name cqlTypeName = MAP_JAVA_TYPE_TO_DATA_TYPE_NAME . get ( validatorClassName ) ; // tAbstractType.get return new CellValidator ( validatorClassName , kind , validatorTypes , cqlTypeName ) ; }
Generates a CellValidator for a generic instance of an object . We need the actual instance in order to differentiate between an UUID and a TimeUUID .