public static enum Parallel.Policy extends Enum<Parallel.Policy>
Parallel
task.Enum Constant and Description |
---|
Selector
The selector policy makes the
Parallel task succeed as soon as one child succeeds; if all children fail, then the
parallel task fails. |
Sequence
The sequence policy makes the
Parallel task fail as soon as one child fails; if all children succeed, then the
parallel task succeeds. |
Modifier and Type | Method and Description |
---|---|
abstract Boolean |
onChildFail(Parallel<?> parallel)
Called by parallel task each time one of its children fails.
|
abstract Boolean |
onChildSuccess(Parallel<?> parallel)
Called by parallel task each time one of its children succeeds.
|
static Parallel.Policy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Parallel.Policy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Parallel.Policy Sequence
Parallel
task fail as soon as one child fails; if all children succeed, then the
parallel task succeeds. This is the default policy.public static final Parallel.Policy Selector
Parallel
task succeed as soon as one child succeeds; if all children fail, then the
parallel task fails.public static Parallel.Policy[] values()
for (Parallel.Policy c : Parallel.Policy.values()) System.out.println(c);
public static Parallel.Policy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic abstract Boolean onChildSuccess(Parallel<?> parallel)
parallel
- the parallel taskBoolean.TRUE
if parallel must succeed, Boolean.FALSE
if parallel must fail and null
if
parallel must keep on running.Copyright © 2018. All rights reserved.