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
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturn thePersistentProperty
to be handled.default Object
Reads the value as an instance of theproperty type
.default <T> T
Reads the value as an instance oftype
.default <T> T
read
(Object value, TypeInformation<T> target) Reads the value as an instance oftype
.default Object
Write the value as an instance of theproperty type
.default <T> T
Write the value as an instance oftype
.default <T> T
write
(Object value, TypeInformation<T> target) Write the value as an instance oftype
.
-
Method Details
-
getProperty
P getProperty()Return thePersistentProperty
to be handled.- Returns:
- will never be null.
- See Also:
-
write
Write the value as an instance of theproperty type
.- Parameters:
value
-value
to write; can be null.- Returns:
- can be null.
- Throws:
IllegalStateException
- if value cannot be written as an instance of theproperty type
.- See Also:
-
write
Write the value as an instance oftype
.- Parameters:
value
-value
to write; can be null.target
-type
of value to be written; must not be null.- Returns:
- can be null.
- Throws:
IllegalStateException
- if value cannot be written as an instance oftype
.- See Also:
-
write
Write the value as an instance oftype
.- Parameters:
value
-value
to write; can be null.target
-type
of value to be written; must not be null.- Returns:
- can be null.
- Throws:
IllegalStateException
- if value cannot be written as an instance oftype
.- See Also:
-
read
Reads the value as an instance of theproperty type
.- Parameters:
value
-value
to be read; can be null.- Returns:
- can be null.
- Throws:
IllegalStateException
- if value cannot be read as an instance of theproperty type
.- See Also:
-
read
Reads the value as an instance oftype
.- Parameters:
value
-value
to be read; can be null.target
-type
of value to be read; must not be null.- Returns:
- can be null.
- Throws:
IllegalStateException
- if value cannot be read as an instance oftype
.- See Also:
-
read
Reads the value as an instance oftype
.- Parameters:
value
-value
to be read; can be null.target
-type
of value to be read; must not be null.- Returns:
- can be null.
- Throws:
IllegalStateException
- if value cannot be read as an instance oftype
.- See Also:
-