public class PropertyValueConversionService extends Object
CustomConversions
used to convert domain and store values using
property-specific converters
.PropertyValueConverter
Constructor and Description |
---|
PropertyValueConversionService(CustomConversions conversions)
Constructs a new instance of the
PropertyValueConversionService initialized with the given,
required CustomConversions for resolving the PropertyValueConversions used to
convert PersistentProperty values during data access operations. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasConverter(PersistentProperty<?> property)
Return true if a
PropertyValueConverter is registered for the PersistentProperty . |
<P extends PersistentProperty<P>,VCC extends ValueConversionContext<P>> |
read(Object value,
P property,
VCC context)
Convert a value from its store-native representation into its domain-specific type.
|
<P extends PersistentProperty<P>,VCC extends ValueConversionContext<P>> |
write(Object value,
P property,
VCC context)
Convert a value from its domain-specific value into its store-native representation.
|
public PropertyValueConversionService(@NonNull CustomConversions conversions)
PropertyValueConversionService
initialized with the given,
required CustomConversions
for resolving the PropertyValueConversions
used to
convert PersistentProperty
values during data access operations.conversions
- CustomConversions
used to handle domain and store type conversions;
must not be null.IllegalArgumentException
- if CustomConversions
is null.CustomConversions
public boolean hasConverter(PersistentProperty<?> property)
PropertyValueConverter
is registered for the PersistentProperty
.
If this method returns true, it means read(Object, PersistentProperty, ValueConversionContext)
and write(Object, PersistentProperty, ValueConversionContext)
are capable of handling conversions.
property
- property
to evaluate for registration.PropertyValueConverter
is registered for the PersistentProperty
.PersistentProperty
@Nullable public <P extends PersistentProperty<P>,VCC extends ValueConversionContext<P>> Object read(@Nullable Object value, P property, VCC context)
P
- property type.VCC
- value conversion context type.value
- the value to convert. Can be null
.property
- the underlying property.context
- the context object.null
.@Nullable public <P extends PersistentProperty<P>,VCC extends ValueConversionContext<P>> Object write(@Nullable Object value, P property, VCC context)
P
- property type.VCC
- value conversion context type.value
- the value to convert. Can be null
.property
- the underlying property.context
- the context object.null
.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.