Package org.springframework.data.convert
Class PropertyValueConversionService
java.lang.Object
org.springframework.data.convert.PropertyValueConversionService
Conversion service based on 
CustomConversions used to convert domain and store values using
 property-specific converters.- Since:
- 2.7
- Author:
- Mark Paluch
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionPropertyValueConversionService(CustomConversions conversions) Constructs a new instance of thePropertyValueConversionServiceinitialized with the given, requiredCustomConversionsfor resolving thePropertyValueConversionsused to convertPersistentPropertyvalues during data access operations.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanhasConverter(PersistentProperty<?> property) Return true if aPropertyValueConverteris registered for thePersistentProperty.<P extends PersistentProperty<P>,VCC extends ValueConversionContext<P>> 
 ObjectConvert a value from its store-native representation into its domain-specific type.<P extends PersistentProperty<P>,VCC extends ValueConversionContext<P>> 
 ObjectConvert a value from its domain-specific value into its store-native representation.
- 
Constructor Details- 
PropertyValueConversionServiceConstructs a new instance of thePropertyValueConversionServiceinitialized with the given, requiredCustomConversionsfor resolving thePropertyValueConversionsused to convertPersistentPropertyvalues during data access operations.- Parameters:
- conversions-- CustomConversionsused to handle domain and store type conversions; must not be null.
- Throws:
- IllegalArgumentException- if- CustomConversionsis null.
- See Also:
 
 
- 
- 
Method Details- 
hasConverterReturn true if aPropertyValueConverteris registered for thePersistentProperty.If this method returns true, it means read(Object, PersistentProperty, ValueConversionContext)andwrite(Object, PersistentProperty, ValueConversionContext)are capable of handling conversions.- Parameters:
- property-- propertyto evaluate for registration.
- Returns:
- true if a PropertyValueConverteris registered for thePersistentProperty.
- See Also:
 
- 
read@Nullable public <P extends PersistentProperty<P>,VCC extends ValueConversionContext<P>> Object read(@Nullable Object value, P property, VCC context) Convert a value from its store-native representation into its domain-specific type.- Type Parameters:
- P- property type.
- VCC- value conversion context type.
- Parameters:
- value- the value to convert. Can be- null.
- property- the underlying property.
- context- the context object.
- Returns:
- the value to be used in the domain model. Can be null.
 
- 
write@Nullable public <P extends PersistentProperty<P>,VCC extends ValueConversionContext<P>> Object write(@Nullable Object value, P property, VCC context) Convert a value from its domain-specific value into its store-native representation.- Type Parameters:
- P- property type.
- VCC- value conversion context type.
- Parameters:
- value- the value to convert. Can be- null.
- property- the underlying property.
- context- the context object.
- Returns:
- the value to be written to the data store. Can be null.
 
 
-