public @NotNull V valueOrThrow(final @NotNull K key) {
    final V value = this.value(key);
    if (value == null) {
      throw new NoSuchElementException("There is no value for key " + key);
    }
    return value;
  }
Gets a value by its key.

@param key the key
@return the value
@throws NoSuchElementException if there is no value for the key
@since 4.11.0
api/src/main/java/net/kyori/adventure/util/Index.java