Top Description Fields Constructors Methods
org.apache.hc.client5.http.impl.cookie

public abstract Class AbstractCookieSpec

extends Object
implements CookieSpec
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.cookie.CookieSpec
Known Direct Subclasses
org.apache.hc.client5.http.impl.cookie.CookieSpecBase
Annotations
@Contract
threading:SAFE
Imports
java.util.Collection, .HashMap, .Map, java.util.concurrent.ConcurrentHashMap, org.apache.hc.client5.http.cookie.CommonCookieAttributeHandler, .CookieAttributeHandler, .CookieSpec, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.util.Asserts

Abstract cookie specification which can delegate the job of parsing, validation or matching cookie attributes to a number of arbitrary CookieAttributeHandlers.
Since
4.0

Field Summary

Modifier and TypeField and Description
private final Map<String, CookieAttributeHandler>
attribHandlerMap

Stores attribute name -> attribute handler mappings

Constructor Summary

AccessConstructor and Description
public
AbstractCookieSpec()

Default constructor

protected
protected

Method Summary

Modifier and TypeMethod and Description
protected CookieAttributeHandler

Returns:

an attribute handler or null
findAttribHandler
(final String
attribute name. e.g. Domain, Path, etc.
name
)

Finds an attribute handler CookieAttributeHandler for the given attribute.

protected CookieAttributeHandler
getAttribHandler(final String
attribute name. e.g. Domain, Path, etc.
name
)

Gets attribute handler CookieAttributeHandler for the given attribute.

protected Collection<CookieAttributeHandler>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attribHandlerMapback to summary
private final Map<String, CookieAttributeHandler> attribHandlerMap

Stores attribute name -> attribute handler mappings

Constructor Detail

AbstractCookieSpecback to summary
public AbstractCookieSpec()

Default constructor

AbstractCookieSpecback to summary
protected AbstractCookieSpec(final HashMap<String, CookieAttributeHandler> map)
Since
4.4
AbstractCookieSpecback to summary
protected AbstractCookieSpec(final CommonCookieAttributeHandler... handlers)
Since
4.4

Method Detail

findAttribHandlerback to summary
protected CookieAttributeHandler findAttribHandler(final String name)

Finds an attribute handler CookieAttributeHandler for the given attribute. Returns null if no attribute handler is found for the specified attribute.

Parameters
name:String

attribute name. e.g. Domain, Path, etc.

Returns:CookieAttributeHandler

an attribute handler or null

getAttribHandlerback to summary
protected CookieAttributeHandler getAttribHandler(final String name)

Gets attribute handler CookieAttributeHandler for the given attribute.

Parameters
name:String

attribute name. e.g. Domain, Path, etc.

Exceptions
IllegalStateException:
if handler not found for the specified attribute.
getAttribHandlersback to summary
protected Collection<CookieAttributeHandler> getAttribHandlers()