Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
Add missing Nullable annotations. Reorder methods.

See: #2996
Original pull request: #2997
  • Loading branch information
mp911de committed Sep 17, 2024
1 parent 5ff156c commit f687de9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ public interface BoundListOperations<K, V> extends BoundKeyOperations<K> {
* @since 2.4
* @see <a href="https://redis.io/commands/lpos">Redis Documentation: LPOS</a>
*/
@Nullable
Long indexOf(V value);

/**
Expand All @@ -242,6 +243,7 @@ public interface BoundListOperations<K, V> extends BoundKeyOperations<K> {
* @since 2.4
* @see <a href="https://redis.io/commands/lpos">Redis Documentation: LPOS</a>
*/
@Nullable
Long lastIndexOf(V value);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down Expand Up @@ -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");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ public int hashCode() {

@Override
public String toString() {

return "RedisStore for key:" + getKey();
}

Expand Down Expand Up @@ -317,17 +316,17 @@ public DataType getType() {
return hashOps.getType();
}

@Override
public Cursor<java.util.Map.Entry<K, V>> 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<java.util.Map.Entry<K, V>> scan() {
return scan(ScanOptions.NONE);
}

/**
* @since 1.4
* @param options
Expand Down

0 comments on commit f687de9

Please sign in to comment.