public class RedisProperties extends Properties implements RedisMap<Object,Object>
Properties extension for a Redis back-store. Useful for reading (and storing) properties inside a Redis hash.
Particularly useful inside a Spring container for hooking into Spring's property placeholder or
PropertiesFactoryBean.
Note that this implementation only accepts Strings - objects of other type are not supported.Properties,
PropertiesLoaderSupport,
Serialized Formdefaults| Constructor and Description |
|---|
RedisProperties(BoundHashOperations<String,String,String> boundOps)
Constructs a new
RedisProperties instance. |
RedisProperties(Properties defaults,
BoundHashOperations<String,String,String> boundOps)
Constructs a new
RedisProperties instance. |
RedisProperties(Properties defaults,
String key,
RedisOperations<String,?> operations)
Constructs a new
RedisProperties instance. |
RedisProperties(String key,
RedisOperations<String,?> operations)
Constructs a new
RedisProperties instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
Object |
clone() |
boolean |
contains(Object value) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Enumeration<Object> |
elements() |
Set<Map.Entry<Object,Object>> |
entrySet() |
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.
|
Object |
get(Object key) |
Long |
getExpire()
Returns the expiration of this key.
|
String |
getKey()
Returns the key associated with this entity.
|
RedisOperations<String,?> |
getOperations()
Returns the underlying Redis operations used by the backing implementation.
|
DataType |
getType()
Returns the associated Redis type.
|
int |
hashCode() |
Double |
increment(Object key,
double delta) |
Long |
increment(Object key,
long delta) |
boolean |
isEmpty() |
Enumeration<Object> |
keys() |
Set<Object> |
keySet() |
Boolean |
persist()
Removes the expiration (if any) of the key.
|
Enumeration<?> |
propertyNames() |
Object |
put(Object key,
Object value) |
void |
putAll(Map<? extends Object,? extends Object> t) |
Object |
putIfAbsent(Object key,
Object value) |
Object |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
void |
rename(String newKey)
Renames the key.
|
Object |
replace(Object key,
Object value) |
boolean |
replace(Object key,
Object oldValue,
Object newValue) |
Iterator<Map.Entry<Object,Object>> |
scan() |
int |
size() |
void |
storeToXML(OutputStream os,
String comment) |
void |
storeToXML(OutputStream os,
String comment,
String encoding) |
Collection<Object> |
values() |
getProperty, getProperty, list, list, load, load, loadFromXML, save, setProperty, store, store, stringPropertyNamescompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, rehash, replaceAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitexpire, expireAtcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAllpublic RedisProperties(BoundHashOperations<String,String,String> boundOps)
RedisProperties instance.public RedisProperties(String key, RedisOperations<String,?> operations)
RedisProperties instance.key - Redis key of this property map.operations - RedisOperations for this properties.RedisOperations.getHashKeySerializer(),
RedisOperations.getHashValueSerializer()public RedisProperties(@Nullable Properties defaults, BoundHashOperations<String,String,String> boundOps)
RedisProperties instance.defaults - default properties to apply, can be null.boundOps - BoundHashOperations for this properties.public RedisProperties(Properties defaults, String key, RedisOperations<String,?> operations)
RedisProperties instance.defaults - default properties to apply, can be null.key - Redis key of this property map.operations - RedisOperations for this properties.RedisOperations.getHashKeySerializer(),
RedisOperations.getHashValueSerializer()public Enumeration<?> propertyNames()
propertyNames in class Propertiespublic void clear()
public boolean contains(Object value)
public boolean containsKey(Object key)
containsKey in interface Map<Object,Object>containsKey in class Hashtable<Object,Object>public boolean containsValue(Object value)
containsValue in interface Map<Object,Object>containsValue in class Hashtable<Object,Object>public Enumeration<Object> elements()
public boolean equals(Object o)
public int hashCode()
public boolean isEmpty()
public int size()
public Collection<Object> values()
public RedisOperations<String,?> getOperations()
RedisStoregetOperations in interface RedisStorepublic 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 String getKey()
BoundKeyOperationsgetKey in interface BoundKeyOperations<String>public DataType getType()
BoundKeyOperationsgetType 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 Object putIfAbsent(Object key, Object value)
putIfAbsent in interface ConcurrentMap<Object,Object>putIfAbsent in interface Map<Object,Object>putIfAbsent in class Hashtable<Object,Object>public void storeToXML(OutputStream os, String comment, String encoding) throws IOException
storeToXML in class PropertiesIOExceptionpublic void storeToXML(OutputStream os, String comment) throws IOException
storeToXML in class PropertiesIOExceptionCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.