Package forgottentowns.mod.api
Record Class ColonyPanel
java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyPanel
- Record Components:
id- stable mod-local panel identitytitle- localized panel headingrows- ordered information rowsactions- ordered buttons; use stable identities across refreshes
public record ColonyPanel(String id, ColonyPanel.Message title, List<ColonyPanel.Row> rows, List<ColonyPanel.Action> actions)
extends Record
Detached information and action panel rendered with the native game's controls.
A provider may publish at most eight panels, each with 128 rows and sixteen actions.
All text keys belong to the provider's translation namespace. Arguments carry runtime values,
such as numbers or citizen names; authored prose belongs in the translation catalogs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA native button routed only to its owning extension.static final recordLocalized text resolved by the host in the player's current language.static final recordOne native information row, with its label and value in separate columns. -
Constructor Summary
ConstructorsConstructorDescriptionColonyPanel(String id, ColonyPanel.Message title, List<ColonyPanel.Row> rows, List<ColonyPanel.Action> actions) Defensively captures a bounded native panel. -
Method Summary
Modifier and TypeMethodDescriptionactions()Returns the value of theactionsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.rows()Returns the value of therowsrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ColonyPanel
public ColonyPanel(String id, ColonyPanel.Message title, List<ColonyPanel.Row> rows, List<ColonyPanel.Action> actions) Defensively captures a bounded native panel.- Parameters:
id- mod-local identifier using lowercase letters, digits and underscorestitle- localized headingrows- information rowsactions- action buttons- Throws:
NullPointerException- if any component or list member is nullIllegalArgumentException- if an identity is malformed, a collection exceeds its bounds, or two actions share an identity
-
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
rows
Returns the value of therowsrecord component.- Returns:
- the value of the
rowsrecord component
-
actions
Returns the value of theactionsrecord component.- Returns:
- the value of the
actionsrecord component
-