Interface HttpResponseCookies
-
- All Superinterfaces:
java.lang.Iterable<HttpResponseCookie>
- All Known Implementing Classes:
ProcessAwareHttpResponseCookies
public interface HttpResponseCookies extends java.lang.Iterable<HttpResponseCookie>
HttpResponseCookieinstances for theHttpResponse.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpResponseCookiegetCookie(java.lang.String name)Obtains theHttpResponseCookieby name.booleanremoveCookie(HttpResponseCookie cookie)Removes theHttpResponseCookie.HttpResponseCookiesetCookie(java.lang.String name, java.lang.String value)Sets aHttpResponseCookie.HttpResponseCookiesetCookie(java.lang.String name, java.lang.String value, java.util.function.Consumer<HttpResponseCookie> initialiser)Sets aHttpResponseCookie.HttpResponseCookiesetCookie(HttpRequestCookie cookie)Sets aHttpResponseCookiefrom aHttpRequestCookie.HttpResponseCookiesetCookie(HttpRequestCookie cookie, java.util.function.Consumer<HttpResponseCookie> initialiser)Sets aHttpResponseCookiefrom aHttpRequestCookie.
-
-
-
Method Detail
-
setCookie
HttpResponseCookie setCookie(java.lang.String name, java.lang.String value)
Sets a
HttpResponseCookie.If a
HttpResponseCookiealready exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookieis 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
HttpResponseCookiealready exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookieis 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
HttpResponseCookiefrom aHttpRequestCookie.If a
HttpResponseCookiealready exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookieis 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
HttpResponseCookiefrom aHttpRequestCookie.If a
HttpResponseCookiealready exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookieis added for the name.- Parameters:
cookie-HttpRequestCookieinitialiser- 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:
trueif theHttpResponseCookiewas removed.
-
getCookie
HttpResponseCookie getCookie(java.lang.String name)
Obtains theHttpResponseCookieby name.- Parameters:
name- Name of theHttpResponseCookie.- Returns:
HttpResponseCookieornullif noHttpResponseCookieby the name.
-
-