Record Class VarpRead

java.lang.Object
java.lang.Record
com.botwithus.bot.api.model.VarpRead
Record Components:
id - the varp id
state - what the read found out
value - the value, low 32 bits for a LONG varp
value64 - the full value, sign-extended for a 32-bit varp
kind - how a set varp is stored; VarKind.UNKNOWN otherwise
defaultVerified - for VarpState.DEFAULT_NOT_SET_CLIENTSIDE, whether the default came from the cache definition (true) or is the fallback 0 because the cache could not say (false); true for every other state

public record VarpRead(int id, VarpState state, int value, long value64, VarKind kind, boolean defaultVerified) extends Record
One varp read: its state, and the value the game would read for it.

Test state(), never the value, to learn whether a varp is set. The value is the client's value when SET, the type default when DEFAULT_NOT_SET_CLIENTSIDE, and -1 otherwise. A set varp can itself hold -1.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The value reported for VarpState.NO_SUCH_VARP and VarpState.UNAVAILABLE.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VarpRead(int id, VarpState state, int value, long value64, VarKind kind, boolean defaultVerified)
    Creates an instance of a VarpRead record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the defaultVerified record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    True when value() is what the game reads: set, or at its default.
    int
    id()
    Returns the value of the id record component.
    boolean
    True when the client holds a value for the varp.
    Returns the value of the kind record component.
    Returns the value of the state record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the value record component.
    long
    Returns the value of the value64 record component.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • VarpRead

      public VarpRead(int id, VarpState state, int value, long value64, VarKind kind, boolean defaultVerified)
      Creates an instance of a VarpRead record class.
      Parameters:
      id - the value for the id record component
      state - the value for the state record component
      value - the value for the value record component
      value64 - the value for the value64 record component
      kind - the value for the kind record component
      defaultVerified - the value for the defaultVerified record component
  • Method Details

    • isSet

      public boolean isSet()
      True when the client holds a value for the varp.
    • hasValue

      public boolean hasValue()
      True when value() is what the game reads: set, or at its default.
    • 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.
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • state

      public VarpState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • value

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

      public long value64()
      Returns the value of the value64 record component.
      Returns:
      the value of the value64 record component
    • kind

      public VarKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • defaultVerified

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