Package com.openinventor.inventor
Class IntegerValuedEnumHelper
- java.lang.Object
-
- com.openinventor.inventor.IntegerValuedEnumHelper
-
public final class IntegerValuedEnumHelper extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description IntegerValuedEnumHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends java.lang.Enum<T> & IntegerValuedEnum>
java.util.EnumSet<T>enumSetOf(java.lang.Class<T> enumType, int integerValue)
Returns a set of enum values from an integer value.static <T extends java.lang.Enum<T> & IntegerValuedEnum>
TfromIntValue(java.lang.Class<T> enumType, int integerValue)
static <T extends java.lang.Enum<T> & IntegerValuedEnum>
intvalueOf(java.util.EnumSet<T> enumSet)
Returns an integer value of a set of enum values.
-
-
-
Method Detail
-
fromIntValue
public static <T extends java.lang.Enum<T> & IntegerValuedEnum> T fromIntValue(java.lang.Class<T> enumType, int integerValue)
-
valueOf
public static <T extends java.lang.Enum<T> & IntegerValuedEnum> int valueOf(java.util.EnumSet<T> enumSet)
Returns an integer value of a set of enum values.- Parameters:
enumSet
- set of enum values- Returns:
- the integer value of the set of enum values
-
enumSetOf
public static <T extends java.lang.Enum<T> & IntegerValuedEnum> java.util.EnumSet<T> enumSetOf(java.lang.Class<T> enumType, int integerValue)
Returns a set of enum values from an integer value.- Parameters:
enumType
- the type of the enum (needed because of type erasure)integerValue
- the value from which to compute the set of enum values- Returns:
- an enumset corresponding to the integer value or an empty enum set if a combination of enum values of the given enum type cannot be found.
-
-