static @NotNull OptionalInt checkNamespace(final @NotNull String namespace) {
    for (int i = 0, length = namespace.length(); i < length; i++) {
      if (!allowedInNamespace(namespace.charAt(i))) {
        return OptionalInt.of(i);
      }
    }
    return OptionalInt.empty();
  }
Checks if {@code value} is a valid namespace.

@param namespace the string to check
@return {@link OptionalInt#empty()} if {@code value} is a valid namespace, otherwise an {@code OptionalInt} containing the index of an invalid character
@since 4.14.0
key/src/main/java/net/kyori/adventure/key/Key.java