java.lang.Object
java.lang.Record
com.dua3.utility.fx.controls.PinBoard.Item
- Record Components:
name- The name of the item.area- The area occupied by the item on the PinBoard.nodeBuilder- A supplier that can be used to build the Node representation of the item.
- Enclosing class:
- PinBoard
public static record PinBoard.Item(String name, Rectangle2D area, Supplier<Node> nodeBuilder)
extends Record
The Item class represents an item on a PinBoard. It contains information about the item's name, area,
and a supplier that can be used to build the item's Node representation.
-
Constructor Summary
ConstructorsConstructorDescriptionItem(String name, Rectangle2D area, Supplier<Node> nodeBuilder) Creates an instance of aItemrecord class. -
Method Summary
Modifier and TypeMethodDescriptionarea()Returns the value of thearearecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thenodeBuilderrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Item
Creates an instance of aItemrecord class.- Parameters:
name- the value for thenamerecord componentarea- the value for thearearecord componentnodeBuilder- the value for thenodeBuilderrecord 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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
area
Returns the value of thearearecord component.- Returns:
- the value of the
arearecord component
-
nodeBuilder
Returns the value of thenodeBuilderrecord component.- Returns:
- the value of the
nodeBuilderrecord component
-