diff --git a/pom.xml b/pom.xml index 7e9ee92..be9e154 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ dev.struchkov autoresponder - 3.5.0 + 3.6.0-SNAPSHOT jar Abstract Autoresponder @@ -27,18 +27,27 @@ UTF-8 UTF-8 - 1.4.0 + 2.6.0 - 5.8.2 - 1.7.36 - 23.0.0 + + 5.9.2 + + 2.0.6 + 3.10.1 + 1.6.13 + 3.2.1 - 3.4.0 + + 3.5.0 + 3.0.1 - 3.0.0-M6 + + 3.0.0-M9 + + 3.0.0-M7 @@ -54,12 +63,6 @@ ${haiti.utils.ver} - - org.jetbrains - annotations - ${jetbrains.annotation.ver} - - org.junit.jupiter junit-jupiter-engine @@ -143,10 +146,27 @@ + + org.apache.maven.plugins + maven-release-plugin + ${plugin.maven.release.ver} + + clean install + v.@{project.version} + true + false + true + true + + + + org.apache.maven.plugins + maven-release-plugin + org.apache.maven.plugins maven-compiler-plugin diff --git a/src/main/java/dev/struchkov/autoresponder/Responder.java b/src/main/java/dev/struchkov/autoresponder/Responder.java index 3b312a1..e01e651 100644 --- a/src/main/java/dev/struchkov/autoresponder/Responder.java +++ b/src/main/java/dev/struchkov/autoresponder/Responder.java @@ -16,8 +16,10 @@ import java.util.function.Predicate; import java.util.regex.Pattern; import static dev.struchkov.autoresponder.util.Parser.splitWords; +import static dev.struchkov.haiti.utils.Checker.checkEmpty; import static dev.struchkov.haiti.utils.Checker.checkNotEmpty; import static dev.struchkov.haiti.utils.Checker.checkNotNull; +import static dev.struchkov.haiti.utils.Checker.checkNull; import static dev.struchkov.haiti.utils.Exceptions.utilityClass; import static dev.struchkov.haiti.utils.Inspector.isNotNull; @@ -101,21 +103,19 @@ public final class Responder { } private static > boolean isNotCheck(U unit) { - return unit.getTriggerCheck() == null; + return checkNull(unit.getTriggerCheck()); } private static > boolean isNotPhrase(U unit) { - final Set phrases = unit.getPhrases(); - return phrases == null || phrases.isEmpty(); + return checkEmpty(unit.getPhrases()); } private static > boolean isNotPattern(U unit) { - return unit.getTriggerPatterns() == null || unit.getTriggerPatterns().isEmpty(); + return checkEmpty(unit.getTriggerPatterns()); } private static > boolean isNotKeyWords(U unit) { - final Set keyWords = unit.getTriggerWords(); - return keyWords == null || keyWords.isEmpty(); + return checkEmpty(unit.getTriggerWords()); } private static boolean patternReg(Pattern pattern, String message) { diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index a88900b..52f4b3d 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -2,5 +2,4 @@ module autoresponder.copy { requires haiti.utils; requires org.slf4j; - requires org.jetbrains.annotations; } \ No newline at end of file