public final class FunctionTypeUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Type |
compose(Type originType,
Type composedType) |
static Method |
discoverFunctionalMethod(Class<?> pojoFunctionClass)
Will attempt to discover functional methods on the class.
|
static Type |
getFunctionTypeFromFunctionMethod(Method functionMethod) |
static Type |
getImmediateGenericType(Type type,
int index) |
static int |
getInputCount(Type functionType) |
static Type |
getInputType(Type functionType,
int index) |
static int |
getOutputCount(Type functionType) |
static Type |
getOutputType(Type functionType,
int index) |
static Class<? extends org.reactivestreams.Publisher<?>> |
getPublisherType(Type type) |
static boolean |
isConsumer(Type type) |
static boolean |
isFlux(Type type) |
static boolean |
isFunction(Type type) |
static boolean |
isFunctional(Type type) |
static boolean |
isInputArray(Type functionType)
Determines if input argument to a Function is an array.
|
static boolean |
isMessage(Type type) |
static boolean |
isMono(Type type) |
static boolean |
isMultipleArgumentsHolder(Object argument) |
static boolean |
isMultipleInputArguments(Type functionType) |
static boolean |
isOfType(Type type,
Class<?> cls) |
static boolean |
isOutputArray(Type functionType)
Determines if input argument to a Function is an array.
|
static boolean |
isPublisher(Type type) |
static boolean |
isReactive(Type type)
Evaluates if provided type is an assignable to
Publisher . |
static boolean |
isSupplier(Type type) |
static boolean |
isTypeCollection(Type type)
Will return 'true' if the provided type is a
Collection type. |
static Type |
unwrapActualTypeByIndex(Type type,
int index) |
public static boolean isTypeCollection(Type type)
Collection
type.
This also includes collections wrapped in Message
. For example,
If provided type is Message<List<Foo>>
this operation will return 'true'.type
- type to interrogateCollection
. Otherwise 'false'.public static Method discoverFunctionalMethod(Class<?> pojoFunctionClass)
FunctionalInterface
)pojoFunctionClass
- the class to introspectpublic static Type getFunctionTypeFromFunctionMethod(Method functionMethod)
public static int getInputCount(Type functionType)
public static int getOutputCount(Type functionType)
public static Class<? extends org.reactivestreams.Publisher<?>> getPublisherType(Type type)
public static boolean isPublisher(Type type)
public static boolean isFlux(Type type)
public static boolean isMessage(Type type)
public static boolean isInputArray(Type functionType)
functionType
- the function typepublic static boolean isOutputArray(Type functionType)
functionType
- the function typepublic static boolean isReactive(Type type)
Publisher
.type
- type to evaluatePublisher
public static boolean isSupplier(Type type)
public static boolean isFunction(Type type)
public static boolean isConsumer(Type type)
public static boolean isMono(Type type)
public static boolean isFunctional(Type type)
public static boolean isMultipleInputArguments(Type functionType)
public static boolean isMultipleArgumentsHolder(Object argument)
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.