Package org.springframework.data.util
Class ReactiveWrappers
java.lang.Object
org.springframework.data.util.ReactiveWrappers
Utility class to expose details about reactive wrapper types. This class exposes whether a reactive wrapper is
supported in general and whether a particular type is suitable for no-value/single-value/multi-value usage.
Supported types are discovered by their availability on the class path. This class is typically used to determine multiplicity and whether a reactive wrapper type is acceptable for a specific operation.
- Since:
- 3.0
- Author:
- Mark Paluch, Christoph Strobl, Oliver Gierke, Gerrit Meier, Hantsy Bai
- See Also:
-
Publisher
Single
Maybe
Observable
Completable
Flowable
Multi
Uni
Mono
Flux
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration of supported reactive libraries. -
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
static final boolean
static final boolean
static final boolean
static final boolean
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Returns true if reactive support is available.static boolean
isAvailable
(ReactiveWrappers.ReactiveLibrary reactiveLibrary) Returns true if theReactiveWrappers.ReactiveLibrary
is available.static boolean
isMultiValueType
(Class<?> type) Returns true iftype
is a reactive wrapper type supporting multiple values (0..N
elements).static boolean
isNoValueType
(Class<?> type) Returns true iftype
is a reactive wrapper type that contains no value.static boolean
isSingleValueType
(Class<?> type) Returns true iftype
is a reactive wrapper type for a single value.static boolean
Returns true if thetype
is a supported reactive wrapper type.static boolean
usesReactiveType
(Class<?> type) Returns whether the given type uses any reactive wrapper type in its method signatures.
-
Field Details
-
PROJECT_REACTOR_PRESENT
public static final boolean PROJECT_REACTOR_PRESENT -
RXJAVA3_PRESENT
public static final boolean RXJAVA3_PRESENT -
KOTLIN_COROUTINES_PRESENT
public static final boolean KOTLIN_COROUTINES_PRESENT -
MUTINY_PRESENT
public static final boolean MUTINY_PRESENT -
IS_REACTIVE_AVAILABLE
public static final boolean IS_REACTIVE_AVAILABLE
-
-
Method Details
-
isAvailable
public static boolean isAvailable()Returns true if reactive support is available. More specifically, whether any of the libraries defined inReactiveWrappers.ReactiveLibrary
are on the class path.- Returns:
- true if reactive support is available.
-
isAvailable
Returns true if theReactiveWrappers.ReactiveLibrary
is available.- Parameters:
reactiveLibrary
- must not be null.- Returns:
- true if the
ReactiveWrappers.ReactiveLibrary
is available.
-
supports
Returns true if thetype
is a supported reactive wrapper type.- Parameters:
type
- must not be null.- Returns:
- true if the
type
is a supported reactive wrapper type.
-
usesReactiveType
Returns whether the given type uses any reactive wrapper type in its method signatures.- Parameters:
type
- must not be null.- Returns:
-
isNoValueType
Returns true iftype
is a reactive wrapper type that contains no value.- Parameters:
type
- must not be null.- Returns:
- true if
type
is a reactive wrapper type that contains no value.
-
isSingleValueType
Returns true iftype
is a reactive wrapper type for a single value.- Parameters:
type
- must not be null.- Returns:
- true if
type
is a reactive wrapper type for a single value.
-
isMultiValueType
Returns true iftype
is a reactive wrapper type supporting multiple values (0..N
elements).- Parameters:
type
- must not be null.- Returns:
- true if
type
is a reactive wrapper type supporting multiple values (0..N
elements).
-