aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/ymc/acron/config/json/Rule.java
diff options
context:
space:
mode:
authorTrumeet <yuuta@yuuta.moe>2022-07-26 19:06:11 -0700
committerTrumeet <yuuta@yuuta.moe>2022-07-26 19:06:11 -0700
commitd8fe269327a1a51f2588a3573a4764613da16388 (patch)
tree97bd20983700bb13eba7f7d524d3c6d529303b46 /src/main/java/moe/ymc/acron/config/json/Rule.java
parent31a5d2990ba666ce5ef4a1f79f7999a9bdfaac2a (diff)
downloadacron-d8fe269327a1a51f2588a3573a4764613da16388.tar
acron-d8fe269327a1a51f2588a3573a4764613da16388.tar.gz
acron-d8fe269327a1a51f2588a3573a4764613da16388.tar.bz2
acron-d8fe269327a1a51f2588a3573a4764613da16388.zip
Move the mod to mod/
Diffstat (limited to 'src/main/java/moe/ymc/acron/config/json/Rule.java')
-rw-r--r--src/main/java/moe/ymc/acron/config/json/Rule.java35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/main/java/moe/ymc/acron/config/json/Rule.java b/src/main/java/moe/ymc/acron/config/json/Rule.java
deleted file mode 100644
index 114e17d..0000000
--- a/src/main/java/moe/ymc/acron/config/json/Rule.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package moe.ymc.acron.config.json;
-
-import com.google.gson.annotations.SerializedName;
-import moe.ymc.acron.auth.Action;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.regex.Pattern;
-
-class Rule implements ConfigJsonObject<moe.ymc.acron.auth.Rule> {
- @SerializedName("regex")
- private final String regex;
-
- @SerializedName("action")
- private final Action action;
-
- @SerializedName("display")
- private final boolean display;
-
- private Rule(String regex,
- Action action,
- boolean display) {
- this.regex = regex;
- this.action = action;
- this.display = display;
- }
-
- public @NotNull moe.ymc.acron.auth.Rule create(boolean startup) throws ConfigDeserializationException {
- if (regex == null || regex.trim().equals("") ||
- action == null) throw new ConfigDeserializationException(".clients.[]rules.regex or .clients.[]rules.action is" +
- "not specified.");
- return new moe.ymc.acron.auth.Rule(Pattern.compile(regex),
- action,
- display);
- }
-}