Skip to content

Commit

Permalink
Add delegate reverse operations without using SequencedCollections.re…
Browse files Browse the repository at this point in the history
…versed().

* Add delegate methods to avoid using Java 21 API.
* Rename ReversedRedisList to ReversedRedisListView to express its view aspect.
* Refine tests.

Closes spring-projects#2602
  • Loading branch information
mp911de authored and jxblum committed Sep 7, 2023
1 parent 7e9f7bd commit b5d045c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 448 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ public E moveFirstTo(RedisList<E> destination, RedisListCommands.Direction desti

@Override
public E moveFirstTo(RedisList<E> destination, RedisListCommands.Direction destinationPosition, long timeout,
TimeUnit unit) {
TimeUnit unit) {

Assert.notNull(destination, "Destination must not be null");
Assert.notNull(destinationPosition, "Destination position must not be null");
Assert.notNull(unit, "TimeUnit must not be null");

E result = listOps.move(RedisListCommands.Direction.first(), destination.getKey(), destinationPosition, timeout,
unit);
unit);
potentiallyCap(destination);
return result;
}
Expand All @@ -144,14 +144,14 @@ public E moveLastTo(RedisList<E> destination, RedisListCommands.Direction destin

@Override
public E moveLastTo(RedisList<E> destination, RedisListCommands.Direction destinationPosition, long timeout,
TimeUnit unit) {
TimeUnit unit) {

Assert.notNull(destination, "Destination must not be null");
Assert.notNull(destinationPosition, "Destination position must not be null");
Assert.notNull(unit, "TimeUnit must not be null");

E result = listOps.move(RedisListCommands.Direction.last(), destination.getKey(), destinationPosition, timeout,
unit);
unit);
potentiallyCap(destination);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,8 @@ static <E> RedisList<E> create(String key, RedisOperations<String, E> operations
}

/**
<<<<<<< HEAD
* Factory method used to construct a new {@link RedisList} from a Redis list reference by the given {@link String
* key}.
=======
* Factory method used to construct a new {@link RedisList} from a Redis list reference by
* the given {@link String key}.
>>>>>>> 4c9e5912d (Create ReversedRedisList class and view of a wrapped RedisList in reverse order.)
*
* @param key Redis key of this list.
* @param operations {@link RedisOperations} for the value type of this list.
Expand Down
Loading

0 comments on commit b5d045c

Please sign in to comment.