Package com.comphenix.protocol.reflect
Class IntEnum
java.lang.Object
com.comphenix.protocol.reflect.IntEnum
Represents a traditional int field enum.
- Author:
- Kristian
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDeclaredName(Integer id)Retrieve the name of the member with the given id.booleanhasMember(int id)Determines whether or not the given member exists.protected voidRegisters every public int field as a member.protected voidregisterMember(int id, String name)Registers a member.Retrieve the ID of the member with the given name.values()Retrieve the ID of every registered member.
-
Field Details
-
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
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
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
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
Retrieve the ID of every registered member.- Returns:
- Enumeration of every value.
-