public class ReadOnlyDictionary extends Dictionary<String,Object> implements Map<String,Object>, Comparable<ReadOnlyDictionary>
ReadOnlyDictionary
is both a Dictionary
and
a Map
whose modification methods (like Dictionary.put(Object, Object)
,
remove(Object)
, etc.) throw an UnsupportedOperationException
.Constructor and 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.
|
Modifier and Type | Method and 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 returns
null 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 returns
null as this
instance is read-only and cannot modify and properties. |
int |
size() |
String |
toString() |
Collection<Object> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public ReadOnlyDictionary(Map<String,Object> delegate)
public ReadOnlyDictionary(org.osgi.framework.ServiceReference<?> serviceReference)
public Enumeration<Object> elements()
elements
in class Dictionary<String,Object>
public boolean isEmpty()
public Enumeration<String> keys()
keys
in class Dictionary<String,Object>
public Object put(String key, Object value)
null
as this
instance is read-only and cannot modify and properties.public Object remove(Object key)
null
as this
instance is read-only and cannot modify and properties.public int size()
public boolean containsKey(Object key)
containsKey
in interface Map<String,Object>
public boolean containsValue(Object value)
containsValue
in interface Map<String,Object>
public int compareTo(ReadOnlyDictionary o)
compareTo
in interface Comparable<ReadOnlyDictionary>
Copyright © 2006–2020 The Apache Software Foundation. All rights reserved.