Package su.onno.ui
Record Class ActionContext
java.lang.Object
java.lang.Record
su.onno.ui.ActionContext
- Record Components:
kind-"catalogs"or"documents"name- the entity's route nameid- the target record's id, ornullfor a toolbar (list-level) actionuser- the authenticated username, for the handler's own checksinputs- current values of the scalar inputs, keyed by input key (never null)rows- collected row groups, keyed by group key; each group is a list of {column → value} rows (never null)
public record ActionContext(String kind, String name, UUID id, String user, Map<String,String> inputs, Map<String,List<Map<String,String>>> rows)
extends Record
What a custom action handler receives when invoked: the entity it ran on, (for row/detail
actions) the record's id, the current values of any toolbar
inputs / scalar
action-form fields, and any repeatable row group the form collected. The handler does whatever it likes with the services its
EntityView bean injected — it's just a method on a Spring bean.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static ActionContextSplit an action request body ({"inputs": {key: value | rows[]}}) into scalar inputs and row groups: a value that is a JSON array is a row group (each element a {column → value} object), everything else is a scalar coerced to a string.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.The current value of scalar inputkey, or""if absent.The rows collected for row groupkey, or an empty list if absent.inputs()Returns the value of theinputsrecord component.kind()Returns the value of thekindrecord component.name()Returns the value of thenamerecord component.rows()Returns the value of therowsrecord component.final StringtoString()Returns a string representation of this record class.user()Returns the value of theuserrecord component.
-
Constructor Details
-
Method Details
-
input
The current value of scalar inputkey, or""if absent. -
inputRows
The rows collected for row groupkey, or an empty list if absent. Each row is acolumn → valuemap (values are strings, as declared by the columns'InputType). -
from
public static ActionContext from(String kind, String name, UUID id, String user, Map<String, Object> body) Split an action request body ({"inputs": {key: value | rows[]}}) into scalar inputs and row groups: a value that is a JSON array is a row group (each element a {column → value} object), everything else is a scalar coerced to a string. Shared by the entity-action and page-action endpoints so both read the same wire shape. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
user
Returns the value of theuserrecord component.- Returns:
- the value of the
userrecord component
-
inputs
Returns the value of theinputsrecord component.- Returns:
- the value of the
inputsrecord component
-
rows
Returns the value of therowsrecord component.- Returns:
- the value of the
rowsrecord component
-