Class CookieMap<P>
java.lang.Object
org.apache.commons.chain.web.ParameterMap<P,Cookie>
org.apache.commons.chain.web.javax.internal.CookieMap<P>
- Type Parameters:
P
- the type of the parameter-provider
Implementation of
Map
for cookies with
a parameter-provider.- Since:
- Chain 1.3
- Author:
- Graff Stefan
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(Object key) Returnstrue
if this cookie-map contains a mapping for the specified cookie-name.boolean
containsValue
(Object value) Returnstrue
if this cookie-map maps one or more keys to the specified cookie.entrySet()
Returns aSet
view of the mappings contained in this cookie-map.boolean
Compares the specified object with this cookie-map for equality.Returns the cookie to which the specified cookie-name is mapped, ornull
if this cookie-map contains no mapping for the cookie-name.int
hashCode()
Returns the hash code value for this cookie-map.boolean
isEmpty()
Returnstrue
if this cookie-map contains no cookies.keySet()
Returns aSet
view of the cookies contained in this cookie-map.int
size()
Returns the number of cookies in this cookie-map.values()
Returns aCollection
view of the cookies contained in this cookie-map.Methods inherited from class org.apache.commons.chain.web.ParameterMap
clear, entrySet, getNamesSupplier, getParameter, getValueFunction, key, put, putAll, remove, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
CookieMap
The constructor for theMap
for cookies.- Parameters:
request
- the request with the cookiescookiesSupplier
- Supplier to return theCookie
-Array in this object
-
-
Method Details
-
containsKey
Returnstrue
if this cookie-map contains a mapping for the specified cookie-name.- Specified by:
containsKey
in interfaceMap<String,
Cookie> - Overrides:
containsKey
in classParameterMap<P,
Cookie> - Parameters:
key
- The key whose presence in this cookie-map is to be tested- Returns:
true
if this cookie-map contains a mapping for the specified cookie-name.
-
containsValue
Returnstrue
if this cookie-map maps one or more keys to the specified cookie.- Specified by:
containsValue
in interfaceMap<String,
Cookie> - Overrides:
containsValue
in classParameterMap<P,
Cookie> - Parameters:
value
- cookie whose presence in this cookie-map is to be tested- Returns:
true
if this cookie-map maps one or more keys to the specified cookie
-
entrySet
Returns aSet
view of the mappings contained in this cookie-map. The set is not backed by the cookie-map, so changes to the cookie-map are not reflected in the set, and vice-versa. -
get
Returns the cookie to which the specified cookie-name is mapped, ornull
if this cookie-map contains no mapping for the cookie-name.- Specified by:
get
in interfaceMap<String,
Cookie> - Overrides:
get
in classParameterMap<P,
Cookie> - Parameters:
key
- the cookie-name whose associated value is to be returned- Returns:
- the value to which the specified key is mapped, or
null
if this cookie-map contains no mapping for the cookie-name - See Also:
-
isEmpty
Returnstrue
if this cookie-map contains no cookies. -
keySet
Returns aSet
view of the cookies contained in this cookie-map. The set is not backed by the cookie-map, so changes to the cookie-map are not reflected in the set, and vice-versa. -
size
Returns the number of cookies in this cookie-map. -
values
Returns aCollection
view of the cookies contained in this cookie-map. The collection is not backed by the cookie-map, so changes to the cookie-map are not reflected in the collection, and vice-versa. -
hashCode
Returns the hash code value for this cookie-map. The hash code of a cookie-map is defined to be the sum of the hash codes of each entry in the cookie-map'sentrySet()
view. This ensures thatm1.equals(m2)
implies thatm1.hashCode()==m2.hashCode()
for any two parameter-mapsm1
andm2
, as required by the general contract ofObject.hashCode()
. -
equals
Compares the specified object with this cookie-map for equality. Returnstrue
if the given object is also a cookie-map and the two cookie-maps represent the same mappings. More formally, two cookie-mapsm1
andm2
represent the same mappings ifm1.entrySet().equals(m2.entrySet())
.
-