- java.lang.Object
-
- io.helidon.common.http.SetCookie
-
public class SetCookie extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SetCookie.Builder
A fluent API builder forSetCookie
.static class
SetCookie.SameSite
The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SetCookie.Builder
builder(String name, String value)
Creates a new fluent API builder.static SetCookie
create(String name, String value)
Creates new instance.String
name()
Gets cookie's name.static SetCookie
parse(String setCookie)
Parses new instance ofSetCookie
from the String representation.String
toString()
Returns content of this instance as a 'Set-Cookie:' header value specified by RFC6265.
-
-
-
Method Detail
-
name
public String name()
Gets cookie's name.- Returns:
- the name.
-
builder
public static SetCookie.Builder builder(String name, String value)
Creates a new fluent API builder.- Parameters:
name
- a cookie name.value
- a cookie value.- Returns:
- a new fluent API builder
-
parse
public static SetCookie parse(String setCookie)
Parses new instance ofSetCookie
from the String representation.- Parameters:
setCookie
- string representation- Returns:
- new instance
-
create
public static SetCookie create(String name, String value)
Creates new instance.- Parameters:
name
- a cookie name.value
- a cookie value.- Returns:
- a new instance with just the name and value configured
-
-