Package org.apache.felix.scr.impl.helper
Class ReadOnlyDictionary
- java.lang.Object
-
- java.util.Dictionary<String,Object>
-
- org.apache.felix.scr.impl.helper.ReadOnlyDictionary
-
- All Implemented Interfaces:
Comparable<ReadOnlyDictionary>,Map<String,Object>
public class ReadOnlyDictionary extends Dictionary<String,Object> implements Map<String,Object>, Comparable<ReadOnlyDictionary>
TheReadOnlyDictionaryis both aDictionaryand aMapwhose modification methods (likeDictionary.put(Object, Object),remove(Object), etc.) throw anUnsupportedOperationException.
-
-
Constructor Summary
Constructors Constructor Description ReadOnlyDictionary(Map<String,Object> delegate)Creates a wrapper for the given delegate dictionary providing read only access to the data.ReadOnlyDictionary(org.osgi.framework.ServiceReference<?> serviceReference)Creates a wrapper for the given service reference providing read only access to the reference properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()intcompareTo(ReadOnlyDictionary o)booleancontainsKey(Object key)booleancontainsValue(Object value)Enumeration<Object>elements()Set<Map.Entry<String,Object>>entrySet()Objectget(Object key)booleanisEmpty()Enumeration<String>keys()Set<String>keySet()Objectput(String key, Object value)This method has no effect and always returnsnullas this instance is read-only and cannot modify and properties.voidputAll(Map<? extends String,? extends Object> m)Objectremove(Object key)This method has no effect and always returnsnullas this instance is read-only and cannot modify and properties.intsize()StringtoString()Collection<Object>values()
-
-
-
Constructor Detail
-
ReadOnlyDictionary
public ReadOnlyDictionary(Map<String,Object> delegate)
Creates a wrapper for the given delegate dictionary providing read only access to the data.
-
ReadOnlyDictionary
public ReadOnlyDictionary(org.osgi.framework.ServiceReference<?> serviceReference)
Creates a wrapper for the given service reference providing read only access to the reference properties.
-
-
Method Detail
-
elements
public Enumeration<Object> elements()
- Specified by:
elementsin classDictionary<String,Object>
-
isEmpty
public boolean isEmpty()
-
keys
public Enumeration<String> keys()
- Specified by:
keysin classDictionary<String,Object>
-
put
public Object put(String key, Object value)
This method has no effect and always returnsnullas this instance is read-only and cannot modify and properties.
-
remove
public Object remove(Object key)
This method has no effect and always returnsnullas this instance is read-only and cannot modify and properties.
-
size
public int size()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<String,Object>
-
compareTo
public int compareTo(ReadOnlyDictionary o)
- Specified by:
compareToin interfaceComparable<ReadOnlyDictionary>
-
-