Modifier and Type | Method and Description |
---|---|
static <T> Action<Action<? super T>> |
actionAction(T t)
Returns an action that acts on an action that acts on the given argument.
|
static <T> Action<T> |
join(Action<? super T>... actions)
Returns a new action that executes the given actions in order.
|
static Action<Object> |
noop()
Returns an action that does precisely nothing.
|
static <T> Action<? super T> |
noopIfNull(Action<T> action)
If the given action is
null , returns noop() , otherwise returns the given action. |
static Action<Throwable> |
throwException()
Returns an action that receives a throwable and immediately throws it.
|
public static Action<Object> noop()
public static <T> Action<? super T> noopIfNull(@Nullable Action<T> action)
null
, returns noop()
, otherwise returns the given action.T
- the type of parameter received by the actionaction
- an action, maybe null
.action
param if it is not null
, else a noop()
.@SafeVarargs public static <T> Action<T> join(Action<? super T>... actions)
T
- the type of object the action acceptsactions
- the actions to join into one actionpublic static Action<Throwable> throwException()
public static <T> Action<Action<? super T>> actionAction(T t)
The returned action is effectively a callback for executing a callback for the given argument.
T
- the type of the argumentt
- the argument to give to actions given to the returned action