MCPcopy Create free account
hub / github.com/PaperMC/Paper / validate

Method validate

paper-api/src/main/java/org/bukkit/NamespacedKey.java:82–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 }
81
82 private void validate() {
83 Preconditions.checkArgument(this.namespace.length() + 1 + this.key.length() <= Short.MAX_VALUE, "NamespacedKey must be less than 32768 characters");
84 checkError("[a-z0-9_-.]", "namespace", this.namespace, Key.checkNamespace(this.namespace)); // note: for now we will pretend ".." is a valid namespace like adventure to not break conversion
85 checkError("[a-z0-9_-./]", "key", this.key, Key.checkValue(this.key));
86 }
87
88 private static void checkError(String pattern, String name, String value, OptionalInt index) {
89 index.ifPresent(indexValue -> {

Callers 1

NamespacedKeyMethod · 0.95

Calls 2

checkErrorMethod · 0.95
lengthMethod · 0.45

Tested by

no test coverage detected