LambdaSafe

Utility that can be used to invoke lambdas in a safe way. Primarily designed to help support generically typed callbacks where class cast exceptions need to be dealt with due to class erasure.

Author

Phillip Webb

Since

2.0.0

Types

Link copied to clipboard
Represents a single callback that can be invoked in a lambda safe way.
Link copied to clipboard
Represents a collection of callbacks that can be invoked in a lambda safe way.
Link copied to clipboard
The result of a callback which may be a value, null or absent entirely if the callback wasn't suitable.

Functions

Link copied to clipboard
open fun <C, A> callback(callbackType: Class<C>, callbackInstance: C, argument: A, additionalArguments: Array<Any>): LambdaSafe.Callback<C, A>
Start a call to a single callback instance, dealing with common generic type concerns and exceptions.
Link copied to clipboard
open fun <C, A> callbacks(callbackType: Class<C>, callbackInstances: Collection<out C>, argument: A, additionalArguments: Array<Any>): LambdaSafe.Callbacks<C, A>
Start a call to callback instances, dealing with common generic type concerns and exceptions.