From 1dabb026f324381eee9af20b89a0a12b925d3499 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Sun, 23 Apr 2023 04:14:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20StorylineContext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../godfather/quarkus/context/repository/StorylineContext.java | 2 +- .../godfather/simple/context/repository/StorylineContext.java | 2 +- .../quarkus/core/service/StorylineContextMapImpl.java | 3 ++- .../godfather/simple/core/service/StorylineContextMapImpl.java | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineContext.java b/bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineContext.java index 4d3de59..50d9e52 100644 --- a/bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineContext.java +++ b/bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineContext.java @@ -8,7 +8,7 @@ import java.util.Map; public interface StorylineContext { - Uni save(@NotNull String personId, @NotNull ContextKey key, Object objectForSave); + Uni save(@NotNull String personId, @NotNull ContextKey key, T objectForSave); Uni getByKey(@NotNull String personId, @NotNull ContextKey key); diff --git a/bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineContext.java b/bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineContext.java index 63cde9f..8ecfca4 100644 --- a/bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineContext.java +++ b/bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineContext.java @@ -8,7 +8,7 @@ import java.util.Optional; public interface StorylineContext { - void save(@NotNull String personId, @NotNull ContextKey key, Object objectForSave); + void save(@NotNull String personId, @NotNull ContextKey key, T objectForSave); Optional getByKey(@NotNull String personId, @NotNull ContextKey key); diff --git a/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/service/StorylineContextMapImpl.java b/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/service/StorylineContextMapImpl.java index f564cb9..1dc0412 100644 --- a/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/service/StorylineContextMapImpl.java +++ b/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/service/StorylineContextMapImpl.java @@ -16,7 +16,8 @@ public class StorylineContextMapImpl implements StorylineContext { private final Map> map = new HashMap<>(); - public Uni save(@NotNull String personId, @NotNull ContextKey key, Object objectForSave) { + @Override + public Uni save(@NotNull String personId, @NotNull ContextKey key, T objectForSave) { isNotNull(personId, key); map.computeIfAbsent(personId, k -> new HashMap<>()).put(key.getValue(), objectForSave); return Uni.createFrom().voidItem(); diff --git a/bot-core/bot-core-simple/src/main/java/dev/struchkov/godfather/simple/core/service/StorylineContextMapImpl.java b/bot-core/bot-core-simple/src/main/java/dev/struchkov/godfather/simple/core/service/StorylineContextMapImpl.java index c2df218..0cb7f99 100644 --- a/bot-core/bot-core-simple/src/main/java/dev/struchkov/godfather/simple/core/service/StorylineContextMapImpl.java +++ b/bot-core/bot-core-simple/src/main/java/dev/struchkov/godfather/simple/core/service/StorylineContextMapImpl.java @@ -16,8 +16,9 @@ public class StorylineContextMapImpl implements StorylineContext { private final Map> map = new HashMap<>(); + @Override - public void save(@NotNull String personId, @NotNull ContextKey key, Object objectForSave) { + public void save(@NotNull String personId, @NotNull ContextKey key, T objectForSave) { isNotNull(personId, key); map.computeIfAbsent(personId, k -> new HashMap<>()).put(key.getValue(), objectForSave); }