public static <R extends Enum<?>> Map<String, R> buildFromEnumName(Class<? extends R> enumClass) {
        Objects.requireNonNull(enumClass, "enumClass");

        R[] enumConstants = enumClass.getEnumConstants();
        if (enumConstants == null) {
            throw new IllegalArgumentException("Type is not an enum: " + enumClass);
        }
        return build(enumConstants, Enum::name);
    }
Builds an index for the given enum using {@link Enum#name()}.

@param enumClass the enum class
@param <R> the enum type
@return the index
helper/src/main/java/me/lucko/helper/utils/Indexing.java