Class WorkflowReflectionUtils
java.lang.Object
io.axoniq.framework.workflow.runtime.util.WorkflowReflectionUtils
Reflection utilities.
- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional<T> createDefaultInstance(Class<T> clazz) Creates an instance of specified type.static ObjectInvokes a method.static <C> Class<C> requireIsAssignableFrom(Class<?> expected, Class<C> clazz) Checks if provided class is a subtype of given type and throws an exception if this checks fails.
-
Method Details
-
createDefaultInstance
Creates an instance of specified type.- Type Parameters:
T- type of instance.- Parameters:
clazz- type to instantiate.- Returns:
- optional instance or empty on every error.
-
requireIsAssignableFrom
Checks if provided class is a subtype of given type and throws an exception if this checks fails.- Parameters:
expected- expected type.clazz- class to check.- Returns:
- provided class.
-
invoke
Invokes a method.- Parameters:
instance- object to invoke on.method- method to invoke.args- args of the method.- Returns:
- result of invocation.
-