Added the ability to enumerate IntEnums.

This commit is contained in:
Kristian S. Stangeland 2012-10-09 22:37:33 +02:00
parent cecab6a169
commit f8bd36bf3c
1 changed files with 9 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package com.comphenix.protocol.reflect;
import java.lang.reflect.Field;
import java.util.Set;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
@ -76,4 +77,12 @@ public class IntEnum {
public String getDeclaredName(Integer id) {
return members.get(id);
}
/**
* Retrieve the ID of every registered member.
* @return Enumeration of every value.
*/
public Set<Integer> values() {
return members.keySet();
}
}