Package org.eclipse.osgi.framework.util
Class Headers<K,V>
java.lang.Object
java.util.Dictionary<K,V>
org.eclipse.osgi.framework.util.Headers<K,V>
- All Implemented Interfaces:
Map<K,
V>
Deprecated.
Headers classes. This class implements a Dictionary that has the following
behavior:
- put and remove clear throw UnsupportedOperationException. The Dictionary is thus read-only to others.
- The String keys in the Dictionary are case-preserved, but the get operation is case-insensitive.
- Since:
- 3.1
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionHeaders
(int initialCapacity) Deprecated.Create an empty Headers dictionary.Headers
(Dictionary<? extends K, ? extends V> values) Deprecated.Create a Headers dictionary from a Dictionary. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Deprecated.boolean
containsKey
(Object key) Deprecated.boolean
containsValue
(Object value) Deprecated.elements()
Deprecated.Values.entrySet()
Deprecated.Deprecated.Support case-insensitivity for keys.boolean
isEmpty()
Deprecated.Tests if this dictionary maps no keys to value.keys()
Deprecated.Case-preserved keys.keySet()
Deprecated.Deprecated.Deprecated.Always throws UnsupportedOperationException.void
Deprecated.Deprecated.Always throws UnsupportedOperationException.Deprecated.Set a header value.Deprecated.Set a header value or optionally replace it if it already exists.void
Deprecated.int
size()
Deprecated.Returns the number of entries (distinct keys) in this dictionary.toString()
Deprecated.values()
Deprecated.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
-
Constructor Details
-
Headers
public Headers(int initialCapacity) Deprecated.Create an empty Headers dictionary.- Parameters:
initialCapacity
- The initial capacity of this Headers object.
-
Headers
Deprecated.Create a Headers dictionary from a Dictionary.- Parameters:
values
- The initial dictionary for this Headers object.- Throws:
IllegalArgumentException
- If a case-variant of the key is in the dictionary parameter.
-
-
Method Details
-
keys
Deprecated.Case-preserved keys.- Specified by:
keys
in classDictionary<K,
V>
-
elements
Deprecated.Values.- Specified by:
elements
in classDictionary<K,
V>
-
get
Deprecated.Support case-insensitivity for keys. -
set
Deprecated.Set a header value or optionally replace it if it already exists.- Parameters:
key
- Key name.value
- Value of the key or null to remove key.replace
- A value of true will allow a previous value of the key to be replaced. A value of false will cause an IllegalArgumentException to be thrown if a previous value of the key exists.- Returns:
- the previous value to which the key was mapped, or null if the key did not have a previous mapping.
- Throws:
IllegalArgumentException
- If a case-variant of the key is already present.- Since:
- 3.2
-
set
Deprecated.Set a header value.- Parameters:
key
- Key name.value
- Value of the key or null to remove key.- Returns:
- the previous value to which the key was mapped, or null if the key did not have a previous mapping.
- Throws:
IllegalArgumentException
- If a case-variant of the key is already present.
-
setReadOnly
public void setReadOnly()Deprecated. -
size
public int size()Deprecated.Returns the number of entries (distinct keys) in this dictionary. -
isEmpty
public boolean isEmpty()Deprecated.Tests if this dictionary maps no keys to value. The general contract for theisEmpty
method is that the result is true if and only if this dictionary contains no entries. -
put
Deprecated.Always throws UnsupportedOperationException. -
remove
Deprecated.Always throws UnsupportedOperationException. -
toString
Deprecated. -
parseManifest
Deprecated.- Throws:
BundleException
-
clear
public void clear()Deprecated. -
containsKey
Deprecated.- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
Deprecated.- Specified by:
containsValue
in interfaceMap<K,
V>
-
entrySet
Deprecated. -
keySet
Deprecated. -
putAll
Deprecated. -
values
Deprecated.
-
CaseInsensitiveDictionaryMap
.