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)
| 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. |
nothing calls this directly
no test coverage detected