public static final class Cookie.Builder
extends java.lang.Object
Cookie.
Builders are created by invoking Cookie.newBuilder(). Each of the setter methods modifies
the state of the builder and returns the same instance. Builders are not thread-safe and
should not be used concurrently from multiple threads without external synchronization.
| Modifier and Type | Method and Description |
|---|---|
Cookie |
build()
Returns a new
Cookie built from the current state of this builder. |
Cookie.Builder |
creationTime(Timestamp creationTime)
Sets the cookie creation time.
|
Cookie.Builder |
domain(java.lang.String domain)
Sets the cookie domain.
|
Cookie.Builder |
expirationTime(Timestamp expirationTime)
Sets the cookie expiration time.
|
Cookie.Builder |
httpOnly(boolean httpOnly)
Specifies whether the cookie is considered HTTP only.
|
Cookie.Builder |
name(java.lang.String name)
Sets the cookie name.
|
Cookie.Builder |
path(java.lang.String path)
Sets the cookie path.
|
Cookie.Builder |
secure(boolean secure)
Specifies whether the cookie is restricted to a secure protocol (HTTPS or WSS) or it can
be sent using any protocol.
|
Cookie.Builder |
value(java.lang.String value)
Sets the cookie value.
|
public Cookie.Builder name(java.lang.String name)
name - the cookie namepublic Cookie.Builder value(java.lang.String value)
value - the cookie valuepublic Cookie.Builder domain(java.lang.String domain)
domain - the cookie domainpublic Cookie.Builder path(java.lang.String path)
path - the cookie pathpublic Cookie.Builder secure(boolean secure)
secure - the flag valuepublic Cookie.Builder httpOnly(boolean httpOnly)
httpOnly - the flag valuepublic Cookie.Builder creationTime(Timestamp creationTime)
creationTime - the cookie creation timepublic Cookie.Builder expirationTime(Timestamp expirationTime)
expirationTime - the cookie expiration time