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, stringPropertyNames
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, rehash, replaceAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
public RedisProperties(BoundHashOperations<String,String,String> boundOps)
RedisProperties
instance.public RedisProperties(String key, RedisOperations<String,?> operations)
RedisProperties
instance.key
- operations
- public RedisProperties(Properties defaults, BoundHashOperations<String,String,String> boundOps)
RedisProperties
instance.defaults
- boundOps
- public RedisProperties(Properties defaults, String key, RedisOperations<String,?> operations)
RedisProperties
instance.defaults
- key
- operations
- public Enumeration<?> propertyNames()
propertyNames
in class Properties
public 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()
RedisStore
getOperations
in interface RedisStore
public Boolean expire(long timeout, TimeUnit unit)
BoundKeyOperations
expire
in interface BoundKeyOperations<String>
timeout
- expiration valueunit
- expiration unitpublic Boolean expireAt(Date date)
BoundKeyOperations
expireAt
in interface BoundKeyOperations<String>
date
- expiration datepublic Long getExpire()
BoundKeyOperations
getExpire
in interface BoundKeyOperations<String>
public String getKey()
BoundKeyOperations
getKey
in interface BoundKeyOperations<String>
public DataType getType()
BoundKeyOperations
getType
in interface BoundKeyOperations<String>
public Boolean persist()
BoundKeyOperations
persist
in interface BoundKeyOperations<String>
public void rename(String newKey)
BoundKeyOperations
rename
in interface BoundKeyOperations<String>
newKey
- new keypublic 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 Properties
IOException
public void storeToXML(OutputStream os, String comment) throws IOException
storeToXML
in class Properties
IOException
Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.