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.Optionalcom.google.common.base.Optionalscala.Optionjavaslang.control.Optionio.vavr.control.Option
- Since:
- 2.4
- Author:
- Oliver Gierke, Mark Paluch, Christoph Strobl, Maciek Opała, Jens Schauder
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisSingleValue(Class<?> type) static voidregisterConvertersIn(ConverterRegistry registry) 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<?>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.
-