Enum Class ComponentType

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

public enum ComponentType extends Enum<ComponentType>
Stable, build-independent semantic category of an interface component.

The raw Component.type() byte is the game's jag::Component::getComponentType() return, which drifts between game builds (LAYER was 14 in one build, 19 in another). The producer classifies that raw byte into one of these stable codes (its WireCategory enum) and ships it as Component.category(); this enum mirrors those codes one-for-one. Query on this — never on the raw byte.

The numeric code() values are a wire contract shared with the producer's game/Interfaces.h: they never change, only append.

  • Enum Constant Details

  • Method Details

    • values

      public static ComponentType[] 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 ComponentType 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
    • code

      public int code()
      The stable wire code the producer emits for this category.
    • fromCode

      public static ComponentType fromCode(int code)
      Resolves a wire code to its category, or UNKNOWN for an unrecognized code (e.g. a newer producer that added a category this consumer doesn't know yet).