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, P extends PersistentProperty<P>, VCC extends ValueConversionContext<P>>
PropertyValueConverter<DV,SV, VCC> getValueConverter(P property) booleanhasValueConverter(PersistentProperty<?> property) static <P extends PersistentProperty<P>>
PropertyValueConversionssimple(Consumer<PropertyValueConverterRegistrar<P>> config) Helper method used to create aPropertyValueConversionsinstance with the configuredconvertersprovided by thecallback.
-
Method Details
-
hasValueConverter
- Parameters:
property-PersistentPropertyto evaluate; must not be null.- Returns:
- true if a specific
converteris registered for the givenPersistentProperty. - See Also:
-
getValueConverter
<DV,SV, PropertyValueConverter<DV,P extends PersistentProperty<P>, VCC extends ValueConversionContext<P>> SV, getValueConverterVCC> (P property) - Type Parameters:
DV- domain-specific typeSV- store-native typeP- conversion context type- Parameters:
property-PersistentPropertyused to look up the registeredPropertyValueConverter; must not be null.- Returns:
- the
PropertyValueConverterregistered for the givenPersistentProperty; never null. - Throws:
IllegalArgumentException- if noPropertyValueConverterwas registered for the givenPersistentProperty.- See Also:
-
simple
static <P extends PersistentProperty<P>> PropertyValueConversions simple(Consumer<PropertyValueConverterRegistrar<P>> config) Helper method used to create aPropertyValueConversionsinstance with the configuredconvertersprovided by thecallback.
-