|
30 | 30 | * @author Christoph Strobl
|
31 | 31 | * @author Mark Paluch
|
32 | 32 | * @author Roman Bezpalko
|
| 33 | + * @author Mingi Lee |
33 | 34 | */
|
34 | 35 | @NullUnmarked
|
35 | 36 | public interface SetOperations<K, V> {
|
@@ -178,6 +179,38 @@ public interface SetOperations<K, V> {
|
178 | 179 | */
|
179 | 180 | Long intersectAndStore(@NonNull Collection<@NonNull K> keys, @NonNull K destKey);
|
180 | 181 |
|
| 182 | + /** |
| 183 | + * Returns the cardinality of the set which would result from the intersection of {@code key} and {@code otherKey}. |
| 184 | + * |
| 185 | + * @param key must not be {@literal null}. |
| 186 | + * @param otherKey must not be {@literal null}. |
| 187 | + * @return {@literal null} when used in pipeline / transaction. |
| 188 | + * @see <a href="https://redis.io/commands/sintercard">Redis Documentation: SINTERCARD</a> |
| 189 | + * @since 3.4 |
| 190 | + */ |
| 191 | + Long intersectSize(@NonNull K key, @NonNull K otherKey); |
| 192 | + |
| 193 | + /** |
| 194 | + * Returns the cardinality of the set which would result from the intersection of {@code key} and {@code otherKeys}. |
| 195 | + * |
| 196 | + * @param key must not be {@literal null}. |
| 197 | + * @param otherKeys must not be {@literal null}. |
| 198 | + * @return {@literal null} when used in pipeline / transaction. |
| 199 | + * @see <a href="https://redis.io/commands/sintercard">Redis Documentation: SINTERCARD</a> |
| 200 | + * @since 3.4 |
| 201 | + */ |
| 202 | + Long intersectSize(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys); |
| 203 | + |
| 204 | + /** |
| 205 | + * Returns the cardinality of the set which would result from the intersection of all given sets at {@code keys}. |
| 206 | + * |
| 207 | + * @param keys must not be {@literal null}. |
| 208 | + * @return {@literal null} when used in pipeline / transaction. |
| 209 | + * @see <a href="https://redis.io/commands/sintercard">Redis Documentation: SINTERCARD</a> |
| 210 | + * @since 3.4 |
| 211 | + */ |
| 212 | + Long intersectSize(@NonNull Collection<@NonNull K> keys); |
| 213 | + |
181 | 214 | /**
|
182 | 215 | * Union all sets at given {@code keys} and {@code otherKey}.
|
183 | 216 | *
|
|
0 commit comments