ARG - Argument typeRET - Return type@FunctionalInterface
public interface Invoker<ARG,RET>
Callable interface - accepts one argument and possibly throws something| Modifier and Type | Method and Description |
|---|---|
RET |
invoke(ARG arg) |
static <ARG> void |
invokeAll(ARG arg,
java.util.Collection<? extends Invoker<? super ARG,?>> invokers)
Invokes all the instances ignoring the return value.
|
static <ARG> java.util.AbstractMap.SimpleImmutableEntry<Invoker<? super ARG,?>,java.lang.Throwable> |
invokeTillFirstFailure(ARG arg,
java.util.Collection<? extends Invoker<? super ARG,?>> invokers)
Invokes all instances until 1st failure (if any)
|
static <ARG> Invoker<ARG,java.lang.Void> |
wrapAll(java.util.Collection<? extends Invoker<? super ARG,?>> invokers)
Wraps a bunch of
Invoker-s that return no value into one that invokes them in the same order as
they appear. |
static <ARG> Invoker<ARG,java.lang.Void> |
wrapFirst(java.util.Collection<? extends Invoker<? super ARG,?>> invokers)
Wraps a bunch of
Invoker-s that return no value into one that invokes them in the same order as
they appear. |
static <ARG> Invoker<ARG,java.lang.Void> wrapAll(java.util.Collection<? extends Invoker<? super ARG,?>> invokers)
Invoker-s that return no value into one that invokes them in the same order as
they appear. Note: all invokers are used and any thrown exceptions are accumulated and
thrown as a single exception at the end of invoking all of them.ARG - The argument typeinvokers - The invokers to wrap - ignored if null/emptyinvokeAllstatic <ARG> void invokeAll(ARG arg,
java.util.Collection<? extends Invoker<? super ARG,?>> invokers)
throws java.lang.Throwable
ARG - Argument typearg - The argument to pass to the invoke(Object) methodinvokers - The invokers to scan - ignored if null/empty (also ignores null members)java.lang.Throwable - If invocation failedstatic <ARG> Invoker<ARG,java.lang.Void> wrapFirst(java.util.Collection<? extends Invoker<? super ARG,?>> invokers)
Invoker-s that return no value into one that invokes them in the same order as
they appear. Note: stops when first invoker throws an exception (otherwise invokes all)ARG - The argument typeinvokers - The invokers to wrap - ignored if null/emptyinvokeTillFirstFailurestatic <ARG> java.util.AbstractMap.SimpleImmutableEntry<Invoker<? super ARG,?>,java.lang.Throwable> invokeTillFirstFailure(ARG arg, java.util.Collection<? extends Invoker<? super ARG,?>> invokers)
ARG - Argument typearg - The argument to pass to the invoke(Object) methodinvokers - The invokers to scan - ignored if null/empty (also ignores null members)AbstractMap.SimpleImmutableEntry representing the first failed invocation - null if
all were successful (or none invoked).