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.Futurejava.util.concurrent.CompletableFutureorg.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
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic final class -
Method Summary
Modifier and TypeMethodDescriptionReturns the types that are supported on paginating query methods.getExecutionAdapter(Class<?> returnType) Returns theQueryExecutionConverters.ExecutionAdapterto be used for the given return type.static booleanisSingleValue(Class<?> type) static voidregisterConvertersIn(ConfigurableConversionService conversionService) Registers converters for wrapper types found on the classpath.static booleanReturns whether the given type is a supported wrapper type.static booleansupportsUnwrapping(Class<?> type) Returns whether the given wrapper type supports unwrapping.static ObjectUnwraps 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 givenTypeInformationbut 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
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 givenTypeInformationbut 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.ExecutionAdapterto be used for the given return type.- Parameters:
returnType- must not be null.- Returns:
- can be null.
-