HandlerBuilder
Builds a StepHandler: numbered steps that run one at a time, one per call to step().
ClassRLPlugins API
public class HandlerBuilderExtended by AbstractHandlerBuilder
Constants
END_EXECUTION
Members
Constructors
- newHandlerBuilder()
Creates a HandlerBuilder.
Methods
- HandlerBuilderadd(int, Consumer<StepContext>)
Adds a step to the handler and assumes to return the next step number.
- HandlerBuilderadd(int, Function<StepContext, Integer>)
Adds a step to the handler.
- HandlerBuilderadd(int, Runnable)
Adds a step to the handler and assumes to return the next step number.
- HandlerBuilderadd(int, Supplier<Integer>)
Adds a step to the handler.
- HandlerBuilderaddDelay(int, int)
Adds a delay to the handler.
- HandlerBuilderaddDelayUntil(int, BooleanSupplier)
Adds a delay until a condition is met.
- HandlerBuilderaddDelayUntil(int, Predicate<StepContext>)
Adds a delay until a condition is met.
- HandlerBuilderaddDelayUntil(int, int, BooleanSupplier, Runnable)
Adds a delay until a condition is met.
- HandlerBuilderaddDelayUntil(int, int, Predicate<StepContext>, Consumer<StepContext>)
Adds a delay until a condition is met.
- HandlerBuilderappend(int, HandlerBuilder)
Append.
- HandlerBuilderappend(int, StepHandler)
Append.
- StepHandlerblank()
Blank.
- StepHandlerbuild()
Builds the TransportHandler.
- HandlerBuilderget()
Creates a new HandlerBuilder.
- int
- voidspeedUp(StepContext)
Speed up.
- HandlerBuilderwalkTo(int, WorldArea)
Walk to.
- HandlerBuilderwalkTo(int, WorldPoint)
Walk to.
- HandlerBuilderwalkToWorldAreaSupplier(int, Supplier<WorldArea>)
Walk to world area supplier.
- HandlerBuilderwalkToWorldPointSupplier(int, Supplier<WorldPoint>)
Walk to world point supplier.
HandlerBuilder()
public HandlerBuilder()Creates a HandlerBuilder.
add(int, Consumer<StepContext>)
public HandlerBuilder add(int step, Consumer<StepContext> consumer)Adds a step to the handler and assumes to return the next step number.
Parameters
step- The step number.
consumer- The runnable to run.
Returns
The HandlerBuilder.
add(int, Function<StepContext, Integer>)
public HandlerBuilder add(int step, Function<StepContext, Integer> function)Adds a step to the handler.
Parameters
step- The step number.
function- The function that returns the next step number.
Returns
The HandlerBuilder.
add(int, Runnable)
public HandlerBuilder add(int step, Runnable runnable)Adds a step to the handler and assumes to return the next step number.
Parameters
step- The step number.
runnable- The runnable to run.
Returns
The HandlerBuilder.
add(int, Supplier<Integer>)
public HandlerBuilder add(int step, Supplier<Integer> supplier)Adds a step to the handler.
Parameters
step- The step number.
supplier- The supplier that returns the next step number.
Returns
The HandlerBuilder.
addDelay(int, int)
public HandlerBuilder addDelay(int step, int delay)Adds a delay to the handler.
Parameters
step- The step number.
delay- The delay in steps.
Returns
The HandlerBuilder.
addDelayUntil(int, BooleanSupplier)
public HandlerBuilder addDelayUntil(int step, BooleanSupplier condition)Adds a delay until a condition is met.
Parameters
step- The step number.
condition- The condition to meet.
Returns
The HandlerBuilder.
addDelayUntil(int, Predicate<StepContext>)
public HandlerBuilder addDelayUntil(int step, Predicate<StepContext> condition)Adds a delay until a condition is met.
Parameters
step- The step number.
condition- The condition to meet.
Returns
The HandlerBuilder.
addDelayUntil(int, int, BooleanSupplier, Runnable)
public HandlerBuilder addDelayUntil(int step, int timeout, BooleanSupplier condition, Runnable onTimeout)Adds a delay until a condition is met.
Parameters
step- The step number.
timeout- Timeout.
condition- The condition to meet.
onTimeout- On timeout.
Returns
The HandlerBuilder.
addDelayUntil(int, int, Predicate<StepContext>, Consumer<StepContext>)
public HandlerBuilder addDelayUntil(int step, int timeout, Predicate<StepContext> condition, Consumer<StepContext> onTimeout)Adds a delay until a condition is met.
Parameters
step- The step number.
timeout- Timeout.
condition- The condition to meet.
onTimeout- On timeout.
Returns
The HandlerBuilder.
append(int, HandlerBuilder)
public HandlerBuilder append(int step, HandlerBuilder builder)Append.
Parameters
step- Step.
builder- Builder.
append(int, StepHandler)
public HandlerBuilder append(int step, StepHandler handler)Append.
Parameters
step- Step.
handler- Handler.
blank()static
public static StepHandler blank()Blank.
build()
public StepHandler build()Builds the TransportHandler.
Returns
The TransportHandler.
get()static
public static HandlerBuilder get()Creates a new HandlerBuilder.
Returns
The HandlerBuilder.
jump(String, StepContext)static
public static int jump(String label, StepContext context)Jump.
Parameters
label- Label.
context- Context.
speedUp(StepContext)static
public static void speedUp(StepContext context)Speed up.
Parameters
context- Context.
walkTo(int, WorldArea)
public HandlerBuilder walkTo(int step, WorldArea location)Walk to.
Parameters
step- Step.
location- Location.
walkTo(int, WorldPoint)
public HandlerBuilder walkTo(int step, WorldPoint location)Walk to.
Parameters
step- Step.
location- Location.
walkToWorldAreaSupplier(int, Supplier<WorldArea>)
public HandlerBuilder walkToWorldAreaSupplier(int step, Supplier<WorldArea> locationSupplier)Walk to world area supplier.
Parameters
step- Step.
locationSupplier- Location supplier.
walkToWorldPointSupplier(int, Supplier<WorldPoint>)
public HandlerBuilder walkToWorldPointSupplier(int step, Supplier<WorldPoint> locationSupplier)Walk to world point supplier.
Parameters
step- Step.
locationSupplier- Location supplier.
Also allowed
Every class has these, as in plain Java.
equals, toString