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 thePropertyValueConverterfor the given property.booleanhasValueConverter(PersistentProperty<?> property) Check if aPropertyValueConverteris present for the given property.static <P extends PersistentProperty<P>>
PropertyValueConversionssimple(Consumer<PropertyValueConverterRegistrar<P>> config) Helper that allows to createPropertyValueConversionsinstance with the configuredconvertersprovided via the given callback.
-
Method Details
-
hasValueConverter
Check if aPropertyValueConverteris present for the given property.- Parameters:
property- must not be null.- Returns:
- true if a specific
PropertyValueConverteris available.
-
getValueConverter
<DV,SV, PropertyValueConverter<DV,C extends PersistentProperty<C>, VCC extends ValueConversionContext<C>> SV, getValueConverterVCC> (C property) Get thePropertyValueConverterfor 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 createPropertyValueConversionsinstance with the configuredconvertersprovided via the given callback.
-