org.springframework.data.redis.support.collections
Class DefaultRedisSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by org.springframework.data.redis.support.collections.AbstractRedisCollection<E>
          extended by org.springframework.data.redis.support.collections.DefaultRedisSet<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, BoundKeyOperations<String>, RedisCollection<E>, RedisSet<E>, RedisStore

public class DefaultRedisSet<E>
extends AbstractRedisCollection<E>
implements RedisSet<E>

Default implementation for RedisSet.


Field Summary
 
Fields inherited from class org.springframework.data.redis.support.collections.AbstractRedisCollection
ENCODING
 
Constructor Summary
DefaultRedisSet(BoundSetOperations<String,E> boundOps)
          Constructs a new DefaultRedisSet instance.
DefaultRedisSet(String key, RedisOperations<String,E> operations)
          Constructs a new DefaultRedisSet instance.
 
Method Summary
 boolean add(E e)
           
 void clear()
           
 boolean contains(Object o)
           
 Set<E> diff(Collection<? extends RedisSet<?>> sets)
           
 Set<E> diff(RedisSet<?> set)
           
 RedisSet<E> diffAndStore(Collection<? extends RedisSet<?>> sets, String destKey)
           
 RedisSet<E> diffAndStore(RedisSet<?> set, String destKey)
           
 DataType getType()
          Returns the associated Redis type.
 Set<E> intersect(Collection<? extends RedisSet<?>> sets)
           
 Set<E> intersect(RedisSet<?> set)
           
 RedisSet<E> intersectAndStore(Collection<? extends RedisSet<?>> sets, String destKey)
           
 RedisSet<E> intersectAndStore(RedisSet<?> set, String destKey)
           
 Iterator<E> iterator()
           
 boolean remove(Object o)
           
 int size()
           
 Set<E> union(Collection<? extends RedisSet<?>> sets)
           
 Set<E> union(RedisSet<?> set)
           
 RedisSet<E> unionAndStore(Collection<? extends RedisSet<?>> sets, String destKey)
           
 RedisSet<E> unionAndStore(RedisSet<?> set, String destKey)
           
 
Methods inherited from class org.springframework.data.redis.support.collections.AbstractRedisCollection
addAll, containsAll, equals, expire, expireAt, getExpire, getKey, getOperations, hashCode, persist, removeAll, rename, retainAll, toString
 
Methods inherited from class java.util.AbstractCollection
isEmpty, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.data.redis.support.collections.RedisStore
getOperations
 
Methods inherited from interface org.springframework.data.redis.core.BoundKeyOperations
expire, expireAt, getExpire, getKey, persist, rename
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

DefaultRedisSet

public DefaultRedisSet(String key,
                       RedisOperations<String,E> operations)
Constructs a new DefaultRedisSet instance.

Parameters:
key -
operations -

DefaultRedisSet

public DefaultRedisSet(BoundSetOperations<String,E> boundOps)
Constructs a new DefaultRedisSet instance.

Parameters:
boundOps -
Method Detail

diff

public Set<E> diff(RedisSet<?> set)
Specified by:
diff in interface RedisSet<E>

diff

public Set<E> diff(Collection<? extends RedisSet<?>> sets)
Specified by:
diff in interface RedisSet<E>

diffAndStore

public RedisSet<E> diffAndStore(RedisSet<?> set,
                                String destKey)
Specified by:
diffAndStore in interface RedisSet<E>

diffAndStore

public RedisSet<E> diffAndStore(Collection<? extends RedisSet<?>> sets,
                                String destKey)
Specified by:
diffAndStore in interface RedisSet<E>

intersect

public Set<E> intersect(RedisSet<?> set)
Specified by:
intersect in interface RedisSet<E>

intersect

public Set<E> intersect(Collection<? extends RedisSet<?>> sets)
Specified by:
intersect in interface RedisSet<E>

intersectAndStore

public RedisSet<E> intersectAndStore(RedisSet<?> set,
                                     String destKey)
Specified by:
intersectAndStore in interface RedisSet<E>

intersectAndStore

public RedisSet<E> intersectAndStore(Collection<? extends RedisSet<?>> sets,
                                     String destKey)
Specified by:
intersectAndStore in interface RedisSet<E>

union

public Set<E> union(RedisSet<?> set)
Specified by:
union in interface RedisSet<E>

union

public Set<E> union(Collection<? extends RedisSet<?>> sets)
Specified by:
union in interface RedisSet<E>

unionAndStore

public RedisSet<E> unionAndStore(RedisSet<?> set,
                                 String destKey)
Specified by:
unionAndStore in interface RedisSet<E>

unionAndStore

public RedisSet<E> unionAndStore(Collection<? extends RedisSet<?>> sets,
                                 String destKey)
Specified by:
unionAndStore in interface RedisSet<E>

add

public boolean add(E e)
Specified by:
add in interface Collection<E>
Specified by:
add in interface Set<E>
Specified by:
add in class AbstractRedisCollection<E>

clear

public void clear()
Specified by:
clear in interface Collection<E>
Specified by:
clear in interface Set<E>
Specified by:
clear in class AbstractRedisCollection<E>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<E>
Specified by:
contains in interface Set<E>
Overrides:
contains in class AbstractCollection<E>

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface Set<E>
Specified by:
iterator in class AbstractCollection<E>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<E>
Specified by:
remove in interface Set<E>
Specified by:
remove in class AbstractRedisCollection<E>

size

public int size()
Specified by:
size in interface Collection<E>
Specified by:
size in interface Set<E>
Specified by:
size in class AbstractCollection<E>

getType

public DataType getType()
Description copied from interface: BoundKeyOperations
Returns the associated Redis type.

Specified by:
getType in interface BoundKeyOperations<String>
Returns:
key type