Package org.alfresco.service.namespace
Class QNameMap<K,V>
- java.lang.Object
-
- org.alfresco.service.namespace.QNameMap<K,V>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map
public class QNameMap<K,V> extends Object implements Map, Cloneable, Serializable
A Map that holds as it's key a QName stored in it's internal String representation. Calls to get and put automatically map the key to and from the QName representation.- Author:
- gavinc
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
QNameMap()
Constructor for Serialization mechanismQNameMap(NamespacePrefixResolverProvider provider)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Object
clone()
Shallow copy the map by copying keys and values into a new QNameMapboolean
containsKey(Object key)
boolean
containsValue(Object value)
Set
entrySet()
Object
get(Object key)
Map<QName,V>
getMapOfQNames()
protected NamespacePrefixResolver
getResolver()
Helper to return a NamespacePrefixResolver instance - should -always- be used rather than holding onto a reference on the heap.boolean
isEmpty()
Set<String>
keySet()
Object
put(Object key, Object value)
void
putAll(Map t)
Object
remove(Object key)
int
size()
String
toString()
Override Object.toString() to provide useful debug outputCollection
values()
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
logger
protected static org.apache.commons.logging.Log logger
-
provider
protected NamespacePrefixResolverProvider provider
-
-
Constructor Detail
-
QNameMap
public QNameMap(NamespacePrefixResolverProvider provider)
Constructor- Parameters:
provider
- Mandatory NamespacePrefixResolverProvider helper
-
QNameMap
protected QNameMap()
Constructor for Serialization mechanism
-
-
Method Detail
-
getResolver
protected final NamespacePrefixResolver getResolver()
Helper to return a NamespacePrefixResolver instance - should -always- be used rather than holding onto a reference on the heap.- Returns:
- NamespacePrefixResolver
-
size
public final int size()
- Specified by:
size
in interfaceMap<K,V>
- See Also:
Map.size()
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceMap<K,V>
- See Also:
Map.isEmpty()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<K,V>
- See Also:
Map.containsKey(java.lang.Object)
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<K,V>
- See Also:
Map.containsValue(java.lang.Object)
-
get
public Object get(Object key)
- Specified by:
get
in interfaceMap<K,V>
- See Also:
Map.get(java.lang.Object)
-
put
public Object put(Object key, Object value)
- Specified by:
put
in interfaceMap<K,V>
- See Also:
Map.put(Object, Object)
-
remove
public Object remove(Object key)
- Specified by:
remove
in interfaceMap<K,V>
- See Also:
Map.remove(java.lang.Object)
-
putAll
public void putAll(Map t)
- Specified by:
putAll
in interfaceMap<K,V>
- See Also:
Map.putAll(java.util.Map)
-
clear
public void clear()
- Specified by:
clear
in interfaceMap<K,V>
- See Also:
Map.clear()
-
keySet
public Set<String> keySet()
- Specified by:
keySet
in interfaceMap<K,V>
- See Also:
Map.keySet()
-
values
public Collection values()
- Specified by:
values
in interfaceMap<K,V>
- See Also:
Map.values()
-
entrySet
public Set entrySet()
- Specified by:
entrySet
in interfaceMap<K,V>
- See Also:
Map.entrySet()
-
toString
public String toString()
Override Object.toString() to provide useful debug output
-
clone
public Object clone()
Shallow copy the map by copying keys and values into a new QNameMap
-
-