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); }