public interface ValueConversionContext<P extends PersistentProperty<P>>
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).
| Modifier and Type | Method and Description |
|---|---|
P |
getProperty()
Return the
PersistentProperty to be handled. |
default Object |
read(Object value)
Reads the value into the type of the current property.
|
default <T> T |
read(Object value,
Class<T> target)
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(Object value)
Write to whatever type is considered best for the given source.
|
default <T> T |
write(Object value,
Class<T> target)
Write as the given type.
|
default <T> T |
write(Object value,
TypeInformation<T> target)
Write as the given type.
|
P getProperty()
PersistentProperty to be handled.@Nullable default Object write(@Nullable Object value)
value - @Nullable default <T> T write(@Nullable Object value, Class<T> target)
value - can be null.target - must not be null.@Nullable default <T> T write(@Nullable Object value, TypeInformation<T> target)
value - can be null.target - must not be null.@Nullable default Object read(@Nullable Object value)
value - can be null.@Nullable default <T> T read(@Nullable Object value, Class<T> target)
value - can be null.target - must not be null.@Nullable default <T> T read(@Nullable Object value, TypeInformation<T> target)
value - can be null.target - must not be null.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.