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;