Skip to content

Commit 4616f7e

Browse files
committed
Add SINTERCARD operation to Jedis and Lettuce set commands
Signed-off-by: Kiminni <imk0980@gmail.com>
1 parent 4445d2d commit 4616f7e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/main/java/org/springframework/data/redis/connection/jedis/JedisSetCommands.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
/**
3939
* @author Christoph Strobl
4040
* @author Mark Paluch
41+
* @author Mingi Lee
4142
* @since 2.0
4243
*/
4344
@NullUnmarked
@@ -105,6 +106,15 @@ public Long sInterStore(byte @NonNull [] destKey, byte @NonNull [] @NonNull... k
105106
return connection.invoke().just(Jedis::sinterstore, PipelineBinaryCommands::sinterstore, destKey, keys);
106107
}
107108

109+
@Override
110+
public Long sInterCard(byte @NonNull [] @NonNull... keys) {
111+
112+
Assert.notNull(keys, "Keys must not be null");
113+
Assert.noNullElements(keys, "Keys must not contain null elements");
114+
115+
return connection.invoke().just(Jedis::sintercard, PipelineBinaryCommands::sintercard, keys);
116+
}
117+
108118
@Override
109119
public Boolean sIsMember(byte @NonNull [] key, byte @NonNull [] value) {
110120

src/main/java/org/springframework/data/redis/connection/lettuce/LettuceSetCommands.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
/**
4040
* @author Christoph Strobl
4141
* @author Mark Paluch
42+
* @author Mingi Lee
4243
* @since 2.0
4344
*/
4445
@NullUnmarked
@@ -106,6 +107,15 @@ public Long sInterStore(byte @NonNull [] destKey, byte @NonNull [] @NonNull... k
106107
return connection.invoke().just(RedisSetAsyncCommands::sinterstore, destKey, keys);
107108
}
108109

110+
@Override
111+
public Long sInterCard(byte @NonNull [] @NonNull... keys) {
112+
113+
Assert.notNull(keys, "Keys must not be null");
114+
Assert.noNullElements(keys, "Keys must not contain null elements");
115+
116+
return connection.invoke().just(RedisSetAsyncCommands::sintercard, keys);
117+
}
118+
109119
@Override
110120
public Boolean sIsMember(byte @NonNull [] key, byte @NonNull [] value) {
111121

0 commit comments

Comments
 (0)