Class IntEnum

java.lang.Object
com.comphenix.protocol.reflect.IntEnum

public class IntEnum extends Object
Represents a traditional int field enum.
Author:
Kristian
  • Field Details

    • members

      protected com.google.common.collect.BiMap<Integer,​String> members
  • Constructor Details

    • IntEnum

      public IntEnum()
      Registers every declared integer field.
  • Method Details

    • registerAll

      protected void registerAll()
      Registers every public int field as a member.
    • registerMember

      protected void registerMember(int id, String name)
      Registers a member.
      Parameters:
      id - - id of member.
      name - - name of member.
    • hasMember

      public boolean hasMember(int id)
      Determines whether or not the given member exists.
      Parameters:
      id - - the ID of the member to find.
      Returns:
      TRUE if a member with the given ID exists, FALSE otherwise.
    • valueOf

      public Integer valueOf(String name)
      Retrieve the ID of the member with the given name.
      Parameters:
      name - - name of member to retrieve.
      Returns:
      ID of the member, or NULL if not found.
    • getDeclaredName

      public String getDeclaredName(Integer id)
      Retrieve the name of the member with the given id.
      Parameters:
      id - - id of the member to retrieve.
      Returns:
      Declared name of the member, or NULL if not found.
    • values

      public Set<Integer> values()
      Retrieve the ID of every registered member.
      Returns:
      Enumeration of every value.