Top Inners Fields Constructors Methods
io.undertow.server

pack-priv final Class MapDelegatingToSet

extends HashMap<String, Cookie>
Class Inheritance
Static Imports
java.util.Collections.emptySet, .Collections.unmodifiableCollection, .Collections.unmodifiableSet

Author
Richard Opalka

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Set<Cookie>

Constructor Summary

AccessConstructor and Description
pack-priv
MapDelegatingToSet(final Set<Cookie> delegate)

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides java.util.HashMap.clear.

Implements java.util.Map.clear.

Removes all of the mappings from this map.

public Cookie
compute(String
key with which the specified value is to be associated
key
,
BiFunction<? super String, ? super Cookie, ? extends Cookie>
the remapping function to compute a value
remappingFunction
)

Overrides java.util.HashMap.compute.

Overrides default java.util.Map.compute.

Attempts to compute a mapping for the specified key and its current mapped value, or null if there is no current mapping (optional operation).

public Cookie
computeIfAbsent(final String
key with which the specified value is to be associated
key
,
final Function<? super String, ? extends Cookie>
the mapping function to compute a value
mappingFunction
)

Overrides java.util.HashMap.computeIfAbsent.

Overrides default java.util.Map.computeIfAbsent.

If the specified key is not already associated with a value (or is mapped to null), attempts to compute its value using the given mapping function and enters it into this map unless null (optional operation).

public Cookie
computeIfPresent(String
key with which the specified value is to be associated
key
,
BiFunction<? super String, ? super Cookie, ? extends Cookie>
the remapping function to compute a value
remappingFunction
)

Overrides java.util.HashMap.computeIfPresent.

Overrides default java.util.Map.computeIfPresent.

If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value (optional operation).

public boolean
containsKey(final Object
The key whose presence in this map is to be tested
key
)

Overrides java.util.HashMap.containsKey.

Implements java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

public boolean
containsValue(final Object
value whose presence in this map is to be tested
value
)

Overrides java.util.HashMap.containsValue.

Implements java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value.

public Set<Map.Entry<String, Cookie>>
entrySet()

Overrides java.util.HashMap.entrySet.

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public void
forEach(BiConsumer<? super String, ? super Cookie>
The action to be performed for each entry
action
)

Overrides java.util.HashMap.forEach.

Overrides default java.util.Map.forEach.

Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.

public Cookie
get(final Object
the key whose associated value is to be returned
key
)

Overrides java.util.HashMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

public Cookie
getOrDefault(final Object
the key whose associated value is to be returned
key
,
final Cookie
the default mapping of the key
defaultValue
)

Overrides java.util.HashMap.getOrDefault.

Overrides default java.util.Map.getOrDefault.

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.

public boolean
isEmpty()

Overrides java.util.HashMap.isEmpty.

Implements java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.

public Set<String>
keySet()

Overrides java.util.HashMap.keySet.

Implements java.util.Map.keySet.

Returns a Set view of the keys contained in this map.

public Cookie
merge(String
key with which the resulting value is to be associated
key
,
Cookie
the non-null value to be merged with the existing value associated with the key or, if no existing value or a null value is associated with the key, to be associated with the key
value
,
BiFunction<? super Cookie, ? super Cookie, ? extends Cookie>
the remapping function to recompute a value if present
remappingFunction
)

Overrides java.util.HashMap.merge.

Overrides default java.util.Map.merge.

If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value (optional operation).

public Cookie
put(final String
key with which the specified value is to be associated
key
,
final Cookie
value to be associated with the specified key
value
)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map.

public void
putAll(final Map<? extends String, ? extends Cookie>
mappings to be stored in this map
m
)

Overrides java.util.HashMap.putAll.

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this map.

public Cookie
putIfAbsent(final String
key with which the specified value is to be associated
key
,
final Cookie
value to be associated with the specified key
value
)

Overrides java.util.HashMap.putIfAbsent.

Overrides default java.util.Map.putIfAbsent.

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value (optional operation).

public Cookie
remove(final Object
key whose mapping is to be removed from the map
key
)

Overrides java.util.HashMap.remove.

Implements java.util.Map.remove.

Removes the mapping for the specified key from this map if present.

public boolean
remove(final Object
key with which the specified value is associated
key
,
final Object
value expected to be associated with the specified key
value
)

Overrides java.util.HashMap.remove.

Overrides default java.util.Map.remove.

Removes the entry for the specified key only if it is currently mapped to the specified value (optional operation).

public boolean
replace(final String
key with which the specified value is associated
key
,
final Cookie
value expected to be associated with the specified key
oldValue
,
final Cookie
value to be associated with the specified key
newValue
)

Overrides java.util.HashMap.replace.

Overrides default java.util.Map.replace.

Replaces the entry for the specified key only if currently mapped to the specified value (optional operation).

public Cookie
replace(final String
key with which the specified value is associated
key
,
final Cookie
value to be associated with the specified key
value
)

Overrides java.util.HashMap.replace.

Overrides default java.util.Map.replace.

Replaces the entry for the specified key only if it is currently mapped to some value (optional operation).

public void
replaceAll(BiFunction<? super String, ? super Cookie, ? extends Cookie>
the function to apply to each entry
function
)

Overrides java.util.HashMap.replaceAll.

Overrides default java.util.Map.replaceAll.

Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception (optional operation).

public int
size()

Overrides java.util.HashMap.size.

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.

public Collection<Cookie>
values()

Overrides java.util.HashMap.values.

Implements java.util.Map.values.

Returns a Collection view of the values contained in this map.

Inherited from java.util.HashMap:
clonenewHashMap

Field Detail

delegateback to summary
private final Set<Cookie> delegate

Constructor Detail

MapDelegatingToSetback to summary
pack-priv MapDelegatingToSet(final Set<Cookie> delegate)

Method Detail

clearback to summary
public void clear()

Overrides java.util.HashMap.clear.

Implements java.util.Map.clear.

Doc from java.util.HashMap.clear.

Removes all of the mappings from this map. The map will be empty after this call returns.

Annotations
@Override
computeback to summary
public Cookie compute(String key, BiFunction<? super String, ? super Cookie, ? extends Cookie> remappingFunction)

Overrides java.util.HashMap.compute.

Overrides default java.util.Map.compute.

Doc from java.util.HashMap.compute.

Attempts to compute a mapping for the specified key and its current mapped value, or null if there is no current mapping (optional operation). For example, to either create or append a String msg to a value mapping:

 map.compute(key, (k, v) -> (v == null) ? msg : v.concat(msg))
(Method merge() is often simpler to use for such purposes.)

If the remapping function returns null, the mapping is removed (or remains absent if initially absent). If the remapping function itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged.

The remapping function should not modify this map during computation.

This method will, on a best-effort basis, throw a ConcurrentModificationException if it is detected that the remapping function modifies this map during computation.

Parameters
key:String

Doc from java.util.Map.compute.

key with which the specified value is to be associated

remappingFunction:BiFunction<? super String, ? super Cookie, ? extends Cookie>

Doc from java.util.Map.compute.

the remapping function to compute a value

Returns:Cookie

Doc from java.util.Map.compute.

the new value associated with the specified key, or null if none

Annotations
@Override
computeIfAbsentback to summary
public Cookie computeIfAbsent(final String key, final Function<? super String, ? extends Cookie> mappingFunction)

Overrides java.util.HashMap.computeIfAbsent.

Overrides default java.util.Map.computeIfAbsent.

Doc from java.util.HashMap.computeIfAbsent.

If the specified key is not already associated with a value (or is mapped to null), attempts to compute its value using the given mapping function and enters it into this map unless null (optional operation).

If the mapping function returns null, no mapping is recorded. If the mapping function itself throws an (unchecked) exception, the exception is rethrown, and no mapping is recorded. The most common usage is to construct a new object serving as an initial mapped value or memoized result, as in:

 map.computeIfAbsent(key, k -> new Value(f(k)));

Or to implement a multi-value map, Map<K,Collection<V>>, supporting multiple values per key:

 map.computeIfAbsent(key, k -> new HashSet<V>()).add(v);

The mapping function should not modify this map during computation.

This method will, on a best-effort basis, throw a ConcurrentModificationException if it is detected that the mapping function modifies this map during computation.

Parameters
key:String

Doc from java.util.Map.computeIfAbsent.

key with which the specified value is to be associated

mappingFunction:Function<? super String, ? extends Cookie>

Doc from java.util.Map.computeIfAbsent.

the mapping function to compute a value

Returns:Cookie

Doc from java.util.Map.computeIfAbsent.

the current (existing or computed) value associated with the specified key, or null if the computed value is null

Annotations
@Override
computeIfPresentback to summary
public Cookie computeIfPresent(String key, BiFunction<? super String, ? super Cookie, ? extends Cookie> remappingFunction)

Overrides java.util.HashMap.computeIfPresent.

Overrides default java.util.Map.computeIfPresent.

Doc from java.util.HashMap.computeIfPresent.

If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value (optional operation).

If the remapping function returns null, the mapping is removed. If the remapping function itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged.

The remapping function should not modify this map during computation.

This method will, on a best-effort basis, throw a ConcurrentModificationException if it is detected that the remapping function modifies this map during computation.

Parameters
key:String

Doc from java.util.Map.computeIfPresent.

key with which the specified value is to be associated

remappingFunction:BiFunction<? super String, ? super Cookie, ? extends Cookie>

Doc from java.util.Map.computeIfPresent.

the remapping function to compute a value

Returns:Cookie

Doc from java.util.Map.computeIfPresent.

the new value associated with the specified key, or null if none

Annotations
@Override
containsKeyback to summary
public boolean containsKey(final Object key)

Overrides java.util.HashMap.containsKey.

Implements java.util.Map.containsKey.

Doc from java.util.HashMap.containsKey.

Returns true if this map contains a mapping for the specified key.

Parameters
key:Object

The key whose presence in this map is to be tested

Returns:boolean

true if this map contains a mapping for the specified key.

Annotations
@Override
containsValueback to summary
public boolean containsValue(final Object value)

Overrides java.util.HashMap.containsValue.

Implements java.util.Map.containsValue.

Doc from java.util.HashMap.containsValue.

Returns true if this map maps one or more keys to the specified value.

Parameters
value:Object

value whose presence in this map is to be tested

Returns:boolean

true if this map maps one or more keys to the specified value

Annotations
@Override
entrySetback to summary
public Set<Map.Entry<String, Cookie>> entrySet()

Overrides java.util.HashMap.entrySet.

Implements java.util.Map.entrySet.

Doc from java.util.HashMap.entrySet.

Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Set<Map.Entry<String, Cookie>>

a set view of the mappings contained in this map

Annotations
@Override
forEachback to summary
public void forEach(BiConsumer<? super String, ? super Cookie> action)

Overrides java.util.HashMap.forEach.

Overrides default java.util.Map.forEach.

Doc from java.util.Map.forEach.

Performs the given action for each entry in this map until all entries have been processed or the action throws an exception. Unless otherwise specified by the implementing class, actions are performed in the order of entry set iteration (if an iteration order is specified.) Exceptions thrown by the action are relayed to the caller.

Parameters
action:BiConsumer<? super String, ? super Cookie>

The action to be performed for each entry

Annotations
@Override
getback to summary
public Cookie get(final Object key)

Overrides java.util.HashMap.get.

Implements java.util.Map.get.

Doc from java.util.HashMap.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that (key==null ? k==null : key.equals(k)), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Parameters
key:Object

Doc from java.util.Map.get.

the key whose associated value is to be returned

Returns:Cookie

Doc from java.util.Map.get.

the value to which the specified key is mapped, or null if this map contains no mapping for the key

Annotations
@Override
getOrDefaultback to summary
public Cookie getOrDefault(final Object key, final Cookie defaultValue)

Overrides java.util.HashMap.getOrDefault.

Overrides default java.util.Map.getOrDefault.

Doc from java.util.Map.getOrDefault.

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.

Parameters
key:Object

the key whose associated value is to be returned

defaultValue:Cookie

the default mapping of the key

Returns:Cookie

the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Overrides java.util.HashMap.isEmpty.

Implements java.util.Map.isEmpty.

Doc from java.util.HashMap.isEmpty.

Returns true if this map contains no key-value mappings.

Returns:boolean

true if this map contains no key-value mappings

Annotations
@Override
keySetback to summary
public Set<String> keySet()

Overrides java.util.HashMap.keySet.

Implements java.util.Map.keySet.

Doc from java.util.HashMap.keySet.

Returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

Returns:Set<String>

a set view of the keys contained in this map

Annotations
@Override
mergeback to summary
public Cookie merge(String key, Cookie value, BiFunction<? super Cookie, ? super Cookie, ? extends Cookie> remappingFunction)

Overrides java.util.HashMap.merge.

Overrides default java.util.Map.merge.

Doc from java.util.HashMap.merge.

If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value (optional operation). Otherwise, replaces the associated value with the results of the given remapping function, or removes if the result is null. This method may be of use when combining multiple mapped values for a key. For example, to either create or append a String msg to a value mapping:

 map.merge(key, msg, String::concat)

If the remapping function returns null, the mapping is removed. If the remapping function itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged.

The remapping function should not modify this map during computation.

This method will, on a best-effort basis, throw a ConcurrentModificationException if it is detected that the remapping function modifies this map during computation.

Parameters
key:String

Doc from java.util.Map.merge.

key with which the resulting value is to be associated

value:Cookie

Doc from java.util.Map.merge.

the non-null value to be merged with the existing value associated with the key or, if no existing value or a null value is associated with the key, to be associated with the key

remappingFunction:BiFunction<? super Cookie, ? super Cookie, ? extends Cookie>

Doc from java.util.Map.merge.

the remapping function to recompute a value if present

Returns:Cookie

Doc from java.util.Map.merge.

the new value associated with the specified key, or null if no value is associated with the key

Annotations
@Override
putback to summary
public Cookie put(final String key, final Cookie value)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Doc from java.util.HashMap.put.

Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.

Parameters
key:String

key with which the specified value is to be associated

value:Cookie

value to be associated with the specified key

Returns:Cookie

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)

Annotations
@Override
putAllback to summary
public void putAll(final Map<? extends String, ? extends Cookie> m)

Overrides java.util.HashMap.putAll.

Implements java.util.Map.putAll.

Doc from java.util.HashMap.putAll.

Copies all of the mappings from the specified map to this map. These mappings will replace any mappings that this map had for any of the keys currently in the specified map.

Parameters
m:Map<? extends String, ? extends Cookie>

mappings to be stored in this map

Annotations
@Override
putIfAbsentback to summary
public Cookie putIfAbsent(final String key, final Cookie value)

Overrides java.util.HashMap.putIfAbsent.

Overrides default java.util.Map.putIfAbsent.

Doc from java.util.Map.putIfAbsent.

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value (optional operation).

Parameters
key:String

key with which the specified value is to be associated

value:Cookie

value to be associated with the specified key

Returns:Cookie

the previous value associated with the specified key, or null if there was no mapping for the key. (A null return can also indicate that the map previously associated null with the key, if the implementation supports null values.)

Annotations
@Override
removeback to summary
public Cookie remove(final Object key)

Overrides java.util.HashMap.remove.

Implements java.util.Map.remove.

Doc from java.util.HashMap.remove.

Removes the mapping for the specified key from this map if present.

Parameters
key:Object

key whose mapping is to be removed from the map

Returns:Cookie

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)

Annotations
@Override
removeback to summary
public boolean remove(final Object key, final Object value)

Overrides java.util.HashMap.remove.

Overrides default java.util.Map.remove.

Doc from java.util.Map.remove.

Removes the entry for the specified key only if it is currently mapped to the specified value (optional operation).

Parameters
key:Object

key with which the specified value is associated

value:Object

value expected to be associated with the specified key

Returns:boolean

true if the value was removed

Annotations
@Override
replaceback to summary
public boolean replace(final String key, final Cookie oldValue, final Cookie newValue)

Overrides java.util.HashMap.replace.

Overrides default java.util.Map.replace.

Doc from java.util.Map.replace.

Replaces the entry for the specified key only if currently mapped to the specified value (optional operation).

Parameters
key:String

key with which the specified value is associated

oldValue:Cookie

value expected to be associated with the specified key

newValue:Cookie

value to be associated with the specified key

Returns:boolean

true if the value was replaced

Annotations
@Override
replaceback to summary
public Cookie replace(final String key, final Cookie value)

Overrides java.util.HashMap.replace.

Overrides default java.util.Map.replace.

Doc from java.util.Map.replace.

Replaces the entry for the specified key only if it is currently mapped to some value (optional operation).

Parameters
key:String

key with which the specified value is associated

value:Cookie

value to be associated with the specified key

Returns:Cookie

the previous value associated with the specified key, or null if there was no mapping for the key. (A null return can also indicate that the map previously associated null with the key, if the implementation supports null values.)

Annotations
@Override
replaceAllback to summary
public void replaceAll(BiFunction<? super String, ? super Cookie, ? extends Cookie> function)

Overrides java.util.HashMap.replaceAll.

Overrides default java.util.Map.replaceAll.

Doc from java.util.Map.replaceAll.

Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception (optional operation). Exceptions thrown by the function are relayed to the caller.

Parameters
function:BiFunction<? super String, ? super Cookie, ? extends Cookie>

the function to apply to each entry

Annotations
@Override
sizeback to summary
public int size()

Overrides java.util.HashMap.size.

Implements java.util.Map.size.

Doc from java.util.HashMap.size.

Returns the number of key-value mappings in this map.

Returns:int

the number of key-value mappings in this map

Annotations
@Override
valuesback to summary
public Collection<Cookie> values()

Overrides java.util.HashMap.values.

Implements java.util.Map.values.

Doc from java.util.HashMap.values.

Returns a Collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Collection<Cookie>

a view of the values contained in this map

Annotations
@Override
io.undertow.server back to summary

private final Class MapDelegatingToSet.ReadOnlyEntry

extends Object
implements Map.Entry<String, Cookie>
Class Inheritance
All Implemented Interfaces
java.util.Map.Entry

Field Summary

Modifier and TypeField and Description
private final String
private final Cookie

Constructor Summary

AccessConstructor and Description
private
ReadOnlyEntry(final String key, final Cookie value)

Method Summary

Modifier and TypeMethod and Description
public String
getKey()

Implements java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

public Cookie
getValue()

Implements java.util.Map.Entry.getValue.

Returns the value corresponding to this entry.

public Cookie
setValue(final Cookie
new value to be stored in this entry
cookie
)

Implements java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private final String key
valueback to summary
private final Cookie value

Constructor Detail

ReadOnlyEntryback to summary
private ReadOnlyEntry(final String key, final Cookie value)

Method Detail

getKeyback to summary
public String getKey()

Implements java.util.Map.Entry.getKey.

Doc from java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

Returns:String

the key corresponding to this entry

Annotations
@Override
getValueback to summary
public Cookie getValue()

Implements java.util.Map.Entry.getValue.

Doc from java.util.Map.Entry.getValue.

Returns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.

Returns:Cookie

the value corresponding to this entry

Annotations
@Override
setValueback to summary
public Cookie setValue(final Cookie cookie)

Implements java.util.Map.Entry.setValue.

Doc from java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation). (Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator's remove operation).

Parameters
cookie:Cookie

new value to be stored in this entry

Returns:Cookie

old value corresponding to the entry

Annotations
@Override