public static <K, V extends Enum<V>> @NotNull Index<K, V> create(final Class<V> type, final @NotNull Function<? super V, ? extends K> keyFunction) {
    return create(type, keyFunction, type.getEnumConstants());
  }
Creates an index map.

@param type the value type
@param keyFunction the key function
@param <K> the key type
@param <V> the value type
@return the key map
@since 4.0.0
api/src/main/java/net/kyori/adventure/util/Index.java