Module no.ntnu.principes
Record Class SelectableGroup.SelectableGroupItem
java.lang.Object
java.lang.Record
no.ntnu.principes.components.secondary.SelectableGroup.SelectableGroupItem
- Record Components:
id- The unique identifier for the item. Must not be null or empty.text- The display text for the item. Intended for use as a label.selected- The initial selection state of the item.trueif selected,falseotherwise.
- Enclosing class:
SelectableGroup
public static record SelectableGroup.SelectableGroupItem(String id, String text, boolean selected)
extends Record
Represents an item in a
SelectableGroup, containing its unique identifier,
displayed label, and current selection state.
This object is immutable and used to initialize or update selectable components within a group.
-
Constructor Summary
ConstructorsConstructorDescriptionSelectableGroupItem(String id, String text, boolean selected) Creates an instance of aSelectableGroupItemrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.booleanselected()Returns the value of theselectedrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
selected
public boolean selected()Returns the value of theselectedrecord component.- Returns:
- the value of the
selectedrecord component
-