Package org.springframework.data.convert
Interface PropertyValueConverter<DV,SV,C extends ValueConversionContext<? extends PersistentProperty<?>>>
- Type Parameters:
DV
- domain-specific type.SV
- store-native type.C
- the store specificconversion context
.
- All Known Implementing Classes:
PropertyValueConverter.FunctionPropertyValueConverter
,PropertyValueConverter.ObjectToObjectPropertyValueConverter
public interface PropertyValueConverter<DV,SV,C extends ValueConversionContext<? extends PersistentProperty<?>>>
PropertyValueConverter
provides a symmetric way of converting certain properties from domain to
store-specific values.
A PropertyValueConverter
is, other than a ReadingConverter
or WritingConverter
, only applied
to special annotated fields which allows a fine-grained conversion of certain values within a specific context.
- Since:
- 2.7
- Author:
- Christoph Strobl
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
APropertyValueConverter
that delegates conversion to the givenBiFunction
s.static enum
No-opPropertyValueConverter
implementation. -
Method Summary
-
Method Details
-
read
Convert the given store specific value into it's domain value representation. Typically, a read operation.- Parameters:
value
- can be null.context
- never null.- Returns:
- the converted value. Can be null.
-
write
Convert the given domain-specific value into it's native store representation. Typically, a write operation.- Parameters:
value
- can be null.context
- never null.- Returns:
- the converted value. Can be null.
-