Record Class ServerLinksDialog
java.lang.Object
java.lang.Record
fr.fidorial.dialog.ServerLinksDialog
- Record Components:
base- the shared title, contents and behaviourexitAction- the footer button, ornullfor no footercolumns- how many links sit side by side- 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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServerLinksDialog(DialogBase base, @Nullable DialogActionButton exitAction, int columns, int buttonWidth) Creates an instance of aServerLinksDialogrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbase()Returns the value of thebaserecord component.intReturns the value of thebuttonWidthrecord component.intcolumns()Returns the value of thecolumnsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexitActionrecord component.exitAction(@Nullable DialogActionButton exitAction) final inthashCode()Returns a hash code value for this object.static ServerLinksDialogof(DialogBase base) Creates a link list of two columns and no footer.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_COLUMNS
public static final int DEFAULT_COLUMNSDefault 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 aServerLinksDialogrecord class.- Parameters:
base- the value for thebaserecord componentexitAction- the value for theexitActionrecord componentcolumns- the value for thecolumnsrecord componentbuttonWidth- the value for thebuttonWidthrecord component
-
-
Method Details
-
of
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
- Parameters:
exitAction- the footer button, ornullfor no footer- Returns:
- a copy of this dialog carrying the given footer
- Since:
- 0.1.0
-
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. -
base
Returns the value of thebaserecord component.- Specified by:
basein interfaceDialogDefinition- Returns:
- the value of the
baserecord component
-
exitAction
Returns the value of theexitActionrecord component.- Returns:
- the value of the
exitActionrecord component
-
columns
-
buttonWidth
public int buttonWidth()Returns the value of thebuttonWidthrecord component.- Returns:
- the value of the
buttonWidthrecord component
-