Record Class DialogListDialog
java.lang.Object
java.lang.Record
fr.fidorial.dialog.DialogListDialog
- Record Components:
base- the shared title, contents and behaviourdialogs- the dialogs to list, never emptyexitAction- the footer button, ornullfor no footercolumns- how many buttons sit side by side- the width of each button, between 1 and 1024
- All Implemented Interfaces:
Dialog, DialogDefinition, DialogLike
public record DialogListDialog(DialogBase base, List<Dialog> dialogs, @Nullable DialogActionButton exitAction, int columns, int buttonWidth)
extends Record
implements DialogDefinition
A dialog whose buttons lead to other dialogs.
- Since:
- 0.1.0
- Since Minecraft:
- 1.21.6
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDialogListDialog(DialogBase base, List<Dialog> dialogs, @Nullable DialogActionButton exitAction, int columns, int buttonWidth) Creates an instance of aDialogListDialogrecord 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.dialogs()Returns the value of thedialogsrecord 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.booleanReturns whether every entry of this list is a reference rather than a definition.static DialogListDialogof(DialogBase base, List<Dialog> dialogs) Creates a 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
-
DialogListDialog
public DialogListDialog(DialogBase base, List<Dialog> dialogs, @Nullable DialogActionButton exitAction, int columns, int buttonWidth) Creates an instance of aDialogListDialogrecord class.- Parameters:
base- the value for thebaserecord componentdialogs- the value for thedialogsrecord componentexitAction- the value for theexitActionrecord componentcolumns- the value for thecolumnsrecord componentbuttonWidth- the value for thebuttonWidthrecord component
-
-
Method Details
-
of
Creates a list of two columns and no footer.- Parameters:
base- the shared title, contents and behaviourdialogs- the dialogs to list- 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
-
holdsReferences
public boolean holdsReferences()Returns whether every entry of this list is a reference rather than a definition.- Returns:
- whether every entry of this list is a reference rather than a definition
- 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
-
dialogs
-
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
-