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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.osgi.framework.ServiceReference
<?> -
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 TypeMethodDescriptionvoid
clear()
int
boolean
containsKey
(Object key) boolean
containsValue
(Object value) elements()
entrySet()
boolean
isEmpty()
keys()
keySet()
This method has no effect and always returnsnull
as this instance is read-only and cannot modify and properties.void
This method has no effect and always returnsnull
as this instance is read-only and cannot modify and properties.int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, 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 Details
-
m_delegate
-
m_serviceReference
private final org.osgi.framework.ServiceReference<?> m_serviceReference
-
-
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:
elements
in classDictionary<String,
Object>
-
get
-
isEmpty
public boolean isEmpty() -
keys
- Specified by:
keys
in classDictionary<String,
Object>
-
put
This method has no effect and always returnsnull
as this instance is read-only and cannot modify and properties. -
remove
This method has no effect and always returnsnull
as this instance is read-only and cannot modify and properties. -
size
public int size() -
toString
-
clear
public void clear() -
containsKey
- Specified by:
containsKey
in interfaceMap<String,
Object>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
Object>
-
entrySet
-
keySet
-
putAll
-
values
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ReadOnlyDictionary>
-