Provide an IDE pattern hint for plugin IDs (#1712)

* Provide an IDE pattern hint for plugin IDs

* order my imports the right way
This commit is contained in:
Warrior
2026-01-19 13:43:06 +01:00
committed by GitHub
parent 372a3b28bd
commit 21671daebe
3 changed files with 8 additions and 1 deletions

View File

@@ -24,7 +24,8 @@ import org.checkerframework.checker.nullness.qual.Nullable;
*/
public final class SerializedPluginDescription {
public static final Pattern ID_PATTERN = Pattern.compile("[a-z][a-z0-9-_]{0,63}");
public static final String ID_PATTERN_STRING = "[a-z][a-z0-9-_]{0,63}";
public static final Pattern ID_PATTERN = Pattern.compile(ID_PATTERN_STRING);
// @Nullable is used here to make GSON skip these in the serialized file
private final String id;