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,
Collection<? extends Invoker<? super ARG,?>> invokers)
Invokes all the instances ignoring the return value.
|
static <ARG> AbstractMap.SimpleImmutableEntry<Invoker<? super ARG,?>,Throwable> |
invokeTillFirstFailure(ARG arg,
Collection<? extends Invoker<? super ARG,?>> invokers)
Invokes all instances until 1st failure (if any)
|
static <ARG> Invoker<ARG,Void> |
wrapAll(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,Void> |
wrapFirst(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,Void> wrapAll(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,
Collection<? extends Invoker<? super ARG,?>> invokers)
throws 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)Throwable - If invocation failedstatic <ARG> Invoker<ARG,Void> wrapFirst(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> AbstractMap.SimpleImmutableEntry<Invoker<? super ARG,?>,Throwable> invokeTillFirstFailure(ARG arg, 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).Copyright © 2018–2020 The Apache Software Foundation. All rights reserved.