Package org.jivesoftware.openfire.group
Class DefaultGroupPropertyMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- org.jivesoftware.util.PersistableMap<K,V>
-
- org.jivesoftware.openfire.group.DefaultGroupPropertyMap<K,V>
-
- Type Parameters:
K
- Property keyV
- Property value
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<K,V>
public class DefaultGroupPropertyMap<K,V> extends PersistableMap<K,V>
Default implementation of a writableMap
to manage group properties. Updates made to the elements in this map will also be applied to the database. Note this implementation assumes group property changes will be relatively infrequent and therefore does not try to optimize database I/O for performance. Each call to aMap
mutator method (direct or indirect viaIterator
) will result in a corresponding synchronous update to the database.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description DefaultGroupPropertyMap(Group group)
Group properties map constructor; requires an associatedGroup
instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Set<Map.Entry<K,V>>
entrySet()
Set<K>
keySet()
Be aware that removing a property through the iterator of the returned key set might cause unexpected behavior, as not all event handlers will be notified with all data required for cache updates to be processed.V
put(K key, V value)
V
put(K key, V value, boolean persist)
Custom method to put properties into the map, optionally without triggering persistence.V
remove(Object key)
Collection<V>
values()
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, get, getOrDefault, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Method Detail
-
put
public V put(K key, V value, boolean persist)
Custom method to put properties into the map, optionally without triggering persistence. This is used when the map is being initially loaded from the database.- Specified by:
put
in classPersistableMap<K,V>
- Parameters:
key
- The property namevalue
- The property valuepersist
- True if the changes should be persisted to the database- Returns:
- The original value or null if the property did not exist
-
clear
public void clear()
-
keySet
public Set<K> keySet()
Be aware that removing a property through the iterator of the returned key set might cause unexpected behavior, as not all event handlers will be notified with all data required for cache updates to be processed.
-
values
public Collection<V> values()
-
-