Enum Class VarpState

java.lang.Object
java.lang.Enum<VarpState>
com.botwithus.bot.api.model.VarpState
All Implemented Interfaces:
Serializable, Comparable<VarpState>, Constable

public enum VarpState extends Enum<VarpState>
What a varp read found out about the variable.

Varps are set lazily by the server, so a varp at its default usually has no client entry at all. That is a different answer from "no such varp" and from "the read failed", and a value alone cannot tell them apart: an object-typed varp legitimately reads -1 whether it is set or defaulted.

  • Enum Constant Details

    • SET

      public static final VarpState SET
      The client holds a value for the varp; VarpRead.value() is it.
    • DEFAULT_NOT_SET_CLIENTSIDE

      public static final VarpState DEFAULT_NOT_SET_CLIENTSIDE
      The varp exists but the client holds no entry for it, so it is at its type default. The value reported is that default, which is exactly what the game itself reads. VarpRead.defaultVerified() says whether the default came from the cache definition or is the plain fallback 0.
    • NO_SUCH_VARP

      public static final VarpState NO_SUCH_VARP
      The cache has no varp with this id. The value is -1.
    • UNAVAILABLE

      public static final VarpState UNAVAILABLE
      The read could not be made: not in game, still entering the world, an invalid id, or a timed-out read. Nothing is known about the varp. The value is -1, and code that tracks a value over time should keep its last known one.
  • Method Details

    • values

      public static VarpState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static VarpState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null