Package org.apache.felix.scr.impl.helper
Class ReadOnlyDictionary
- All Implemented Interfaces:
Comparable<ReadOnlyDictionary>,Map<String,Object>
public class ReadOnlyDictionary
extends Dictionary<String,Object>
implements Map<String,Object>, Comparable<ReadOnlyDictionary>
The
ReadOnlyDictionary is both a Dictionary and
a Map whose modification methods (like Dictionary.put(Object, Object),
remove(Object), etc.) throw an UnsupportedOperationException.-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyDictionary(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
Modifier and TypeMethodDescriptionvoidclear()intbooleancontainsKey(Object key) booleancontainsValue(Object value) elements()entrySet()booleanisEmpty()keys()keySet()This method has no effect and always returnsnullas this instance is read-only and cannot modify and properties.voidThis method has no effect and always returnsnullas this instance is read-only and cannot modify and properties.intsize()toString()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
ReadOnlyDictionary
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 Details
-
elements
- Specified by:
elementsin classDictionary<String,Object>
-
get
-
isEmpty
public boolean isEmpty() -
keys
- Specified by:
keysin classDictionary<String,Object>
-
put
This method has no effect and always returnsnullas this instance is read-only and cannot modify and properties. -
remove
This method has no effect and always returnsnullas this instance is read-only and cannot modify and properties. -
size
public int size() -
toString
-
clear
public void clear() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
entrySet
-
keySet
-
putAll
-
values
-
compareTo
- Specified by:
compareToin interfaceComparable<ReadOnlyDictionary>
-