Record Class VarbitType

java.lang.Object
java.lang.Record
com.botwithus.bot.api.model.VarbitType
Record Components:
id - the varbit type ID
varId - the base variable id the bits are read from
domainType - the variable domain (0 = player varp)
lsb - least-significant bit index, inclusive
msb - most-significant bit index, inclusive

public record VarbitType(int id, int varId, int domainType, int lsb, int msb) extends Record
Varbit (variable bit) definition from the game cache. A varbit is a bit-range view onto a base variable: bits [lsb, msb] (inclusive) of variable varId in domain domainType (0 = player varp).

Decoding lives consumer-side — the producer exposes only raw variable reads, and VariableAPI.getVarbit(int) reads the base variable then shifts/masks with these fields.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    VarbitType(int id, int varId, int domainType, int lsb, int msb)
    Creates an instance of a VarbitType record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the domainType record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    id()
    Returns the value of the id record component.
    int
    lsb()
    Returns the value of the lsb record component.
    int
    msb()
    Returns the value of the msb record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the varId record component.

    Methods inherited from class Object

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

    • VarbitType

      public VarbitType(int id, int varId, int domainType, int lsb, int msb)
      Creates an instance of a VarbitType record class.
      Parameters:
      id - the value for the id record component
      varId - the value for the varId record component
      domainType - the value for the domainType record component
      lsb - the value for the lsb record component
      msb - the value for the msb 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 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
    • varId

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

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

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

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