public final class ReactiveWrapperConverters extends Object
QueryExecutionConverters
.
This class discovers reactive wrapper availability and their conversion support based on the class path. Reactive wrapper types might be supported/on the class path but conversion may require additional dependencies.
ReactiveWrappers
,
ReactiveAdapterRegistry
Modifier and Type | Method and Description |
---|---|
static boolean |
canConvert(Class<?> sourceType,
Class<?> targetType)
Return true if objects of
sourceType can be converted to the targetType . |
static <T> T |
map(Object reactiveObject,
Function<Object,Object> converter)
Maps elements of a reactive element stream to other elements.
|
static boolean |
supports(Class<?> type)
Returns whether the given type is supported for wrapper type conversion.
|
static <T> T |
toWrapper(Object reactiveObject,
Class<? extends T> targetWrapperType)
Casts or adopts the given wrapper type to a target wrapper type.
|
public static boolean supports(Class<?> type)
NOTE: A reactive wrapper type might be supported in general by ReactiveWrappers.supports(Class)
but not
necessarily for conversion using this method.
type
- must not be null.type
is a supported reactive wrapper type.@Nullable public static <T> T toWrapper(Object reactiveObject, Class<? extends T> targetWrapperType)
reactiveObject
- the stream, must not be null.targetWrapperType
- must not be null.public static <T> T map(Object reactiveObject, Function<Object,Object> converter)
reactiveObject
- must not be null.converter
- must not be null.Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.