public class Cookie extends Object
All cookies must have a name and a value and can optionally have other fields set such as path, domain, etc.
NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<Cookie> |
__TYPE_ARG |
Constructor and Description |
---|
Cookie(Cookie delegate) |
Cookie(Object delegate) |
Modifier and Type | Method and Description |
---|---|
static Cookie |
cookie(String name,
String value)
Create a new cookie
|
String |
encode()
Encode the cookie to a string.
|
boolean |
equals(Object o) |
Cookie |
getDelegate() |
String |
getDomain() |
String |
getName() |
String |
getPath() |
CookieSameSite |
getSameSite() |
String |
getValue() |
int |
hashCode() |
boolean |
isHttpOnly() |
boolean |
isSecure() |
static Cookie |
newInstance(Cookie arg) |
Cookie |
setDomain(String domain)
Sets the domain of this cookie
|
Cookie |
setHttpOnly(boolean httpOnly)
Determines if this cookie is HTTP only.
|
Cookie |
setMaxAge(long maxAge)
Sets the maximum age of this cookie in seconds.
|
Cookie |
setPath(String path)
Sets the path of this cookie.
|
Cookie |
setSameSite(CookieSameSite policy)
Sets the same site of this cookie.
|
Cookie |
setSecure(boolean secure)
Sets the security getStatus of this cookie
|
Cookie |
setValue(String value)
Sets the value of this cookie
|
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<Cookie> __TYPE_ARG
public Cookie getDelegate()
public static Cookie cookie(String name, String value)
name
- the name of the cookievalue
- the cookie valuepublic String getName()
public String getValue()
public Cookie setValue(String value)
value
- The value to setpublic Cookie setDomain(String domain)
domain
- The domain to usepublic String getDomain()
public Cookie setPath(String path)
path
- The path to use for this cookiepublic String getPath()
public Cookie setMaxAge(long maxAge)
0
is specified, this cookie will be
automatically removed by browser because it will expire immediately.
If Long
is specified, this cookie will be removed when the
browser is closed.
If you don't set this the cookie will be a session cookie and be removed when the browser is closed.maxAge
- The maximum age of this cookie in secondspublic Cookie setSecure(boolean secure)
secure
- True if this cookie is to be secure, otherwise falsepublic boolean isSecure()
public Cookie setHttpOnly(boolean httpOnly)
httpOnly
- True if the cookie is HTTP only, otherwise false.public boolean isHttpOnly()
public Cookie setSameSite(CookieSameSite policy)
policy
- The policy should be one of CookieSameSite
.public CookieSameSite getSameSite()
public String encode()
Copyright © 2020 Eclipse. All rights reserved.