public static class PropertyValueConverter.FunctionPropertyValueConverter<DV,SV,P extends PersistentProperty<P>> extends Object implements PropertyValueConverter<DV,SV,ValueConversionContext<P>>
PropertyValueConverter
that delegates conversion to the given BiFunction
s.PropertyValueConverter.FunctionPropertyValueConverter<DV,SV,P extends PersistentProperty<P>>, PropertyValueConverter.ObjectToObjectPropertyValueConverter
Constructor and Description |
---|
FunctionPropertyValueConverter(BiFunction<DV,ValueConversionContext<P>,SV> writer,
BiFunction<SV,ValueConversionContext<P>,DV> reader) |
Modifier and Type | Method and Description |
---|---|
DV |
read(SV value,
ValueConversionContext<P> context)
Convert the given store specific value into it's domain value representation.
|
DV |
readNull(ValueConversionContext<P> context)
Convert the given
null value from the store into its domain value representation. |
SV |
write(DV value,
ValueConversionContext<P> context)
Convert the given domain-specific value into it's native store representation.
|
SV |
writeNull(ValueConversionContext<P> context)
Convert the given
null value from the domain model into it's native store representation. |
public FunctionPropertyValueConverter(@NonNull BiFunction<DV,ValueConversionContext<P>,SV> writer, @NonNull BiFunction<SV,ValueConversionContext<P>,DV> reader)
@Nullable public SV write(@Nullable DV value, @NonNull ValueConversionContext<P> context)
PropertyValueConverter
write
in interface PropertyValueConverter<DV,SV,ValueConversionContext<P extends PersistentProperty<P>>>
value
- value to write; can be null.context
- ValueConversionContext
containing store-specific metadata
used in the value conversion; never null.public SV writeNull(@NonNull ValueConversionContext<P> context)
PropertyValueConverter
null
value from the domain model into it's native store representation. Typically, a
write operation. Returns null
by default.writeNull
in interface PropertyValueConverter<DV,SV,ValueConversionContext<P extends PersistentProperty<P>>>
context
- ValueConversionContext
containing store-specific metadata
used in the value conversion; never null.@Nullable public DV read(@Nullable SV value, @NonNull ValueConversionContext<P> context)
PropertyValueConverter
read
in interface PropertyValueConverter<DV,SV,ValueConversionContext<P extends PersistentProperty<P>>>
value
- value to read.context
- ValueConversionContext
containing store-specific metadata
used in the value conversion; never null.public DV readNull(@NonNull ValueConversionContext<P> context)
PropertyValueConverter
null
value from the store into its domain value representation. Typically, a
read operation. Returns null
by default.readNull
in interface PropertyValueConverter<DV,SV,ValueConversionContext<P extends PersistentProperty<P>>>
context
- ValueConversionContext
containing store-specific metadata
used in the value conversion; never null.Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.