Interface ActionContext
public interface ActionContext
An action as it runs: who runs it, from which page, and its values: a form's fields, a button's
View.Button.with(String, Object), or what a view's script sent.-
Method Summary
Modifier and TypeMethodDescriptionbooleandouble<T> CompletableFuture<T> Work on the thread of an entity's region, the one allowed to change it.<T> CompletableFuture<T> Work on the global region thread, the one of world-wide state.booleaninput()longpage()@Nullable Player<T> CompletableFuture<T> Work on the thread of the region of a place.@Nullable Stringviewer()
-
Method Details
-
viewer
Viewer viewer()- Returns:
- who runs the action
-
page
String page()- Returns:
- the page it was run from, empty when it is not known
-
has
- Parameters:
name- a value's name- Returns:
- whether the action came with that value
-
string
-
string
-
integer
- Parameters:
name- a value's namefallback- what to answer when there is none, or it is not a whole number- Returns:
- the value as a whole number
-
decimal
- Parameters:
name- a value's namefallback- what to answer when there is none, or it is not a number- Returns:
- the value as a number
-
bool
- Parameters:
name- a value's name- Returns:
- the value as a boolean: true for a switch turned on, or the text
true
-
input
-
player
-
global
Work on the global region thread, the one of world-wide state.- Type Parameters:
T- what it gives- Parameters:
task- the work- Returns:
- a future of what it gives
-
entity
Work on the thread of an entity's region, the one allowed to change it. The future fails when the entity is gone.- Type Parameters:
T- what it gives- Parameters:
entity- the entitytask- the work- Returns:
- a future of what it gives
-
region
Work on the thread of the region of a place.- Type Parameters:
T- what it gives- Parameters:
location- the placetask- the work- Returns:
- a future of what it gives
-