Package org.springframework.data.convert
Class PropertyValueConverter.FunctionPropertyValueConverter<DV,SV,P extends PersistentProperty<P>>
java.lang.Object
org.springframework.data.convert.PropertyValueConverter.FunctionPropertyValueConverter<DV,SV,P>
- All Implemented Interfaces:
PropertyValueConverter<DV,
SV, ValueConversionContext<P>>
- Enclosing interface:
- PropertyValueConverter<DV,
SV, C extends ValueConversionContext<? extends PersistentProperty<?>>>
public static class PropertyValueConverter.FunctionPropertyValueConverter<DV,SV,P extends PersistentProperty<P>>
extends Object
implements PropertyValueConverter<DV,SV,ValueConversionContext<P>>
A
PropertyValueConverter
that delegates conversion to the given BiFunction
s.- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.convert.PropertyValueConverter
PropertyValueConverter.FunctionPropertyValueConverter<DV,
SV, P extends PersistentProperty<P>>, PropertyValueConverter.ObjectToObjectPropertyValueConverter -
Constructor Summary
ConstructorDescriptionFunctionPropertyValueConverter
(BiFunction<DV, ValueConversionContext<P>, SV> writer, BiFunction<SV, ValueConversionContext<P>, DV> reader) -
Method Summary
Modifier and TypeMethodDescriptionread
(SV value, ValueConversionContext<P> context) Convert the given store specific value into it's domain value representation.write
(DV value, ValueConversionContext<P> context) Convert the given domain-specific value into it's native store representation.
-
Constructor Details
-
FunctionPropertyValueConverter
public FunctionPropertyValueConverter(BiFunction<DV, ValueConversionContext<P>, SV> writer, BiFunction<SV, ValueConversionContext<P>, DV> reader)
-
-
Method Details
-
write
Description copied from interface:PropertyValueConverter
Convert the given domain-specific value into it's native store representation. Typically, a write operation.- Specified by:
write
in interfacePropertyValueConverter<DV,
SV, P extends PersistentProperty<P>> - Parameters:
value
- can be null.context
- never null.- Returns:
- the converted value. Can be null.
-
read
Description copied from interface:PropertyValueConverter
Convert the given store specific value into it's domain value representation. Typically, a read operation.- Specified by:
read
in interfacePropertyValueConverter<DV,
SV, P extends PersistentProperty<P>> - Parameters:
value
- can be null.context
- never null.- Returns:
- the converted value. Can be null.
-