Package akka.http.scaladsl.model.headers
Class HttpCookie
java.lang.Object
akka.http.javadsl.model.headers.HttpCookie
akka.http.scaladsl.model.headers.HttpCookie
- All Implemented Interfaces:
Renderable
,ToStringRenderable
,Serializable
,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
ConstructorsConstructorDescriptionHttpCookie
(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) Deprecated.Please use HttpCookie(name, value).withXxx().HttpCookie
(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) -
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) Deprecated.for binary compatibility.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 akka.parboiled2.CharPredicate
boolean
scala.Option<DateTime>
expires()
scala.Option<String>
static HttpCookie
fromPair
(HttpCookiePair pair, scala.Option<DateTime> expires, scala.Option<Object> maxAge, scala.Option<String> domain, scala.Option<String> path, boolean secure, boolean httpOnly, scala.Option<String> extension) Deprecated.Use HttpCookiePair.toCookie and withXxx methods instead.Java APIJava APIJava APIJava APIgetPath()
Java APIJava APIboolean
httpOnly()
scala.Option<Object>
maxAge()
name()
static akka.parboiled2.CharPredicate
pair()
Returns the name/value pair for this cookie, to be used inCookie
headers.scala.Option<String>
path()
static akka.parboiled2.CharPredicate
int
productElement
(int n) static akka.parboiled2.CharPredicate
render
(R r) scala.Option<SameSite>
sameSite()
boolean
secure()
static scala.Option<scala.Tuple9<String,
String, scala.Option<DateTime>, scala.Option<Object>, scala.Option<String>, scala.Option<String>, Object, Object, scala.Option<String>>> unapply
(HttpCookie cookie) Deprecated.Pattern matching on HttpCookie is deprecated because of the big number of fields and potential future compatibility hazards.value()
static akka.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
(SameSite sameSite) Java APIwithSameSite
(SameSite sameSite) Scala APIwithSameSite
(Optional<SameSite> sameSite) Returns a copy of this HttpCookie instance with the given OptionalSameSite
set.withSameSite
(scala.Option<SameSite> sameSite) withSecure
(boolean secure) Returns a copy of this HttpCookie instance with the given secure flag set.Methods inherited from class akka.http.javadsl.model.headers.HttpCookie
create, 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 akka.http.impl.util.ToStringRenderable
toString
-
Constructor Details
-
HttpCookie
-
HttpCookie
public HttpCookie(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) Deprecated.Please use HttpCookie(name, value).withXxx(). Since 10.2.0.
-
-
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)
-
unapply
public static scala.Option<scala.Tuple9<String,String, unapplyscala.Option<DateTime>, scala.Option<Object>, scala.Option<String>, scala.Option<String>, Object, Object, scala.Option<String>>> (HttpCookie cookie) Deprecated.Pattern matching on HttpCookie is deprecated because of the big number of fields and potential future compatibility hazards. Please use other means to check the fields. Since 10.2.0. -
fromPair
public static HttpCookie fromPair(HttpCookiePair pair, scala.Option<DateTime> expires, scala.Option<Object> maxAge, scala.Option<String> domain, scala.Option<String> path, boolean secure, boolean httpOnly, scala.Option<String> extension) Deprecated.Use HttpCookiePair.toCookie and withXxx methods instead. Since 10.2.0. -
nameChars
public static akka.parboiled2.CharPredicate nameChars() -
valueChars
public static akka.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 akka.parboiled2.CharPredicate rawValueChars() -
domainChars
public static akka.parboiled2.CharPredicate domainChars() -
pathOrExtChars
public static akka.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
public HttpCookie 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) Deprecated.for binary compatibility. Since 10.2.0. -
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
-