public class DefaultDatastoreEntityConverter extends Object implements DatastoreEntityConverter
| Constructor and Description |
|---|
DefaultDatastoreEntityConverter(DatastoreMappingContext mappingContext,
ObjectToKeyFactory objectToKeyFactory) |
DefaultDatastoreEntityConverter(DatastoreMappingContext mappingContext,
ReadWriteConversions conversions) |
| Modifier and Type | Method and Description |
|---|---|
ReadWriteConversions |
getConversions()
Get the
ReadWriteConversions used in this converter. |
<R> R |
read(Class<R> aClass,
BaseEntity entity) |
<T,R> Map<T,R> |
readAsMap(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,
BaseEntity entity)
Read the entity as a
Map when the map type is unknown. |
void |
write(Object source,
BaseEntity.Builder sink) |
public DefaultDatastoreEntityConverter(DatastoreMappingContext mappingContext, ObjectToKeyFactory objectToKeyFactory)
public DefaultDatastoreEntityConverter(DatastoreMappingContext mappingContext, ReadWriteConversions conversions)
public ReadWriteConversions getConversions()
DatastoreEntityConverterReadWriteConversions used in this converter.getConversions in interface DatastoreEntityConverterpublic <T,R> Map<T,R> readAsMap(BaseEntity entity, org.springframework.data.util.TypeInformation mapTypeInformation)
DatastoreEntityConverterMap.readAsMap in interface DatastoreEntityConverterT - the type of the key in the mapR - the type of the value in the mapentity - the entity from Cloud Datastore.mapTypeInformation - the actual type of the mappublic <T,R> Map<T,R> readAsMap(Class<T> keyType, org.springframework.data.util.TypeInformation<R> componentType, BaseEntity entity)
DatastoreEntityConverterMap when the map type is unknown.readAsMap in interface DatastoreEntityConverterT - the type of the key in the mapR - the type of the value in the mapkeyType - 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.public <R> R read(Class<R> aClass, BaseEntity entity)
read in interface org.springframework.data.convert.EntityReader<Object,BaseEntity>public void write(Object source, BaseEntity.Builder sink)
write in interface org.springframework.data.convert.EntityWriter<Object,BaseEntity.Builder>Copyright © 2020 Pivotal Software, Inc.. All rights reserved.