MCPcopy Create free account
hub / github.com/Teneted/Tenet / NamespacedKey

Method NamespacedKey

src/main/java/org/bukkit/NamespacedKey.java:46–56  ·  view source on GitHub ↗

Create a key in a specific namespace. @param namespace namespace @param key key @deprecated should never be used by plugins, for internal use only!!

(@NotNull String namespace, @NotNull String key)

Source from the content-addressed store, hash-verified

44 * @deprecated should never be used by plugins, for internal use only!!
45 */
46 @Deprecated
47 public NamespacedKey(@NotNull String namespace, @NotNull String key) {
48 Preconditions.checkArgument(namespace != null && VALID_NAMESPACE.matcher(namespace).matches(), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace);
49 Preconditions.checkArgument(key != null && VALID_KEY.matcher(key).matches(), "Invalid key. Must be [a-z0-9/._-]: %s", key);
50
51 this.namespace = namespace;
52 this.key = key;
53
54 String string = toString();
55 Preconditions.checkArgument(string.length() < 256, "NamespacedKey must be less than 256 characters", string);
56 }
57
58 /**
59 * Create a key in the plugin's namespace.

Callers

nothing calls this directly

Calls 5

toStringMethod · 0.95
toLowerCaseMethod · 0.80
matchesMethod · 0.65
getNameMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected