From 86441e86f6a783797f89fcaad7e36597c575506c Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Sat, 18 Feb 2023 10:51:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B8=20=D0=B8=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=BF=D0=BB=D0=B0=D0=B3=D0=B8?= =?UTF-8?q?=D0=BD=20=D1=80=D0=B5=D0=BB=D0=B8=D0=B7=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 46 +++++++++++++------ .../struchkov/autoresponder/Responder.java | 12 ++--- src/main/java/module-info.java | 1 - 3 files changed, 39 insertions(+), 20 deletions(-) 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