public class SetCookie
extends java.lang.Object
| Constructor | Description |
|---|---|
SetCookie(java.lang.String name,
java.lang.String value) |
Creates new instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
SetCookie |
domain(java.lang.String domain) |
Sets
Domain parameter. |
SetCookie |
domainAndPath(java.net.URI domainAndPath) |
Sets
Domain and Path parameters. |
SetCookie |
expires(java.time.Instant expires) |
Sets
Expires parameter. |
SetCookie |
expires(java.time.ZonedDateTime expires) |
Sets
Expires parameter. |
SetCookie |
httpOnly(boolean httpOnly) |
Sets
HttpOnly parameter. |
SetCookie |
maxAge(java.time.Duration maxAge) |
Sets
Max-Age parameter. |
SetCookie |
path(java.lang.String path) |
Sets
Path parameter. |
SetCookie |
secure(boolean secure) |
Sets
Secure parameter. |
java.lang.String |
toString() |
Returns content of this instance as a 'Set-Cookie:' header value specified
by RFC6265.
|
public SetCookie(java.lang.String name,
java.lang.String value)
name - a cookie name.value - a cookie value.public SetCookie expires(java.time.ZonedDateTime expires)
Expires parameter.expires - an Expires parameter.public SetCookie expires(java.time.Instant expires)
Expires parameter.expires - an Expires parameter.public SetCookie maxAge(java.time.Duration maxAge)
Max-Age parameter.maxAge - an Max-Age parameter.public SetCookie domain(java.lang.String domain)
Domain parameter.domain - an Domain parameter.public SetCookie path(java.lang.String path)
Path parameter.path - an Path parameter.public SetCookie domainAndPath(java.net.URI domainAndPath)
Domain and Path parameters.domainAndPath - an URI to specify Domain and Path parameters.public SetCookie secure(boolean secure)
Secure parameter.secure - an Secure parameter.public SetCookie httpOnly(boolean httpOnly)
HttpOnly parameter.httpOnly - an HttpOnly parameter.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.