diff --git a/src/main/java/org/springframework/data/redis/core/BoundListOperations.java b/src/main/java/org/springframework/data/redis/core/BoundListOperations.java index b1107f9db2..e9c76a1fc5 100644 --- a/src/main/java/org/springframework/data/redis/core/BoundListOperations.java +++ b/src/main/java/org/springframework/data/redis/core/BoundListOperations.java @@ -231,6 +231,7 @@ public interface BoundListOperations extends BoundKeyOperations { * @since 2.4 * @see Redis Documentation: LPOS */ + @Nullable Long indexOf(V value); /** @@ -242,6 +243,7 @@ public interface BoundListOperations extends BoundKeyOperations { * @since 2.4 * @see Redis Documentation: LPOS */ + @Nullable Long lastIndexOf(V value); /** diff --git a/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java b/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java index 842905a305..7f0a26f92b 100644 --- a/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java +++ b/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java @@ -131,13 +131,6 @@ public void rename(final String newKey) { key = newKey; } - protected void checkResult(@Nullable Object obj) { - - if (obj == null) { - throw new IllegalStateException("Cannot read collection with Redis connection in pipeline/multi-exec mode"); - } - } - @Override public boolean equals(@Nullable Object o) { @@ -168,4 +161,11 @@ public int hashCode() { public String toString() { return "%s for key: %s".formatted(getClass().getSimpleName(), getKey()); } + + protected void checkResult(@Nullable Object obj) { + + if (obj == null) { + throw new IllegalStateException("Cannot read collection with Redis connection in pipeline/multi-exec mode"); + } + } } diff --git a/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisMap.java b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisMap.java index d5cb4659ed..93fd9cbed1 100644 --- a/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisMap.java +++ b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisMap.java @@ -187,7 +187,6 @@ public int hashCode() { @Override public String toString() { - return "RedisStore for key:" + getKey(); } @@ -317,17 +316,17 @@ public DataType getType() { return hashOps.getType(); } + @Override + public Cursor> scan() { + return scan(ScanOptions.NONE); + } + private void checkResult(@Nullable Object obj) { if (obj == null) { throw new IllegalStateException("Cannot read collection with Redis connection in pipeline/multi-exec mode"); } } - @Override - public Cursor> scan() { - return scan(ScanOptions.NONE); - } - /** * @since 1.4 * @param options