public class IntEnum
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected com.google.common.collect.BiMap<java.lang.Integer,java.lang.String> |
members |
Constructor and Description |
---|
IntEnum()
Registers every declared integer field.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDeclaredName(java.lang.Integer id)
Retrieve the name of the member with the given id.
|
boolean |
hasMember(int id)
Determines whether or not the given member exists.
|
protected void |
registerAll()
Registers every public int field as a member.
|
protected void |
registerMember(int id,
java.lang.String name)
Registers a member.
|
java.lang.Integer |
valueOf(java.lang.String name)
Retrieve the ID of the member with the given name.
|
java.util.Set<java.lang.Integer> |
values()
Retrieve the ID of every registered member.
|
protected com.google.common.collect.BiMap<java.lang.Integer,java.lang.String> members
protected void registerAll()
protected void registerMember(int id, java.lang.String name)
id
- - id of member.name
- - name of member.public boolean hasMember(int id)
id
- - the ID of the member to find.public java.lang.Integer valueOf(java.lang.String name)
name
- - name of member to retrieve.public java.lang.String getDeclaredName(java.lang.Integer id)
id
- - id of the member to retrieve.public java.util.Set<java.lang.Integer> values()