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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) Returnstrueif this cookie-map contains a mapping for the specified cookie-name.booleancontainsValue(Object value) Returnstrueif this cookie-map maps one or more keys to the specified cookie.entrySet()Returns aSetview of the mappings contained in this cookie-map.booleanCompares the specified object with this cookie-map for equality.Returns the cookie to which the specified cookie-name is mapped, ornullif this cookie-map contains no mapping for the cookie-name.inthashCode()Returns the hash code value for this cookie-map.booleanisEmpty()Returnstrueif this cookie-map contains no cookies.keySet()Returns aSetview of the cookies contained in this cookie-map.intsize()Returns the number of cookies in this cookie-map.values()Returns aCollectionview 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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
CookieMap
The constructor for theMapfor cookies.- Parameters:
request- the request with the cookiescookiesSupplier- Supplier to return theCookie-Array in this object
-
-
Method Details
-
containsKey
Returnstrueif this cookie-map contains a mapping for the specified cookie-name.- Specified by:
containsKeyin interfaceMap<String,Cookie> - Overrides:
containsKeyin classParameterMap<P,Cookie> - Parameters:
key- The key whose presence in this cookie-map is to be tested- Returns:
trueif this cookie-map contains a mapping for the specified cookie-name.
-
containsValue
Returnstrueif this cookie-map maps one or more keys to the specified cookie.- Specified by:
containsValuein interfaceMap<String,Cookie> - Overrides:
containsValuein classParameterMap<P,Cookie> - Parameters:
value- cookie whose presence in this cookie-map is to be tested- Returns:
trueif this cookie-map maps one or more keys to the specified cookie
-
entrySet
Returns aSetview 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, ornullif this cookie-map contains no mapping for the cookie-name.- Specified by:
getin interfaceMap<String,Cookie> - Overrides:
getin 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
nullif this cookie-map contains no mapping for the cookie-name - See Also:
-
isEmpty
Returnstrueif this cookie-map contains no cookies. -
keySet
Returns aSetview 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 aCollectionview 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-mapsm1andm2, as required by the general contract ofObject.hashCode(). -
equals
Compares the specified object with this cookie-map for equality. Returnstrueif the given object is also a cookie-map and the two cookie-maps represent the same mappings. More formally, two cookie-mapsm1andm2represent the same mappings ifm1.entrySet().equals(m2.entrySet()).
-