Class QueryExecutionConverters
java.lang.Object
org.springframework.data.repository.util.QueryExecutionConverters
Converters to potentially wrap the execution of a repository method into a variety of wrapper types potentially being
available on the classpath. Currently supported:
java.util.concurrent.Future
java.util.concurrent.CompletableFuture
org.springframework.util.concurrent.ListenableFuture<
javaslang.collection.Seq
,javaslang.collection.Map
,javaslang.collection.Set
- as of 1.13io.vavr.collection.Seq
,io.vavr.collection.Map
,io.vavr.collection.Set
- as of 2.0- Reactive wrappers supported by
ReactiveWrappers
- as of 2.0
- Since:
- 1.8
- Author:
- Oliver Gierke, Mark Paluch, Christoph Strobl, Maciek Opała, Jens Schauder
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static final class
-
Method Summary
Modifier and TypeMethodDescriptionReturns the types that are supported on paginating query methods.getExecutionAdapter
(Class<?> returnType) Returns theQueryExecutionConverters.ExecutionAdapter
to be used for the given return type.static boolean
isSingleValue
(Class<?> type) static void
registerConvertersIn
(org.springframework.core.convert.support.ConfigurableConversionService conversionService) Registers converters for wrapper types found on the classpath.static boolean
Returns whether the given type is a supported wrapper type.static boolean
supportsUnwrapping
(Class<?> type) Returns whether the given wrapper type supports unwrapping.static Object
Unwraps the given source value in case it's one of the currently supported wrapper types detected at runtime.static TypeInformation<?>
unwrapWrapperTypes
(TypeInformation<?> type) Recursively unwraps well known wrapper types from the givenTypeInformation
.static TypeInformation<?>
unwrapWrapperTypes
(TypeInformation<?> type, TypeInformation<?> reference) Recursively unwraps well known wrapper types from the givenTypeInformation
but aborts at the given reference type.
-
Method Details
-
supports
Returns whether the given type is a supported wrapper type.- Parameters:
type
- must not be null.- Returns:
-
supportsUnwrapping
Returns whether the given wrapper type supports unwrapping.- Parameters:
type
- must not be null.- Returns:
-
isSingleValue
-
getAllowedPageableTypes
Returns the types that are supported on paginating query methods. Will include custom collection types of e.g. Vavr.- Returns:
-
registerConvertersIn
public static void registerConvertersIn(org.springframework.core.convert.support.ConfigurableConversionService conversionService) Registers converters for wrapper types found on the classpath.- Parameters:
conversionService
- must not be null.
-
unwrap
Unwraps the given source value in case it's one of the currently supported wrapper types detected at runtime.- Parameters:
source
- can be null.- Returns:
-
unwrapWrapperTypes
public static TypeInformation<?> unwrapWrapperTypes(TypeInformation<?> type, TypeInformation<?> reference) Recursively unwraps well known wrapper types from the givenTypeInformation
but aborts at the given reference type.- Parameters:
type
- must not be null.reference
- must not be null.- Returns:
- will never be null.
-
unwrapWrapperTypes
Recursively unwraps well known wrapper types from the givenTypeInformation
.- Parameters:
type
- must not be null.- Returns:
- will never be null.
-
getExecutionAdapter
@Nullable public static QueryExecutionConverters.ExecutionAdapter getExecutionAdapter(Class<?> returnType) Returns theQueryExecutionConverters.ExecutionAdapter
to be used for the given return type.- Parameters:
returnType
- must not be null.- Returns:
- can be null.
-