Module spring.data.redis
Interface RedisSet<E>
- Type Parameters:
E- the type of elements in this collection.
- All Superinterfaces:
BoundKeyOperations<String>,Collection<E>,Iterable<E>,RedisCollection<E>,RedisStore,Set<E>
- All Known Implementing Classes:
DefaultRedisSet
- Author:
- Costin Leau, Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> RedisSet<E>create(String key, RedisOperations<String, E> operations) Constructs a newRedisSetinstance.diff(Collection<? extends RedisSet<?>> sets) Diff this set and otherRedisSets.Diff this set and anotherRedisSet.diffAndStore(Collection<? extends RedisSet<?>> sets, String destKey) diffAndStore(RedisSet<?> set, String destKey) intersect(Collection<? extends RedisSet<?>> sets) Intersect this set and otherRedisSets.Intersect this set and anotherRedisSet.intersectAndStore(Collection<? extends RedisSet<?>> sets, String destKey) intersectAndStore(RedisSet<?> set, String destKey) Get random element from the set.scan()union(Collection<? extends RedisSet<?>> sets) Union this set and otherRedisSets.Union this set and anotherRedisSet.unionAndStore(Collection<? extends RedisSet<?>> sets, String destKey) unionAndStore(RedisSet<?> set, String destKey) Methods inherited from interface org.springframework.data.redis.core.BoundKeyOperations
expire, expire, expireAt, expireAt, getExpire, getKey, getType, persist, renameMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface org.springframework.data.redis.support.collections.RedisStore
getOperations
-
Method Details
-
create
Constructs a newRedisSetinstance.- Parameters:
key- Redis key of this set.operations-RedisOperationsfor the value type of this set.- Since:
- 2.6
-
diff
Diff this set and anotherRedisSet.- Parameters:
set- must not be null.- Returns:
- a
Setcontaining the values that differ. - Since:
- 1.0
-
diff
Diff this set and otherRedisSets.- Parameters:
sets- must not be null.- Returns:
- a
Setcontaining the values that differ. - Since:
- 1.0
-
diffAndStore
Create a newRedisSetby diffing this sorted set andRedisSetand store result in destinationdestKey.- Parameters:
set- must not be null.destKey- must not be null.- Returns:
- a new
RedisSetpointing atdestKey. - Since:
- 1.0
-
diffAndStore
Create a newRedisSetby diffing this sorted set and the collectionRedisSetand store result in destinationdestKey.- Parameters:
sets- must not be null.destKey- must not be null.- Returns:
- a new
RedisSetpointing atdestKey. - Since:
- 1.0
-
intersect
Intersect this set and anotherRedisSet.- Parameters:
set- must not be null.- Returns:
- a
Setcontaining the intersecting values. - Since:
- 1.0
-
intersect
Intersect this set and otherRedisSets.- Parameters:
sets- must not be null.- Returns:
- a
Setcontaining the intersecting values. - Since:
- 1.0
-
intersectAndStore
Create a newRedisSetby intersecting this sorted set andRedisSetand store result in destinationdestKey.- Parameters:
set- must not be null.destKey- must not be null.- Returns:
- a new
RedisSetpointing atdestKey - Since:
- 1.0
-
intersectAndStore
Create a newRedisSetby intersecting this sorted set and the collectionRedisSetand store result in destinationdestKey.- Parameters:
sets- must not be null.destKey- must not be null.- Returns:
- a new
RedisSetpointing atdestKey. - Since:
- 1.0
-
randomValue
E randomValue()Get random element from the set.- Returns:
- Since:
- 2.6
-
scan
- Returns:
- Since:
- 1.4
-
union
Union this set and anotherRedisSet.- Parameters:
set- must not be null.- Returns:
- a
Setcontaining the combined values. - Since:
- 2.6
-
union
Union this set and otherRedisSets.- Parameters:
sets- must not be null.- Returns:
- a
Setcontaining the combined values. - Since:
- 1.0
-
unionAndStore
Create a newRedisSetby union this sorted set andRedisSetand store result in destinationdestKey.- Parameters:
set- must not be null.destKey- must not be null.- Returns:
- a new
RedisSetpointing atdestKey. - Since:
- 1.0
-
unionAndStore
Create a newRedisSetby union this sorted set and the collectionRedisSetand store result in destinationdestKey.- Parameters:
sets- must not be null.destKey- must not be null.- Returns:
- a new
RedisSetpointing atdestKey. - Since:
- 1.0
-