Package org.springframework.data.convert
Interface PropertyValueConversions
- All Known Implementing Classes:
SimplePropertyValueConversions
public interface PropertyValueConversions
PropertyValueConversions
provides access to converters
that may only be
applied to a specific property. Other than converters
registered in CustomConversions
, the property based variants accept and allow returning null
values and provide access to a store specific conversion context
.- Since:
- 2.7
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescription<DV,
SV, C extends PersistentProperty<C>, VCC extends ValueConversionContext<C>>
PropertyValueConverter<DV,SV, VCC> getValueConverter
(C property) Get thePropertyValueConverter
for the given property.boolean
hasValueConverter
(PersistentProperty<?> property) Check if aPropertyValueConverter
is present for the given property.static <P extends PersistentProperty<P>>
PropertyValueConversionssimple
(Consumer<PropertyValueConverterRegistrar<P>> config) Helper that allows to createPropertyValueConversions
instance with the configuredconverters
provided via the given callback.
-
Method Details
-
hasValueConverter
Check if aPropertyValueConverter
is present for the given property.- Parameters:
property
- must not be null.- Returns:
- true if a specific
PropertyValueConverter
is available.
-
getValueConverter
<DV,SV, PropertyValueConverter<DV,C extends PersistentProperty<C>, VCC extends ValueConversionContext<C>> SV, getValueConverterVCC> (C property) Get thePropertyValueConverter
for the given property.- Type Parameters:
DV
- domain-specific typeSV
- store-native typeC
- conversion context type- Parameters:
property
- must not be null.- Returns:
- the suitable
PropertyValueConverter
.
-
simple
static <P extends PersistentProperty<P>> PropertyValueConversions simple(Consumer<PropertyValueConverterRegistrar<P>> config) Helper that allows to createPropertyValueConversions
instance with the configuredconverters
provided via the given callback.
-