Package io.servicetalk.http.api
Class HeaderUtils.CookiesByNameIterator
java.lang.Object
io.servicetalk.http.api.HeaderUtils.CookiesByNameIterator
- All Implemented Interfaces:
Iterator<HttpCookiePair>
- Enclosing class:
- HeaderUtils
public abstract static class HeaderUtils.CookiesByNameIterator
extends Object
implements Iterator<HttpCookiePair>
An
Iterator
of HttpCookiePair
designed to iterate across multiple values of
HttpHeaderNames.COOKIE
for a specific cookie-name
.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CookiesByNameIterator
(CharSequence cookiePairName) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Advance thecookieHeaderValue()
to the nextHttpHeaderNames.COOKIE
header value.protected abstract CharSequence
Get the current value forHttpHeaderNames.COOKIE
.final boolean
hasNext()
protected final void
initNext
(CharSequence cookieHeaderValue) Initialize the nextHttpCookiePair
value fornext()
.final HttpCookiePair
next()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
CookiesByNameIterator
Create a new instance.- Parameters:
cookiePairName
- Each return value ofnext()
will haveHttpCookiePair.name()
equivalent to this value.
-
-
Method Details
-
hasNext
public final boolean hasNext()- Specified by:
hasNext
in interfaceIterator<HttpCookiePair>
-
next
- Specified by:
next
in interfaceIterator<HttpCookiePair>
-
cookieHeaderValue
Get the current value forHttpHeaderNames.COOKIE
. This value may change during iteration.- Returns:
- the current value for
HttpHeaderNames.COOKIE
, ornull
if all have been iterated.
-
advanceCookieHeaderValue
protected abstract void advanceCookieHeaderValue()Advance thecookieHeaderValue()
to the nextHttpHeaderNames.COOKIE
header value. -
initNext
Initialize the nextHttpCookiePair
value fornext()
.- Parameters:
cookieHeaderValue
- The initial value forHttpHeaderNames.COOKIE
.
-