org.springframework.datastore.redis.collection
Class RedisList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList
org.springframework.datastore.redis.collection.RedisList
- All Implemented Interfaces:
- Iterable, Collection, List, RedisCollection
public class RedisList
- extends AbstractList
- implements List, RedisCollection
Creates a list that is backed onto a Redis list
- Since:
- 1.0
Methods inherited from interface java.util.List |
addAll, addAll, clear, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, removeAll, retainAll, subList, toArray, toArray |
RedisList
public RedisList(RedisTemplate redisTemplate,
String redisKey)
get
public Object get(int index)
- Specified by:
get
in interface List
- Specified by:
get
in class AbstractList
set
public Object set(int index,
Object element)
- Specified by:
set
in interface List
- Overrides:
set
in class AbstractList
add
public void add(int index,
Object element)
- Specified by:
add
in interface List
- Overrides:
add
in class AbstractList
remove
public Object remove(int index)
- Specified by:
remove
in interface List
- Overrides:
remove
in class AbstractList
size
public int size()
- Specified by:
size
in interface Collection
- Specified by:
size
in interface List
- Specified by:
size
in class AbstractCollection
contains
public boolean contains(Object o)
- Specified by:
contains
in interface Collection
- Specified by:
contains
in interface List
- Overrides:
contains
in class AbstractCollection
iterator
public Iterator iterator()
- Specified by:
iterator
in interface Iterable
- Specified by:
iterator
in interface Collection
- Specified by:
iterator
in interface List
- Overrides:
iterator
in class AbstractList
add
public boolean add(Object e)
- Specified by:
add
in interface Collection
- Specified by:
add
in interface List
- Overrides:
add
in class AbstractList
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection
- Specified by:
remove
in interface List
- Overrides:
remove
in class AbstractCollection
getRedisKey
public String getRedisKey()
- Description copied from interface:
RedisCollection
- They key used by the collection
- Specified by:
getRedisKey
in interface RedisCollection
- Returns:
- The redis key
members
public Set<String> members()
- Specified by:
members
in interface RedisCollection
members
public List<String> members(int offset,
int max)
- Specified by:
members
in interface RedisCollection