Record Class NativeUiInput.ButtonEvent

java.lang.Object
java.lang.Record
com.viaversion.viafabricplus.bedrock.screen.ui.NativeUiInput.ButtonEvent
Enclosing class:
NativeUiInput

public static record NativeUiInput.ButtonEvent(int source, int target, int previous, int phase, boolean transition, int mode, NativeUiInput.Scope scope, boolean handleSelect, boolean handleDeselect) extends Record
Retains the native raw phase; only phase one is a pressed controller event.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ButtonEvent(int source, int target, int previous, int phase, boolean transition, int mode, NativeUiInput.Scope scope, boolean handleSelect, boolean handleDeselect)
    Creates an instance of a ButtonEvent record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the handleDeselect record component.
    boolean
    Returns the value of the handleSelect record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the mode record component.
    int
    Returns the value of the phase record component.
    boolean
     
    int
    Returns the value of the previous record component.
    Returns the value of the scope record component.
    int
    Returns the value of the source record component.
    int
    Returns the value of the target record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the transition record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ButtonEvent

      public ButtonEvent(int source, int target, int previous, int phase, boolean transition, int mode, NativeUiInput.Scope scope, boolean handleSelect, boolean handleDeselect)
      Creates an instance of a ButtonEvent record class.
      Parameters:
      source - the value for the source record component
      target - the value for the target record component
      previous - the value for the previous record component
      phase - the value for the phase record component
      transition - the value for the transition record component
      mode - the value for the mode record component
      scope - the value for the scope record component
      handleSelect - the value for the handleSelect record component
      handleDeselect - the value for the handleDeselect record component
  • Method Details

    • pressed

      public boolean pressed()
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • source

      public int source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • target

      public int target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component
    • previous

      public int previous()
      Returns the value of the previous record component.
      Returns:
      the value of the previous record component
    • phase

      public int phase()
      Returns the value of the phase record component.
      Returns:
      the value of the phase record component
    • transition

      public boolean transition()
      Returns the value of the transition record component.
      Returns:
      the value of the transition record component
    • mode

      public int mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • scope

      public NativeUiInput.Scope scope()
      Returns the value of the scope record component.
      Returns:
      the value of the scope record component
    • handleSelect

      public boolean handleSelect()
      Returns the value of the handleSelect record component.
      Returns:
      the value of the handleSelect record component
    • handleDeselect

      public boolean handleDeselect()
      Returns the value of the handleDeselect record component.
      Returns:
      the value of the handleDeselect record component