Interface CouchbaseConverter
- All Superinterfaces:
CouchbaseWriter<Object,
,CouchbaseDocument> EntityConverter<CouchbasePersistentEntity<?>,
,CouchbasePersistentProperty, Object, CouchbaseDocument> EntityReader<Object,
,CouchbaseDocument> EntityWriter<Object,
CouchbaseDocument>
- All Known Implementing Classes:
AbstractCouchbaseConverter
,MappingCouchbaseConverter
public interface CouchbaseConverter
extends EntityConverter<CouchbasePersistentEntity<?>,CouchbasePersistentProperty,Object,CouchbaseDocument>, CouchbaseWriter<Object,CouchbaseDocument>, EntityReader<Object,CouchbaseDocument>
Marker interface for the converter, identifying the types to and from that can be converted.
- Author:
- Michael Nitschinger, Simon Baslé, Michael Reiche
-
Method Summary
Modifier and TypeMethodDescriptionconvertForWriteIfNeeded
(Object value) Convert the value if necessary to the class that would actually be stored, or leave it as is if no conversion needed.convertForWriteIfNeeded
(CouchbasePersistentProperty source, ConvertingPropertyAccessor<Object> accessor, boolean processValueConverter) Convert the value if necessary to the class that would actually be stored, or leave it as is if no conversion needed.return the conversionsgetTypeAlias
(TypeInformation<?> info) Class<?>
getWriteClassFor
(Class<?> clazz) Return the Class that would actually be stored for a given Class.Methods inherited from interface org.springframework.data.convert.EntityConverter
getConversionService, getMappingContext
Methods inherited from interface org.springframework.data.convert.EntityReader
read
Methods inherited from interface org.springframework.data.convert.EntityWriter
write
-
Method Details
-
convertForWriteIfNeeded
Convert the value if necessary to the class that would actually be stored, or leave it as is if no conversion needed. This method cannot access the annotations of the field.- Parameters:
value
- the value to be converted to the class that would actually be stored.- Returns:
- the converted value (or the same value if no conversion necessary).
-
convertForWriteIfNeeded
Object convertForWriteIfNeeded(CouchbasePersistentProperty source, ConvertingPropertyAccessor<Object> accessor, boolean processValueConverter) Convert the value if necessary to the class that would actually be stored, or leave it as is if no conversion needed. This method can access the annotations of the field.- Parameters:
source
- the property to be converted to the class that would actually be stored.accessor
- the property accessor- Returns:
- the converted value (or the same value if no conversion necessary).
-
getWriteClassFor
Return the Class that would actually be stored for a given Class.- Parameters:
clazz
- the source class.- Returns:
- the target class that would actually be stored.
- See Also:
-
getTypeKey
String getTypeKey()- Returns:
- the name of the field that will hold type information.
-
getTypeAlias
- Returns:
- the alias value for the type
-
getConversions
CustomConversions getConversions()return the conversions- Returns:
- conversions
-