Package megamek.logging
Record Class MMLogger.ErrorDialogButton
java.lang.Object
java.lang.Record
megamek.logging.MMLogger.ErrorDialogButton
- Record Components:
label- the reporting button text, already localized by whoever installs itdismissLabel- the text of the button that simply closes the dialog, already localizedaction- what to do when the reporting button is pressed
- Enclosing class:
MMLogger
public static record MMLogger.ErrorDialogButton(String label, String dismissLabel, Runnable action)
extends Record
An extra button offered on error dialogs, installed by the user interface layer.
The label of the button that merely closes the dialog is supplied here as well. Offering a choice of buttons
means naming both of them, and megamek.logging sits below the user interface and so has no access to the
translated strings; whoever installs the hook does.
-
Constructor Summary
ConstructorsConstructorDescriptionErrorDialogButton(String label, String dismissLabel, Runnable action) Creates an instance of aErrorDialogButtonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.Returns the value of thedismissLabelrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ErrorDialogButton
Creates an instance of aErrorDialogButtonrecord class.- Parameters:
label- the value for thelabelrecord componentdismissLabel- the value for thedismissLabelrecord componentaction- the value for theactionrecord component
-
-
Method Details
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
dismissLabel
Returns the value of thedismissLabelrecord component.- Returns:
- the value of the
dismissLabelrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-