()
| 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 -> { |
no test coverage detected