Class HttpCookie
java.lang.Object
org.apache.pekko.http.javadsl.model.headers.HttpCookie
org.apache.pekko.http.scaladsl.model.headers.HttpCookie
- All Implemented Interfaces:
Serializable
,Renderable
,ToStringRenderable
,scala.Equals
,scala.Product
public final class HttpCookie
extends HttpCookie
implements ToStringRenderable, scala.Product, Serializable, scala.Equals
for a full definition of the http cookie header fields, see
http://tools.ietf.org/html/rfc6265
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpCookie
apply
(String name, String value, scala.Option<DateTime> expires, scala.Option<Object> maxAge, scala.Option<String> domain, scala.Option<String> path, boolean secure, boolean httpOnly, scala.Option<String> extension) You are encouraged to provide only 'name' and 'value' here, and use 'withXxx' methods to populate other fields.boolean
copy
(String name, String value, scala.Option<DateTime> expires, scala.Option<Object> maxAge, scala.Option<String> domain, scala.Option<String> path, boolean secure, boolean httpOnly, scala.Option<String> extension, scala.Option<SameSite> sameSite) scala.Option<String>
domain()
static org.parboiled2.CharPredicate
boolean
scala.Option<DateTime>
expires()
scala.Option<String>
Java APIJava APIJava APIJava APIgetPath()
Java APIJava APIboolean
httpOnly()
scala.Option<Object>
maxAge()
name()
static org.parboiled2.CharPredicate
pair()
Returns the name/value pair for this cookie, to be used inCookie
headers.scala.Option<String>
path()
static org.parboiled2.CharPredicate
int
productElement
(int n) static org.parboiled2.CharPredicate
render
(R r) scala.Option<SameSite>
sameSite()
boolean
secure()
value()
static org.parboiled2.CharPredicate
http://tools.ietf.org/html/rfc6265#section-4.1.1 US-ASCII characters excluding CTLs, whitespace DQUOTE, comma, semicolon, and backslashwithDomain
(String domain) Returns a copy of this HttpCookie instance with the given domain set.withExpires
(DateTime dateTime) Java APIwithExpires
(DateTime dateTime) Scala APIwithExtension
(String extension) Returns a copy of this HttpCookie instance with the given extension set.withHttpOnly
(boolean httpOnly) Returns a copy of this HttpCookie instance with the given http-only flag set.withMaxAge
(long maxAge) Returns a copy of this HttpCookie instance with the given max age set.Returns a copy of this HttpCookie instance with the given path set.withSameSite
(Optional<SameSite> sameSite) Returns a copy of this HttpCookie instance with the given OptionalSameSite
set.withSameSite
(SameSite sameSite) Java APIwithSameSite
(SameSite sameSite) Scala APIwithSameSite
(scala.Option<SameSite> sameSite) withSecure
(boolean secure) Returns a copy of this HttpCookie instance with the given secure flag set.Methods inherited from class org.apache.pekko.http.javadsl.model.headers.HttpCookie
create, create, create
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface scala.Product
productElementName, productElementNames, productIterator, productPrefix
Methods inherited from interface org.apache.pekko.http.impl.util.ToStringRenderable
toString
-
Constructor Details
-
HttpCookie
-
-
Method Details
-
apply
public static HttpCookie apply(String name, String value, scala.Option<DateTime> expires, scala.Option<Object> maxAge, scala.Option<String> domain, scala.Option<String> path, boolean secure, boolean httpOnly, scala.Option<String> extension) You are encouraged to provide only 'name' and 'value' here, and use 'withXxx' methods to populate other fields.- Parameters:
name
- (undocumented)value
- (undocumented)expires
- (undocumented)maxAge
- (undocumented)domain
- (undocumented)path
- (undocumented)secure
- (undocumented)httpOnly
- (undocumented)extension
- (undocumented)- Returns:
- (undocumented)
-
nameChars
public static org.parboiled2.CharPredicate nameChars() -
valueChars
public static org.parboiled2.CharPredicate valueChars()http://tools.ietf.org/html/rfc6265#section-4.1.1 US-ASCII characters excluding CTLs, whitespace DQUOTE, comma, semicolon, and backslash- Returns:
- (undocumented)
-
rawValueChars
public static org.parboiled2.CharPredicate rawValueChars() -
domainChars
public static org.parboiled2.CharPredicate domainChars() -
pathOrExtChars
public static org.parboiled2.CharPredicate pathOrExtChars() -
name
- Specified by:
name
in classHttpCookie
-
value
- Specified by:
value
in classHttpCookie
-
expires
-
maxAge
-
domain
-
path
-
secure
public boolean secure()- Specified by:
secure
in classHttpCookie
-
httpOnly
public boolean httpOnly()- Specified by:
httpOnly
in classHttpCookie
-
extension
-
sameSite
-
copy
-
productArity
public int productArity()- Specified by:
productArity
in interfacescala.Product
-
productElement
- Specified by:
productElement
in interfacescala.Product
-
canEqual
- Specified by:
canEqual
in interfacescala.Equals
-
equals
-
pair
Returns the name/value pair for this cookie, to be used inCookie
headers.- Specified by:
pair
in classHttpCookie
-
render
- Specified by:
render
in interfaceRenderable
-
getSameSite
Java API- Specified by:
getSameSite
in classHttpCookie
-
getExtension
Java API- Specified by:
getExtension
in classHttpCookie
-
getPath
Java API- Specified by:
getPath
in classHttpCookie
-
getDomain
Java API- Specified by:
getDomain
in classHttpCookie
-
getMaxAge
Java API- Specified by:
getMaxAge
in classHttpCookie
-
getExpires
Java API- Specified by:
getExpires
in classHttpCookie
-
withName
-
withValue
-
withExpires
Scala API -
withExpires
Java API- Specified by:
withExpires
in classHttpCookie
-
withDomain
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given domain set.- Specified by:
withDomain
in classHttpCookie
-
withPath
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given path set.- Specified by:
withPath
in classHttpCookie
-
withMaxAge
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given max age set.- Specified by:
withMaxAge
in classHttpCookie
-
withSecure
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given secure flag set.- Specified by:
withSecure
in classHttpCookie
-
withHttpOnly
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given http-only flag set.- Specified by:
withHttpOnly
in classHttpCookie
-
withSameSite
Scala API -
withSameSite
-
withSameSite
Java API- Specified by:
withSameSite
in classHttpCookie
-
withSameSite
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given OptionalSameSite
set.- Specified by:
withSameSite
in classHttpCookie
-
withExtension
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given extension set.- Specified by:
withExtension
in classHttpCookie
-