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>
TheReadOnlyDictionary
is both aDictionary
and aMap
whose 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 void
clear()
int
compareTo(ReadOnlyDictionary o)
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Enumeration<Object>
elements()
Set<Map.Entry<String,Object>>
entrySet()
Object
get(Object key)
boolean
isEmpty()
Enumeration<String>
keys()
Set<String>
keySet()
Object
put(String key, Object value)
This method has no effect and always returnsnull
as this instance is read-only and cannot modify and properties.void
putAll(Map<? extends String,? extends Object> m)
Object
remove(Object key)
This method has no effect and always returnsnull
as this instance is read-only and cannot modify and properties.int
size()
String
toString()
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:
elements
in classDictionary<String,Object>
-
isEmpty
public boolean isEmpty()
-
keys
public Enumeration<String> keys()
- Specified by:
keys
in classDictionary<String,Object>
-
put
public Object put(String key, Object value)
This method has no effect and always returnsnull
as this instance is read-only and cannot modify and properties.
-
remove
public Object remove(Object key)
This method has no effect and always returnsnull
as this instance is read-only and cannot modify and properties.
-
size
public int size()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<String,Object>
-
compareTo
public int compareTo(ReadOnlyDictionary o)
- Specified by:
compareTo
in interfaceComparable<ReadOnlyDictionary>
-
-