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 Details

    • Axis

      public Axis(Input.Key positiveKey, Input.Key negativeKey)
      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 a Axis record class.
      Parameters:
      positiveKey - the value for the positiveKey record component
      negativeKey - the value for the negativeKey record component
      altPositiveKey - the value for the altPositiveKey record component
      altNegativeKey - the value for the altNegativeKey record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • positiveKey

      public Input.Key positiveKey()
      Returns the value of the positiveKey record component.
      Returns:
      the value of the positiveKey record component
    • negativeKey

      public Input.Key negativeKey()
      Returns the value of the negativeKey record component.
      Returns:
      the value of the negativeKey record component
    • altPositiveKey

      public Input.Key altPositiveKey()
      Returns the value of the altPositiveKey record component.
      Returns:
      the value of the altPositiveKey record component
    • altNegativeKey

      public Input.Key altNegativeKey()
      Returns the value of the altNegativeKey record component.
      Returns:
      the value of the altNegativeKey record component