org.apache.hc.client5.http.impl.cookie

## Class AbstractCookieSpec

- java.lang.Object
- - org.apache.hc.client5.http.impl.cookie.AbstractCookieSpec

All Implemented Interfaces:
  CookieSpec

Direct Known Subclasses:
  CookieSpecBase

    @ThreadSafe
    public abstract class AbstractCookieSpec
    extends Object
    implements CookieSpec

Abstract cookie specification which can delegate the job of parsing, validation or matching cookie attributes to a number of arbitrary `CookieAttributeHandler`s.

Since:
  4.0

### Constructor Summary

Constructors
`` `AbstractCookieSpec()` Default constructor
`protected` `AbstractCookieSpec(CommonCookieAttributeHandler... handlers)`
`protected` `AbstractCookieSpec(HashMap<String,CookieAttributeHandler> map)`

### Method Summary

Methods
`protected CookieAttributeHandler` `findAttribHandler(String name)` Finds an attribute handler `CookieAttributeHandler` for the given attribute.
`protected CookieAttributeHandler` `getAttribHandler(String name)` Gets attribute handler `CookieAttributeHandler` for the given attribute.
`protected Collection<CookieAttributeHandler>` `getAttribHandlers()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.hc.client5.http.cookie.CookieSpec

`formatCookies, match, parse, validate`

### Constructor Detail

#### AbstractCookieSpec

    public AbstractCookieSpec()

Default constructor

#### AbstractCookieSpec

    protected AbstractCookieSpec(HashMap<String,CookieAttributeHandler> map)

Since:
  4.4

#### AbstractCookieSpec

    protected AbstractCookieSpec(CommonCookieAttributeHandler... handlers)

Since:
  4.4

### Method Detail

#### findAttribHandler

    protected CookieAttributeHandler findAttribHandler(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` - attribute name. e.g. Domain, Path, etc.
Returns:
  an attribute handler or `null`

#### getAttribHandler

    protected CookieAttributeHandler getAttribHandler(String name)

Gets attribute handler `CookieAttributeHandler` for the given attribute.

Parameters:
  `name` - attribute name. e.g. Domain, Path, etc.
Throws:
  `IllegalStateException` - if handler not found for the specified attribute.

#### getAttribHandlers

    protected Collection<CookieAttributeHandler> getAttribHandlers()