E - the type of the enumpublic class EnumInterner<E extends Enum<E>> extends Object
| Modifier and Type | Field and Description |
|---|---|
static ClassLocal<EnumInterner<?>> |
ENUM_INTERNER
A cache for EnumInterner instances.
|
| Constructor and Description |
|---|
EnumInterner(Class<E> eClass)
Constructs a new EnumInterner with a default capacity.
|
EnumInterner(Class<E> eClass,
int capacity)
Constructs a new EnumInterner with a specified capacity.
|
| Modifier and Type | Method and Description |
|---|---|
E |
intern(@NotNull CharSequence cs)
Looks up an enum value by its name.
|
public static final ClassLocal<EnumInterner<?>> ENUM_INTERNER
public EnumInterner(Class<E> eClass) throws IllegalArgumentException
eClass - the enum classIllegalArgumentException - if an illegal argument is providedpublic EnumInterner(Class<E> eClass, int capacity) throws IllegalArgumentException
eClass - the enum classcapacity - the initial capacity of the EnumInternerIllegalArgumentException - if an illegal argument is providedpublic E intern(@NotNull @NotNull CharSequence cs)
cs - the name of the enum valueCopyright © 2024. All rights reserved.