Record Class DialogModel

java.lang.Object
java.lang.Record
com.ultikits.ultitools.ui.dialog.DialogModel
Record Components:
title - screen title
body - body lines in display order
inputs - form controls in display order
buttons - primary actions in display order
exit - optional exit action
kind - arrangement of the actions
escapeCloses - 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.
  • Field Details

    • title

      private final net.kyori.adventure.text.Component title
      The field for the title record component.
    • body

      private final List<net.kyori.adventure.text.Component> body
      The field for the body record component.
    • inputs

      private final List<DialogModel.Input> inputs
      The field for the inputs record component.
    • buttons

      private final List<DialogModel.Button> buttons
      The field for the buttons record component.
    • exit

      @Nullable private final @Nullable DialogModel.Button exit
      The field for the exit record component.
    • kind

      private final DialogModel.Kind kind
      The field for the kind record component.
    • escapeCloses

      private final boolean escapeCloses
      The field for the escapeCloses record component.
  • Constructor Details

  • Method Details

    • inputKey

      static String inputKey(int index)
      Position-only wire key, independent of module keys and Paper's reserved callback id.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • title

      public net.kyori.adventure.text.Component title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • body

      public List<net.kyori.adventure.text.Component> body()
      Returns the value of the body record component.
      Returns:
      the value of the body record component
    • inputs

      public List<DialogModel.Input> inputs()
      Returns the value of the inputs record component.
      Returns:
      the value of the inputs record component
    • buttons

      public List<DialogModel.Button> buttons()
      Returns the value of the buttons record component.
      Returns:
      the value of the buttons record component
    • exit

      @Nullable public @Nullable DialogModel.Button exit()
      Returns the value of the exit record component.
      Returns:
      the value of the exit record component
    • kind

      public DialogModel.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • escapeCloses

      public boolean escapeCloses()
      Returns the value of the escapeCloses record component.
      Returns:
      the value of the escapeCloses record component