Поправил проблему с BoxAnswer
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Struchkov Mark 2023-03-22 14:17:52 +03:00
parent 9a105cfc92
commit 12d224a218
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6

View File

@ -55,11 +55,7 @@ public class AnswerText<M extends Message> extends MainUnit<M> {
} }
public static <M extends Message> AnswerText<M> of(String message) { public static <M extends Message> AnswerText<M> of(String message) {
return AnswerText.<M>builder().answer(BoxAnswer.boxAnswer(message)).build(); return AnswerText.<M>builder().answer(() -> BoxAnswer.boxAnswer(message)).build();
}
public static <M extends Message> AnswerText<M> of(BoxAnswer boxAnswer) {
return AnswerText.<M>builder().answer(boxAnswer).build();
} }
public static <M extends Message> Builder<M> builder() { public static <M extends Message> Builder<M> builder() {
@ -120,11 +116,6 @@ public class AnswerText<M extends Message> extends MainUnit<M> {
return this; return this;
} }
public Builder<M> answer(BoxAnswer answer) {
this.boxAnswer = message -> Optional.ofNullable(answer);
return this;
}
public Builder<M> answer(Supplier<BoxAnswer> answer) { public Builder<M> answer(Supplier<BoxAnswer> answer) {
this.boxAnswer = message -> Optional.ofNullable(answer.get()); this.boxAnswer = message -> Optional.ofNullable(answer.get());
return this; return this;