Package ninja.leaping.configurate.util
Class EnumLookup
- java.lang.Object
-
- ninja.leaping.configurate.util.EnumLookup
-
public final class EnumLookup extends Object
Utility class to cache more flexible enum lookup.While normally case and punctuation have to match exactly, this method performs lookup that:
- is case-insensitive
- ignores underscores
- caches mappings
If the enum has two fields that are equal except for case and underscores, an exact match will return the appropriate value, and any fuzzy matches will map to the first value in the enum that is applicable.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Enum<T>>
@NonNull Optional<T>lookupEnum(@NonNull Class<T> clazz, @NonNull String key)
-