@Stability.Internal public class EnumLookupTable<E extends Enum<E>> extends Object
Modifier and Type | Method and Description |
---|---|
static <E extends Enum<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.
|
public static <E extends Enum<E>> EnumLookupTable<E> create(Class<E> enumClass, Function<E,Integer> enumToIndex)
enumToIndex
- given an enum value, returns the integer associated with the value.Copyright © 2024 Couchbase, Inc.. All rights reserved.