Interface HttpResponseCookies
- All Superinterfaces:
Iterable<HttpResponseCookie>
- All Known Implementing Classes:
ProcessAwareHttpResponseCookies
HttpResponseCookie instances for the HttpResponse.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionObtains theHttpResponseCookieby name.booleanremoveCookie(HttpResponseCookie cookie) Removes theHttpResponseCookie.Sets aHttpResponseCookie.setCookie(String name, String value, Consumer<HttpResponseCookie> initialiser) Sets aHttpResponseCookie.setCookie(HttpRequestCookie cookie) Sets aHttpResponseCookiefrom aHttpRequestCookie.setCookie(HttpRequestCookie cookie, Consumer<HttpResponseCookie> initialiser) Sets aHttpResponseCookiefrom aHttpRequestCookie.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
setCookie
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
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
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
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
Removes theHttpResponseCookie.- Parameters:
cookie-HttpResponseCookie.- Returns:
trueif theHttpResponseCookiewas removed.
-
getCookie
Obtains theHttpResponseCookieby name.- Parameters:
name- Name of theHttpResponseCookie.- Returns:
HttpResponseCookieornullif noHttpResponseCookieby the name.
-