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 SummaryModifier 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- 
supportsReturns whether the given type is a supported wrapper type.- Parameters:
- type- must not be null.
- Returns:
 
- 
supportsUnwrappingReturns whether the given wrapper type supports unwrapping.- Parameters:
- type- must not be null.
- Returns:
 
- 
isSingleValue
- 
registerConvertersInRegisters converters for wrapper types found on the classpath.- Parameters:
- registry- must not be null.
 
- 
unwrapUnwraps the given source value in case it's one of the currently supported wrapper types detected at runtime.- Parameters:
- source- can be null.
- Returns:
 
- 
unwrapActualTypeRecursively unwraps well known wrapper types from the givenTypeInformation.- Parameters:
- type- must not be null.
- Returns:
- will never be null.
 
 
-