Package com.xebisco.yield
Record Class Axis
java.lang.Object
java.lang.Record
com.xebisco.yield.Axis
- Record Components:
positiveKey- The key for the positive direction.negativeKey- The key for the negative direction.altPositiveKey- The optional key for the alternative positive direction.altNegativeKey- The optional key for the alternative negative direction.
public record Axis(Input.Key positiveKey, Input.Key negativeKey, Input.Key altPositiveKey, Input.Key altNegativeKey)
extends Record
Represents an input axis with two keys for positive and negative directions.
It also includes optional keys for alternative positive and negative directions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealtNegativeKeyrecord component.Returns the value of thealtPositiveKeyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenegativeKeyrecord component.Returns the value of thepositiveKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Axis
Constructor for Axis with only positive and negative keys. The alternative positive and negative keys will be set to null.- Parameters:
positiveKey- The key for the positive direction.negativeKey- The key for the negative direction.
-
Axis
public Axis(Input.Key positiveKey, Input.Key negativeKey, Input.Key altPositiveKey, Input.Key altNegativeKey) Creates an instance of aAxisrecord class.- Parameters:
positiveKey- the value for thepositiveKeyrecord componentnegativeKey- the value for thenegativeKeyrecord componentaltPositiveKey- the value for thealtPositiveKeyrecord componentaltNegativeKey- the value for thealtNegativeKeyrecord 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). -
positiveKey
Returns the value of thepositiveKeyrecord component.- Returns:
- the value of the
positiveKeyrecord component
-
negativeKey
Returns the value of thenegativeKeyrecord component.- Returns:
- the value of the
negativeKeyrecord component
-
altPositiveKey
Returns the value of thealtPositiveKeyrecord component.- Returns:
- the value of the
altPositiveKeyrecord component
-
altNegativeKey
Returns the value of thealtNegativeKeyrecord component.- Returns:
- the value of the
altNegativeKeyrecord component
-