public static class NewCookie.Builder extends NewCookie.AbstractNewCookieBuilder<NewCookie.Builder>
NewCookie builder class.
New Cookie builder provides methods that let you conveniently configure and subsequently build a new
NewCookie instance.
NewCookie cookie = new NewCookie.Builder("name")
.path("/")
.domain("domain.com")
.sameSite(SameSite.LAX)
.build();
| Constructor and Description |
|---|
Builder(Cookie cookie)
Create a new instance supplementing the information in the supplied cookie.
|
Builder(java.lang.String name)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
NewCookie |
build()
Build a new
NewCookie instance using all the configuration previously specified in this builder. |
comment, expiry, httpOnly, maxAge, sameSite, securedomain, path, value, versionpublic Builder(java.lang.String name)
name - the name of the cookie.public Builder(Cookie cookie)
cookie - the cookie to clone.public NewCookie build()
NewCookie.AbstractNewCookieBuilderNewCookie instance using all the configuration previously specified in this builder.build in class NewCookie.AbstractNewCookieBuilder<NewCookie.Builder>NewCookie instance.