Record Class DialogModel
java.lang.Object
java.lang.Record
com.ultikits.ultitools.ui.dialog.DialogModel
- Record Components:
title- screen titlebody- body lines in display orderinputs- form controls in display order- primary actions in display orderexit- optional exit actionkind- arrangement of the actionsescapeCloses- whether Escape may dismiss the screen
@Internal
public record DialogModel(net.kyori.adventure.text.Component title, List<net.kyori.adventure.text.Component> body, List<DialogModel.Input> inputs, List<DialogModel.Button> buttons, @Nullable DialogModel.Button exit, DialogModel.Kind kind, boolean escapeCloses)
extends Record
Immutable, already-localized dialog description without Paper registry objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne rendered action.static interfaceA form control; positional wire keys are mapped back to the original handles on submission.static enumPaper-independent action layout.static final recordOne option, identified independently of the domain value's string representation.static final recordSingle-precision numeric control.static final recordSingle-option control.static final recordText control.static final recordBoolean control. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<net.kyori.adventure.text.Component> The field for thebodyrecord component.private final List<DialogModel.Button> The field for thebuttonsrecord component.private final booleanThe field for theescapeClosesrecord component.private final @Nullable DialogModel.ButtonThe field for theexitrecord component.private final List<DialogModel.Input> The field for theinputsrecord component.private final DialogModel.KindThe field for thekindrecord component.private final net.kyori.adventure.text.ComponentThe field for thetitlerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDialogModel(net.kyori.adventure.text.Component title, List<net.kyori.adventure.text.Component> body, List<DialogModel.Input> inputs, List<DialogModel.Button> buttons, @Nullable DialogModel.Button exit, DialogModel.Kind kind, boolean escapeCloses) Copies all collections before publication. -
Method Summary
Modifier and TypeMethodDescriptionList<net.kyori.adventure.text.Component> body()Returns the value of thebodyrecord component.buttons()Returns the value of thebuttonsrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theescapeClosesrecord component.@Nullable DialogModel.Buttonexit()Returns the value of theexitrecord component.final inthashCode()Returns a hash code value for this object.(package private) static StringinputKey(int index) Position-only wire key, independent of module keys and Paper's reserved callback id.inputs()Returns the value of theinputsrecord component.kind()Returns the value of thekindrecord component.net.kyori.adventure.text.Componenttitle()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
title
private final net.kyori.adventure.text.Component titleThe field for thetitlerecord component. -
body
-
inputs
The field for theinputsrecord component. -
buttons
The field for thebuttonsrecord component. -
exit
The field for theexitrecord component. -
kind
The field for thekindrecord component. -
escapeCloses
private final boolean escapeClosesThe field for theescapeClosesrecord component.
-
-
Constructor Details
-
DialogModel
public DialogModel(net.kyori.adventure.text.Component title, List<net.kyori.adventure.text.Component> body, List<DialogModel.Input> inputs, List<DialogModel.Button> buttons, @Nullable @Nullable DialogModel.Button exit, DialogModel.Kind kind, boolean escapeCloses) Copies all collections before publication.
-
-
Method Details
-
inputKey
Position-only wire key, independent of module keys and Paper's reserved callback id. -
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
title
-
body
-
inputs
-
buttons
-
exit
-
kind
-
escapeCloses
public boolean escapeCloses()Returns the value of theescapeClosesrecord component.- Returns:
- the value of the
escapeClosesrecord component
-