public interface PropertyValueConverterFactory
value converters
.
Depending on the applications' need factories
can be chained
and the resulting converter
may be
cached
.
@Nullable default <DV,SV,P extends ValueConversionContext<?>> PropertyValueConverter<DV,SV,P> getConverter(PersistentProperty<?> property)
PropertyValueConverter
applicable for the given PersistentProperty
.DV
- domain-specific type.SV
- store-native type.P
- value conversion context to use.property
- must not be null.@Nullable <DV,SV,C extends ValueConversionContext<?>> PropertyValueConverter<DV,SV,C> getConverter(Class<? extends PropertyValueConverter<DV,SV,C>> converterType)
DV
- domain-specific type.SV
- store-native type.C
- value conversion context to use.converterType
- must not be null.static PropertyValueConverterFactory simple()
PropertyValueConverterFactory
capable of instantiating PropertyValueConverter
implementations via their default Constructor
or in case of an Enum
accessing the
first enum value.PropertyValueConverterFactory
.static PropertyValueConverterFactory beanFactoryAware(BeanFactory beanFactory)
PropertyValueConverterFactory
capable of looking up/creating the PropertyValueConverter
via the given BeanFactory
.beanFactory
- must not be null.PropertyValueConverterFactory
.static PropertyValueConverterFactory configuredInstance(ValueConverterRegistry<?> registrar)
PropertyValueConverterFactory
capable of looking up the PropertyValueConverter
in the
given PropertyValueConverterRegistrar
.registrar
- must not be null.PropertyValueConverterFactory
.static PropertyValueConverterFactory chained(PropertyValueConverterFactory... factories)
PropertyValueConverterFactory
that will try to obtain a PropertyValueConverter
from the
given array of factories
by returning the first non null one.factories
- must not be null nor contain null values.PropertyValueConverterFactory
.static PropertyValueConverterFactory chained(List<PropertyValueConverterFactory> factoryList)
PropertyValueConverterFactory
that will try to obtain a PropertyValueConverter
from the
given list of factories
by returning the first non null one.factoryList
- must not be null nor contain null values.PropertyValueConverterFactory
.static PropertyValueConverterFactory caching(PropertyValueConverterFactory factory)
PropertyValueConverterFactory
that will cache PropertyValueConverter
instances per
PersistentProperty
.factory
- must not be null.PropertyValueConverterFactory
.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.