From f8bd36bf3cf0ce5b7bffb1922a0cc406d258e786 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Tue, 9 Oct 2012 22:37:33 +0200 Subject: [PATCH] Added the ability to enumerate IntEnums. --- .../src/com/comphenix/protocol/reflect/IntEnum.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ProtocolLib/src/com/comphenix/protocol/reflect/IntEnum.java b/ProtocolLib/src/com/comphenix/protocol/reflect/IntEnum.java index a367dc9a..cb5cfb44 100644 --- a/ProtocolLib/src/com/comphenix/protocol/reflect/IntEnum.java +++ b/ProtocolLib/src/com/comphenix/protocol/reflect/IntEnum.java @@ -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 values() { + return members.keySet(); + } }