Class CassandraSimpleTypeHolder

java.lang.Object
org.springframework.data.mapping.model.SimpleTypeHolder
org.springframework.data.cassandra.core.mapping.CassandraSimpleTypeHolder

public class CassandraSimpleTypeHolder extends SimpleTypeHolder
Simple constant holder for a SimpleTypeHolder enriched with Cassandra specific simple types.
Author:
Alex Shvid, Matthew T. Adams, Mark Paluch, Antoine Toulme
  • Field Details

    • CASSANDRA_SIMPLE_TYPES

      public static final Set<Class<?>> CASSANDRA_SIMPLE_TYPES
      Set of Cassandra simple types.
    • HOLDER

      public static final SimpleTypeHolder HOLDER
  • Method Details

    • getDataTypeFor

      @Nullable public static com.datastax.oss.driver.api.core.type.DataType getDataTypeFor(Class<?> javaType)
      Returns the default DataType for a Class. This method resolves only simple types to a Cassandra DataType. Other types are resolved to null.
      Parameters:
      javaType - must not be null.
      Returns:
      the DataType for javaClass if resolvable, otherwise null.
    • getRequiredDataTypeFor

      public static com.datastax.oss.driver.api.core.type.DataType getRequiredDataTypeFor(Class<?> javaType)
      Returns the required default DataType for a Class. This method resolves only simple types to a Cassandra DataType. Throws IllegalStateException if the Class cannot be resolved to a DataType.
      Parameters:
      javaType - must not be null.
      Returns:
      the DataType for javaClass if resolvable, otherwise null.
      Throws:
      IllegalStateException - if the Class cannot be resolved to a DataType.
      Since:
      3.1.6
      See Also:
    • getDataTypeFor

      @Nullable public static com.datastax.oss.driver.api.core.type.DataType getDataTypeFor(CassandraType.Name dataTypeName)
      Returns the DataType for a CassandraType.Name.
      Parameters:
      dataTypeName - must not be null.
      Returns:
      the DataType for CassandraType.Name.
    • getRequiredDataTypeFor

      public static com.datastax.oss.driver.api.core.type.DataType getRequiredDataTypeFor(CassandraType.Name dataTypeName)
      Returns the required DataType for a CassandraType.Name. Throws IllegalStateException if the CassandraType.Name cannot be resolved to a DataType.
      Parameters:
      dataTypeName - must not be null.
      Returns:
      the DataType for CassandraType.Name.
      Throws:
      IllegalStateException - if the CassandraType.Name cannot be resolved to a DataType.
      Since:
      3.1.6
      See Also: