Class Outcome
java.lang.Object
privbot.api.Outcome
What happened when a verb was asked to act: an explicit answer instead of
false plus a log line.
Outcome.Status.DISPATCHED means the action left for the game. It is NOT proof that the game did it: a
withdraw can be dispatched and still not land. Verify the effect (the item arrived, the interface closed)
the way you would for a human click. Every other status means nothing was sent.
Outcome o = ctx.bank.withdrawOutcome("Shark", 10);
if (!o.dispatched()) {
log.info("withdraw not sent: {} ({})", o.status(), o.reason());
}
Existing boolean verbs stay; ...Outcome siblings return this type.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanTrue only forOutcome.Status.DISPATCHED.booleanstatic Outcomestatic OutcomefromDispatch(boolean sent, Outcome.Status ifNotSent, String reason) inthashCode()static Outcomestatic Outcomestatic Outcomeof(Outcome.Status status, String reason) Any status with a reason.static Outcomeok()The action was sent.static OutcomeThe action was sent;detailsays what was sent (for logs).reason()Why, in words; empty for a plain dispatch.static Outcomestatus()toString()static Outcomeunsupported(String reason)
-
Method Details
-
ok
The action was sent. -
ok
-
unsupported
-
notFound
-
notReady
-
refused
-
failed
-
of
Any status with a reason. -
fromDispatch
-
status
-
reason
Why, in words; empty for a plain dispatch. Never null. -
dispatched
public boolean dispatched()True only forOutcome.Status.DISPATCHED. -
equals
-
hashCode
-
toString
-