Record Class ServerLinksDialog

java.lang.Object
java.lang.Record
fr.fidorial.dialog.ServerLinksDialog
Record Components:
base - the shared title, contents and behaviour
exitAction - the footer button, or null for no footer
columns - how many links sit side by side
buttonWidth - the width of each link button, between 1 and 1024
All Implemented Interfaces:
Dialog, DialogDefinition, DialogLike

public record ServerLinksDialog(DialogBase base, @Nullable DialogActionButton exitAction, int columns, int buttonWidth) extends Record implements DialogDefinition
A dialog listing the links the server advertised, laid out in columns.
Since:
0.1.0
Since Minecraft:
1.21.6
  • Field Details

    • DEFAULT_COLUMNS

      public static final int DEFAULT_COLUMNS
      Default number of columns.
      Since:
      0.1.0
      See Also:
  • Constructor Details

    • ServerLinksDialog

      public ServerLinksDialog(DialogBase base, @Nullable DialogActionButton exitAction, int columns, int buttonWidth)
      Creates an instance of a ServerLinksDialog record class.
      Parameters:
      base - the value for the base record component
      exitAction - the value for the exitAction record component
      columns - the value for the columns record component
      buttonWidth - the value for the buttonWidth record component
  • Method Details

    • of

      @Contract("_ -> new") public static ServerLinksDialog of(DialogBase base)
      Creates a link list of two columns and no footer.
      Parameters:
      base - the shared title, contents and behaviour
      Returns:
      the dialog
      Since:
      0.1.0
    • exitAction

      @Contract("_ -> new") public ServerLinksDialog exitAction(@Nullable DialogActionButton exitAction)
      Parameters:
      exitAction - the footer button, or null for no footer
      Returns:
      a copy of this dialog carrying the given footer
      Since:
      0.1.0
    • 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.
    • base

      public DialogBase base()
      Returns the value of the base record component.
      Specified by:
      base in interface DialogDefinition
      Returns:
      the value of the base record component
    • exitAction

      public @Nullable DialogActionButton exitAction()
      Returns the value of the exitAction record component.
      Returns:
      the value of the exitAction record component
    • columns

      public int columns()
      Returns the value of the columns record component.
      Returns:
      the value of the columns record component
    • buttonWidth

      public int buttonWidth()
      Returns the value of the buttonWidth record component.
      Returns:
      the value of the buttonWidth record component