Record Class Controller.Key
java.lang.Object
java.lang.Record
nz.ac.vuw.ecs.swen225.gp6.app.utilities.Controller.Key
- Record Components:
modifier- The modifier key pressed.key- The key pressed.
- Enclosing class:
- Controller
The key object that represents the key pressed.
-
Constructor Summary
Constructors -
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.intkey()Returns the value of thekeyrecord component.intmodifier()Returns the value of themodifierrecord component.toString()Returns a string representation of this record class.static StringtoString(int modifier, int key) Converts the key combo to a string.
-
Constructor Details
-
Method Details
-
toString
Converts the key combo to a string.- Parameters:
modifier- The modifier keys pressed.key- The key pressed.- Returns:
- The string representation of the key combo.
-
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 with '=='. -
modifier
public int modifier()Returns the value of themodifierrecord component.- Returns:
- the value of the
modifierrecord component
-
key
public int key()Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-