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 thePersistentProperty
to be handled.default Object
Reads the value into the type of the current property.default <T> T
Reads the value as the given type.default <T> T
read
(Object value, TypeInformation<T> target) Reads the value as the given type.default Object
Write to whatever type is considered best for the given source.default <T> T
Write as the given type.default <T> T
write
(Object value, TypeInformation<T> target) Write as the given type.
-
Method Details
-
getProperty
P getProperty()Return thePersistentProperty
to 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.
-