Constructor and Description |
---|
Definition(Cookie.Definition def)
Clone a new
cookie's definition . |
Definition(String name)
Creates a new
cookie's definition . |
Definition(String name,
String value)
Creates a new
cookie's definition . |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
comment() |
Cookie.Definition |
comment(String comment)
Set cookie's comment.
|
Optional<String> |
domain() |
Cookie.Definition |
domain(String domain)
Set the cookie's domain.
|
Optional<Boolean> |
httpOnly() |
Cookie.Definition |
httpOnly(boolean httpOnly)
Set HttpOnly flag.
|
Optional<Integer> |
maxAge()
Gets the maximum age in seconds for this Cookie.
|
Cookie.Definition |
maxAge(int maxAge)
Sets the maximum age in seconds for this Cookie.
|
Optional<String> |
name() |
Cookie.Definition |
name(String name)
Set/Override the cookie's name.
|
Optional<String> |
path() |
Cookie.Definition |
path(String path)
Set the cookie's path.
|
Optional<Boolean> |
secure() |
Cookie.Definition |
secure(boolean secure)
True, ensure that the session cookie is only transmitted via HTTPS.
|
Cookie |
toCookie()
Produces a cookie from current definition.
|
String |
toString() |
Optional<String> |
value() |
Cookie.Definition |
value(String value)
Set the cookie's value.
|
public Definition(Cookie.Definition def)
cookie's definition
.def
- A cookie's definition.public Definition(String name, String value)
cookie's definition
.name
- Cookie's name.value
- Cookie's value.public Definition(String name)
cookie's definition
.name
- Cookie's name.@Nonnull public Cookie toCookie()
@Nonnull public Cookie.Definition name(String name)
name
- A cookie's name.@Nonnull public Cookie.Definition value(String value)
value
- A value.@Nonnull public Cookie.Definition domain(String domain)
domain
- Cookie's domain.@Nonnull public Cookie.Definition path(String path)
path
- Cookie's path.@Nonnull public Cookie.Definition comment(String comment)
comment
- A cookie's comment.@Nonnull public Cookie.Definition httpOnly(boolean httpOnly)
httpOnly
- True, for HTTP Only.@Nonnull public Cookie.Definition secure(boolean secure)
secure
- True, ensure that the session cookie is only transmitted via HTTPS.@Nonnull public Optional<Boolean> secure()
@Nonnull public Cookie.Definition maxAge(int maxAge)
A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age.
A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.
maxAge
- an integer specifying the maximum age of the cookie in seconds; if negative,
means the cookie is not stored; if zero, deletes the cookie.@Nonnull public Optional<Integer> maxAge()
A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age.
A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.
Copyright © 2017. All rights reserved.