Package org.springframework.data.util
Class NullableWrapperConverters
java.lang.Object
org.springframework.data.util.NullableWrapperConverters
Converters to wrap and unwrap nullable wrapper types potentially being available on the classpath. Currently
supported:
java.util.Optional
com.google.common.base.Optional
scala.Option
javaslang.control.Option
io.vavr.control.Option
- Since:
- 2.4
- Author:
- Oliver Gierke, Mark Paluch, Christoph Strobl, Maciek Opała, Jens Schauder
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isSingleValue
(Class<?> type) static void
registerConvertersIn
(ConverterRegistry registry) 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<?>
unwrapActualType
(TypeInformation<?> type) Recursively unwraps well known wrapper types from the givenTypeInformation
.
-
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
-
registerConvertersIn
Registers converters for wrapper types found on the classpath.- Parameters:
registry
- 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:
-
unwrapActualType
Recursively unwraps well known wrapper types from the givenTypeInformation
.- Parameters:
type
- must not be null.- Returns:
- will never be null.
-