Module spring.data.elasticsearch
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 Converters.
- Since:
- 5.3
- Author:
- Haibo Liu
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class<?> sourceType, Class<?> targetType) booleancanConvert(TypeDescriptor sourceType, TypeDescriptor targetType) <T> Tconvert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) getInstance(ConversionService conversionService) Get aElasticsearchQueryValueConversionServicewith this conversion service as delegated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.convert.ConversionService
convert
-
Method Details
-
getInstance
public static ElasticsearchQueryValueConversionService getInstance(ConversionService conversionService) Get aElasticsearchQueryValueConversionServicewith 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:
canConvertin interfaceConversionService
-
canConvert
- Specified by:
canConvertin interfaceConversionService
-
convert
- Specified by:
convertin interfaceConversionService
-
convert
@Nullable public Object convert(@Nullable Object source, @Nullable TypeDescriptor sourceType, TypeDescriptor targetType) - Specified by:
convertin interfaceConversionService
-