Record Class VarpRead
java.lang.Object
java.lang.Record
com.botwithus.bot.api.model.VarpRead
- Record Components:
id- the varp idstate- what the read found outvalue- the value, low 32 bits for aLONGvarpvalue64- the full value, sign-extended for a 32-bit varpkind- how a set varp is stored;VarKind.UNKNOWNotherwisedefaultVerified- forVarpState.DEFAULT_NOT_SET_CLIENTSIDE, whether the default came from the cache definition (true) or is the fallback0because the cache could not say (false);truefor 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
FieldsModifier and TypeFieldDescriptionstatic final intThe value reported forVarpState.NO_SUCH_VARPandVarpState.UNAVAILABLE. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thedefaultVerifiedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasValue()True whenvalue()is what the game reads: set, or at its default.intid()Returns the value of theidrecord component.booleanisSet()True when the client holds a value for the varp.kind()Returns the value of thekindrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.intvalue()Returns the value of thevaluerecord component.longvalue64()Returns the value of thevalue64record component.
-
Field Details
-
NO_VALUE
public static final int NO_VALUEThe value reported forVarpState.NO_SUCH_VARPandVarpState.UNAVAILABLE.- See Also:
-
-
Constructor Details
-
VarpRead
public VarpRead(int id, VarpState state, int value, long value64, VarKind kind, boolean defaultVerified) Creates an instance of aVarpReadrecord class.- Parameters:
id- the value for theidrecord componentstate- the value for thestaterecord componentvalue- the value for thevaluerecord componentvalue64- the value for thevalue64record componentkind- the value for thekindrecord componentdefaultVerified- the value for thedefaultVerifiedrecord component
-
-
Method Details
-
isSet
public boolean isSet()True when the client holds a value for the varp. -
hasValue
public boolean hasValue()True whenvalue()is what the game reads: set, or at its default. -
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
state
-
value
-
value64
-
kind
-
defaultVerified
public boolean defaultVerified()Returns the value of thedefaultVerifiedrecord component.- Returns:
- the value of the
defaultVerifiedrecord component
-