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
-
Method Summary
Modifier and TypeMethodDescriptionarea()
Returns the value of thearea
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.key()
Returns the value of thekey
record component.Creates a focus of an area andnull
data.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
Creates a focus of an area andnull
data.- 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 thekey
record component.- Returns:
- the value of the
key
record component
-
area
Returns the value of thearea
record component.- Returns:
- the value of the
area
record component
-