Interface HttpResponseCookies
-
- All Superinterfaces:
java.lang.Iterable<HttpResponseCookie>
- All Known Implementing Classes:
ProcessAwareHttpResponseCookies
public interface HttpResponseCookies extends java.lang.Iterable<HttpResponseCookie>
HttpResponseCookie
instances for theHttpResponse
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpResponseCookie
getCookie(java.lang.String name)
Obtains theHttpResponseCookie
by name.boolean
removeCookie(HttpResponseCookie cookie)
Removes theHttpResponseCookie
.HttpResponseCookie
setCookie(java.lang.String name, java.lang.String value)
Sets aHttpResponseCookie
.HttpResponseCookie
setCookie(java.lang.String name, java.lang.String value, java.util.function.Consumer<HttpResponseCookie> initialiser)
Sets aHttpResponseCookie
.HttpResponseCookie
setCookie(HttpRequestCookie cookie)
Sets aHttpResponseCookie
from aHttpRequestCookie
.HttpResponseCookie
setCookie(HttpRequestCookie cookie, java.util.function.Consumer<HttpResponseCookie> initialiser)
Sets aHttpResponseCookie
from aHttpRequestCookie
.
-
-
-
Method Detail
-
setCookie
HttpResponseCookie setCookie(java.lang.String name, java.lang.String value)
Sets a
HttpResponseCookie
.If a
HttpResponseCookie
already exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookie
is added for the name.- Parameters:
name
- Name.value
- Value.- Returns:
HttpRequestCookie
.
-
setCookie
HttpResponseCookie setCookie(java.lang.String name, java.lang.String value, java.util.function.Consumer<HttpResponseCookie> initialiser)
Sets a
HttpResponseCookie
.If a
HttpResponseCookie
already exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookie
is added for the name.- Parameters:
name
- Name.value
- Value.initialiser
- Enables initialising the attributes of theHttpResponseCookie
. This reduces locking in setting multiple attributes.- Returns:
HttpResponseCookie
.
-
setCookie
HttpResponseCookie setCookie(HttpRequestCookie cookie)
Sets a
HttpResponseCookie
from aHttpRequestCookie
.If a
HttpResponseCookie
already exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookie
is added for the name.This is typically used to update the Cookie with the client. For example, expiring the Cookie to no longer be sent.
- Parameters:
cookie
-HttpRequestCookie
.- Returns:
HttpResponseCookie
.
-
setCookie
HttpResponseCookie setCookie(HttpRequestCookie cookie, java.util.function.Consumer<HttpResponseCookie> initialiser)
Sets a
HttpResponseCookie
from aHttpRequestCookie
.If a
HttpResponseCookie
already exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookie
is added for the name.- Parameters:
cookie
-HttpRequestCookie
initialiser
- Enables initialising the attributes of theHttpResponseCookie
. This reduces locking in setting multiple attributes.- Returns:
HttpResponseCookie
.
-
removeCookie
boolean removeCookie(HttpResponseCookie cookie)
Removes theHttpResponseCookie
.- Parameters:
cookie
-HttpResponseCookie
.- Returns:
true
if theHttpResponseCookie
was removed.
-
getCookie
HttpResponseCookie getCookie(java.lang.String name)
Obtains theHttpResponseCookie
by name.- Parameters:
name
- Name of theHttpResponseCookie
.- Returns:
HttpResponseCookie
ornull
if noHttpResponseCookie
by the name.
-
-