From 9a105cfc926ff00bb87943fe81f227af71253bf7 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 22 Mar 2023 10:41:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BF=D1=80=D0=BE=D0=B1=D0=BB=D0=B5=D0=BC=D1=83=20?= =?UTF-8?q?=D1=81=20BoxAnswer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../godfather/quarkus/domain/unit/AnswerText.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/unit/AnswerText.java b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/unit/AnswerText.java index 1553e6a..1982fe7 100644 --- a/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/unit/AnswerText.java +++ b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/unit/AnswerText.java @@ -19,6 +19,8 @@ import java.util.function.Supplier; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static dev.struchkov.godfather.quarkus.domain.BoxAnswer.boxAnswer; + /** * Используется для отправки ответа пользователю. * @@ -58,11 +60,7 @@ public class AnswerText extends MainUnit { } public static AnswerText of(String message) { - return AnswerText.builder().answer(BoxAnswer.boxAnswer(message)).build(); - } - - public static AnswerText of(BoxAnswer boxAnswer) { - return AnswerText.builder().answer(boxAnswer).build(); + return AnswerText.builder().answer(() -> boxAnswer(message)).build(); } public static Builder builder() { @@ -123,11 +121,6 @@ public class AnswerText extends MainUnit { return this; } - public Builder answer(BoxAnswer answer) { - this.boxAnswer = message -> Uni.createFrom().item(answer); - return this; - } - public Builder answer(Supplier answer) { this.boxAnswer = message -> Uni.createFrom().item(answer.get()); return this;