Class Result
java.lang.Object
io.prismmc.prism.dashboard.Result
What an action answers: a message for the dashboard to show, whether the page is drawn again, the
page to go to, and data for a view's script. Each method gives a new result.
return Result.ok("Saved");
return Result.error("No such item");
return Result.ok().navigate("item", Map.of("id", item.id()));
return Result.ok().data(Map.of("balance", balance)).refresh(false);
-
Method Details
-
ok
- Returns:
- a success that says nothing; the page is drawn again
-
ok
-
error
-
refresh
- Parameters:
refresh- whether the page is drawn again after the action- Returns:
- a new result
-
data
-
isOk
public boolean isOk()- Returns:
- whether the action did what was asked
-
message
- Returns:
- what the dashboard shows, or null
-
refreshes
public boolean refreshes()- Returns:
- whether the page is drawn again
-
params
-
data
- Returns:
- the data for a view's script, or null
-