E
- The type of event to listen forA
- The type returned from the functionpublic class FutureBattleTask<E extends BattleEvent,A>
extends java.lang.Object
CompletableFuture.complete(Object)
with the returned object in that order
Then it will remove the future battle task from the stored list of tasksModifier and Type | Field and Description |
---|---|
protected java.util.function.BiFunction<E,BattleController,A> |
consumer |
protected java.lang.Class<E> |
eventClass |
protected java.util.concurrent.CompletableFuture<A> |
future |
protected boolean |
persistent |
Constructor and Description |
---|
FutureBattleTask(java.lang.Class<E> eventClass,
java.util.function.BiFunction<E,BattleController,A> consumer,
java.util.concurrent.CompletableFuture<A> future,
boolean persistent) |
Modifier and Type | Method and Description |
---|---|
void |
complete(java.lang.Object event) |
java.lang.Class<E> |
getEventClass() |
boolean |
isPersistent() |
protected final java.lang.Class<E extends BattleEvent> eventClass
protected final java.util.function.BiFunction<E extends BattleEvent,BattleController,A> consumer
protected final java.util.concurrent.CompletableFuture<A> future
protected final boolean persistent
public FutureBattleTask(java.lang.Class<E> eventClass, java.util.function.BiFunction<E,BattleController,A> consumer, java.util.concurrent.CompletableFuture<A> future, boolean persistent)
public java.lang.Class<E> getEventClass()
public boolean isPersistent()
public void complete(java.lang.Object event)