|
18 | 18 | import redis.clients.jedis.BinaryJedis; |
19 | 19 | import redis.clients.jedis.MultiKeyPipelineBase; |
20 | 20 | import redis.clients.jedis.Protocol; |
| 21 | +import redis.clients.jedis.params.LPosParams; |
21 | 22 |
|
22 | 23 | import java.util.Collections; |
23 | 24 | import java.util.List; |
24 | 25 |
|
25 | | -import org.springframework.dao.InvalidDataAccessApiUsageException; |
26 | 26 | import org.springframework.data.redis.connection.RedisListCommands; |
27 | 27 | import org.springframework.lang.Nullable; |
28 | 28 | import org.springframework.util.Assert; |
29 | | -import redis.clients.jedis.params.LPosParams; |
30 | 29 |
|
31 | 30 | /** |
32 | 31 | * @author Christoph Strobl |
@@ -64,15 +63,16 @@ public List<Long> lPos(byte[] key, byte[] element, @Nullable Integer rank, @Null |
64 | 63 | Assert.notNull(element, "Element must not be null!"); |
65 | 64 |
|
66 | 65 | LPosParams params = new LPosParams(); |
67 | | - if(rank != null) { |
| 66 | + if (rank != null) { |
68 | 67 | params.rank(rank); |
69 | 68 | } |
70 | 69 |
|
71 | | - if(count != null) { |
| 70 | + if (count != null) { |
72 | 71 | return connection.invoke().just(BinaryJedis::lpos, MultiKeyPipelineBase::lpos, key, element, params, count); |
73 | 72 | } |
74 | 73 |
|
75 | | - return connection.invoke().from(BinaryJedis::lpos, MultiKeyPipelineBase::lpos, key, element, params).getOrElse(Collections::singletonList, Collections::emptyList); |
| 74 | + return connection.invoke().from(BinaryJedis::lpos, MultiKeyPipelineBase::lpos, key, element, params) |
| 75 | + .getOrElse(Collections::singletonList, Collections::emptyList); |
76 | 76 | } |
77 | 77 |
|
78 | 78 | /* |
|
0 commit comments