Поправил проблему с BoxAnswer
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f485af1d22
commit
9a105cfc92
@ -19,6 +19,8 @@ import java.util.function.Supplier;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static dev.struchkov.godfather.quarkus.domain.BoxAnswer.boxAnswer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Используется для отправки ответа пользователю.
|
* Используется для отправки ответа пользователю.
|
||||||
*
|
*
|
||||||
@ -58,11 +60,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(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() {
|
||||||
@ -123,11 +121,6 @@ public class AnswerText<M extends Message> extends MainUnit<M> {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder<M> answer(BoxAnswer answer) {
|
|
||||||
this.boxAnswer = message -> Uni.createFrom().item(answer);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Builder<M> answer(Supplier<BoxAnswer> answer) {
|
public Builder<M> answer(Supplier<BoxAnswer> answer) {
|
||||||
this.boxAnswer = message -> Uni.createFrom().item(answer.get());
|
this.boxAnswer = message -> Uni.createFrom().item(answer.get());
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
Reference in New Issue
Block a user