Package com.couchbase.client.core.util
Class EnumLookupTable<E extends Enum<E>>
- java.lang.Object
-
- com.couchbase.client.core.util.EnumLookupTable<E>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <E extends Enum<E>>
EnumLookupTable<E>create(Class<E> enumClass, Function<E,Integer> enumToIndex)
E
getOrDefault(int index, E defaultValue)
Returns the enum value associated with the given integer, or the default value if not found.
-
-
-
Method Detail
-
create
public static <E extends Enum<E>> EnumLookupTable<E> create(Class<E> enumClass, Function<E,Integer> enumToIndex)
- Parameters:
enumToIndex
- given an enum value, returns the integer associated with the value.
-
-