Interface DatastoreEntityConverter

All Superinterfaces:
org.springframework.data.convert.EntityReader<Object,com.google.cloud.datastore.BaseEntity>, org.springframework.data.convert.EntityWriter<Object,com.google.cloud.datastore.BaseEntity.Builder>
All Known Implementing Classes:
DefaultDatastoreEntityConverter

public interface DatastoreEntityConverter extends org.springframework.data.convert.EntityReader<Object,com.google.cloud.datastore.BaseEntity>, org.springframework.data.convert.EntityWriter<Object,com.google.cloud.datastore.BaseEntity.Builder>
An interface for converting objects to Datastore Entities and vice versa.
Since:
1.1
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the ReadWriteConversions used in this converter.
    getDiscriminationPersistentEntity(Class<T> entityClass, com.google.cloud.datastore.BaseEntity<?> entity)
    Provide a DatastorePersistentEntity with support for discriminator fields.
    <T, R> Map<T,R>
    readAsMap(com.google.cloud.datastore.BaseEntity entity, org.springframework.data.util.TypeInformation mapTypeInformation)
    Read the entity as a Map.
    <T, R> Map<T,R>
    readAsMap(Class<T> keyType, org.springframework.data.util.TypeInformation<R> componentType, com.google.cloud.datastore.BaseEntity entity)
    Read the entity as a Map when the map type is unknown.

    Methods inherited from interface org.springframework.data.convert.EntityReader

    read

    Methods inherited from interface org.springframework.data.convert.EntityWriter

    write
  • Method Details

    • getConversions

      ReadWriteConversions getConversions()
      Get the ReadWriteConversions used in this converter.
      Returns:
      the conversions used.
    • getDiscriminationPersistentEntity

      <T> DatastorePersistentEntity<T> getDiscriminationPersistentEntity(Class<T> entityClass, com.google.cloud.datastore.BaseEntity<?> entity)
      Provide a DatastorePersistentEntity with support for discriminator fields.
      Type Parameters:
      T - the type of the entity
      Parameters:
      entityClass - the entity class
      entity - the Datastore entity
      Returns:
      DatastorePersistentEntity for the entity type with support for discriminator fields.
    • readAsMap

      <T, R> Map<T,R> readAsMap(com.google.cloud.datastore.BaseEntity entity, org.springframework.data.util.TypeInformation mapTypeInformation)
      Read the entity as a Map.
      Type Parameters:
      T - the type of the key in the map
      R - the type of the value in the map
      Parameters:
      entity - the entity from Cloud Datastore.
      mapTypeInformation - the actual type of the map
      Returns:
      a Map where the key values are the field names and the values the field values.
    • readAsMap

      <T, R> Map<T,R> readAsMap(Class<T> keyType, org.springframework.data.util.TypeInformation<R> componentType, com.google.cloud.datastore.BaseEntity entity)
      Read the entity as a Map when the map type is unknown.
      Type Parameters:
      T - the type of the key in the map
      R - the type of the value in the map
      Parameters:
      keyType - the key type of the map to be read.
      componentType - the value type of the map, into which each field value will be converted.
      entity - the entity from Cloud Datastore.
      Returns:
      a Map where the key values are the field names and the values the field values.