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) boolean
hasValueConverter
(PersistentProperty<?> property) static <P extends PersistentProperty<P>>
PropertyValueConversionssimple
(Consumer<PropertyValueConverterRegistrar<P>> config) Helper method used to create aPropertyValueConversions
instance with the configuredconverters
provided by thecallback
.
-
Method Details
-
hasValueConverter
- Parameters:
property
-PersistentProperty
to evaluate; must not be null.- Returns:
- true if a specific
converter
is 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
-PersistentProperty
used to look up the registeredPropertyValueConverter
; must not be null.- Returns:
- the
PropertyValueConverter
registered for the givenPersistentProperty
; never null. - Throws:
IllegalArgumentException
- if noPropertyValueConverter
was registered for the givenPersistentProperty
.- See Also:
-
simple
static <P extends PersistentProperty<P>> PropertyValueConversions simple(Consumer<PropertyValueConverterRegistrar<P>> config) Helper method used to create aPropertyValueConversions
instance with the configuredconverters
provided by thecallback
.
-