Record Class Focus<K>
java.lang.Object
java.lang.Record
io.github.cottonmc.cotton.gui.widget.focus.Focus<K>
- Type Parameters:
K- the key type- Record Components:
key- the keyarea- the focusable area in widget space
A focus is a focusable area in a widget.
Foci can also carry a "key", which is a custom data value
used to identify a specific focus. For example, an item slot grid
widget might use K = Integer to identify each individual slot.
- Since:
- 7.0.0
-
Constructor Summary
Constructors -
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.key()Returns the value of thekeyrecord component.Creates a focus of an area andnulldata.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
Creates a focus of an area andnulldata.- Parameters:
area- the area- Returns:
- the focus
-
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). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
area
Returns the value of thearearecord component.- Returns:
- the value of the
arearecord component
-