public abstract class AbstractRedisCollection<E> extends AbstractCollection<E> implements RedisCollection<E>
RedisCollection. Provides a skeletal implementation. Note that the collection support
works only with normal, non-pipeline/multi-exec connections as it requires a reply to be sent right away.| Constructor and Description |
|---|
AbstractRedisCollection(String key,
RedisOperations<String,E> operations)
Constructs a new
AbstractRedisCollection instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAll(Collection<? extends E> c) |
protected void |
checkResult(Object obj) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object o) |
Boolean |
expire(long timeout,
TimeUnit unit)
Sets the key time-to-live/expiration.
|
Boolean |
expireAt(Date date)
Sets the key time-to-live/expiration.
|
Long |
getExpire()
Returns the expiration of this key.
|
String |
getKey()
Returns the key associated with this entity.
|
RedisOperations<String,E> |
getOperations()
Returns the underlying Redis operations used by the backing implementation.
|
int |
hashCode() |
Boolean |
persist()
Removes the expiration (if any) of the key.
|
boolean |
removeAll(Collection<?> c) |
void |
rename(String newKey)
Renames the key.
|
String |
toString() |
add, clear, contains, isEmpty, iterator, remove, retainAll, size, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitexpire, expireAt, getTypeparallelStream, removeIf, spliterator, streampublic static final String ENCODING
public AbstractRedisCollection(String key, RedisOperations<String,E> operations)
AbstractRedisCollection instance.key - Redis key of this collection.operations - RedisOperations for the value type of this collection.public String getKey()
BoundKeyOperationsgetKey in interface BoundKeyOperations<String>public RedisOperations<String,E> getOperations()
RedisStoregetOperations in interface RedisStorepublic boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in class AbstractCollection<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in class AbstractCollection<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in class AbstractCollection<E>public Boolean expire(long timeout, TimeUnit unit)
BoundKeyOperationsexpire in interface BoundKeyOperations<String>timeout - expiration valueunit - expiration unitpublic Boolean expireAt(Date date)
BoundKeyOperationsexpireAt in interface BoundKeyOperations<String>date - expiration datepublic Long getExpire()
BoundKeyOperationsgetExpire in interface BoundKeyOperations<String>public Boolean persist()
BoundKeyOperationspersist in interface BoundKeyOperations<String>public void rename(String newKey)
BoundKeyOperationsrename in interface BoundKeyOperations<String>newKey - new key. Must not be null.public boolean equals(Object o)
equals in interface Collection<E>equals in class Objectpublic int hashCode()
hashCode in interface Collection<E>hashCode in class Objectpublic String toString()
toString in class AbstractCollection<E>Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.