Class ElasticsearchQueryValueConversionService
java.lang.Object
org.springframework.data.elasticsearch.repository.support.value.ElasticsearchQueryValueConversionService
- All Implemented Interfaces:
ConversionService
A
ConversionService
using custom converters to handle query values in elasticsearch query. If the value to be
converted beyond the scope of custom converters, it'll delegate to the delegated conversion
service
.
This is a better solution for converting query values in elasticsearch query, because it has all the capability the
delegated conversion service
has, especially for user-registered Converter
s.
- Since:
- 5.3
- Author:
- Haibo Liu
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert
(Class<?> sourceType, Class<?> targetType) boolean
canConvert
(TypeDescriptor sourceType, TypeDescriptor targetType) <T> T
convert
(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) getInstance
(ConversionService conversionService) Get aElasticsearchQueryValueConversionService
with this conversion service as delegated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.convert.ConversionService
convert
-
Method Details
-
getInstance
public static ElasticsearchQueryValueConversionService getInstance(ConversionService conversionService) Get aElasticsearchQueryValueConversionService
with this conversion service as delegated.- Parameters:
conversionService
- conversion service as delegated- Returns:
- a conversion service having the capability to convert query values in elasticsearch query
-
canConvert
- Specified by:
canConvert
in interfaceConversionService
-
canConvert
- Specified by:
canConvert
in interfaceConversionService
-
convert
- Specified by:
convert
in interfaceConversionService
-
convert
@Nullable public Object convert(@Nullable Object source, @Nullable TypeDescriptor sourceType, TypeDescriptor targetType) - Specified by:
convert
in interfaceConversionService
-