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
ConstructorsConstructorDescriptionHeaders(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 TypeMethodDescriptionvoidclear()Deprecated.booleancontainsKey(Object key) Deprecated.booleancontainsValue(Object value) Deprecated.elements()Deprecated.Values.entrySet()Deprecated.Deprecated.Support case-insensitivity for keys.booleanisEmpty()Deprecated.Tests if this dictionary maps no keys to value.keys()Deprecated.Case-preserved keys.keySet()Deprecated.Deprecated.Deprecated.Always throws UnsupportedOperationException.voidDeprecated.Deprecated.Always throws UnsupportedOperationException.Deprecated.Set a header value.Deprecated.Set a header value or optionally replace it if it already exists.voidDeprecated.intsize()Deprecated.Returns the number of entries (distinct keys) in this dictionary.toString()Deprecated.values()Deprecated.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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
-
elements
-
get
-
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
-
isEmpty
public boolean isEmpty()Deprecated.Tests if this dictionary maps no keys to value. The general contract for theisEmptymethod is that the result is true if and only if this dictionary contains no entries. -
put
-
remove
-
toString
-
parseManifest
Deprecated.- Throws:
BundleException
-
clear
-
containsKey
-
containsValue
Deprecated.- Specified by:
containsValuein interfaceMap<K,V>
-
entrySet
-
keySet
-
putAll
-
values
-
CaseInsensitiveDictionaryMap.