From 420c7005815ae8871a4319943b900e95513439ae Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Sat, 15 Apr 2023 12:56:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3=20SwitchUnit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../quarkus/domain/unit/SwitchUnit.java | 41 +------------------ 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/unit/SwitchUnit.java b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/unit/SwitchUnit.java index c257222..3e9e57a 100644 --- a/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/unit/SwitchUnit.java +++ b/bot-domain/bot-domain-quarkus/src/main/java/dev/struchkov/godfather/quarkus/domain/unit/SwitchUnit.java @@ -3,19 +3,12 @@ package dev.struchkov.godfather.quarkus.domain.unit; import dev.struchkov.godfather.main.domain.content.Message; import dev.struchkov.godfather.main.domain.unit.KeyWord; import dev.struchkov.godfather.main.domain.unit.UnitActiveType; -import dev.struchkov.godfather.quarkus.domain.BoxAnswer; -import dev.struchkov.godfather.quarkus.domain.unit.func.CallBackConsumer; -import dev.struchkov.godfather.quarkus.domain.unit.func.ProcessingData; import dev.struchkov.godfather.quarkus.domain.unit.func.UniPredicate; -import io.smallrye.mutiny.Uni; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.Supplier; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -36,7 +29,7 @@ public class SwitchUnit extends MainUnit { builder.description, TYPE, builder.activeType, - builder.notSaveHistory + true ); } @@ -59,10 +52,6 @@ public class SwitchUnit extends MainUnit { private Integer priority; private UnitActiveType activeType; - private boolean notSaveHistory; - - private ProcessingData boxAnswer; - private CallBackConsumer callBack; private Builder() { } @@ -77,29 +66,6 @@ public class SwitchUnit extends MainUnit { return this; } - public SwitchUnit.Builder answer(Consumer answer) { - this.boxAnswer = message -> { - answer.accept(message); - return Uni.createFrom().nullItem(); - }; - return this; - } - - public SwitchUnit.Builder answer(Function> answer) { - this.boxAnswer = answer::apply; - return this; - } - - public SwitchUnit.Builder answer(Supplier answer) { - this.boxAnswer = message -> Uni.createFrom().item(answer.get()); - return this; - } - - public SwitchUnit.Builder callBack(CallBackConsumer callBack) { - this.callBack = callBack; - return this; - } - public SwitchUnit.Builder triggerWords(Set val) { if (triggerWords == null) { triggerWords = new HashSet<>(); @@ -181,11 +147,6 @@ public class SwitchUnit extends MainUnit { return this; } - public SwitchUnit.Builder notSaveHistory() { - notSaveHistory = true; - return this; - } - public SwitchUnit.Builder activeType(UnitActiveType val) { activeType = val; return this;