Package org.springframework.data.convert
Interface ValueConversionContext<P extends PersistentProperty<P>>
public interface ValueConversionContext<P extends PersistentProperty<P>>
The
ValueConversionContext provides access to the store-specific PersistentProperty and allows to
call the store-default conversion through the read/write methods.
Store implementations should provide their own flavor of ValueConversionContext enhancing the existing API,
implementing delegates for read(Object, TypeInformation), write(Object, TypeInformation).
- Author:
- Christoph Strobl, Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptionReturn thePersistentPropertyto be handled.default ObjectReads the value into the type of the current property.default <T> TReads the value as the given type.default <T> Tread(Object value, TypeInformation<T> target) Reads the value as the given type.default ObjectWrite to whatever type is considered best for the given source.default <T> TWrite as the given type.default <T> Twrite(Object value, TypeInformation<T> target) Write as the given type.
-
Method Details
-
getProperty
P getProperty()Return thePersistentPropertyto be handled.- Returns:
- will never be null.
-
write
Write to whatever type is considered best for the given source.- Parameters:
value-- Returns:
-
write
Write as the given type.- Parameters:
value- can be null.target- must not be null.- Returns:
- can be null.
-
write
Write as the given type.- Parameters:
value- can be null.target- must not be null.- Returns:
- can be null.
-
read
Reads the value into the type of the current property.- Parameters:
value- can be null.- Returns:
- can be null.
-
read
Reads the value as the given type.- Parameters:
value- can be null.target- must not be null.- Returns:
- can be null.
-
read
Reads the value as the given type.- Parameters:
value- can be null.target- must not be null.- Returns:
- can be null.
-