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
,java.io.Serializable
,scala.Equals
,scala.Product
public final class HttpCookie extends HttpCookie implements ToStringRenderable, scala.Product, java.io.Serializable, scala.Equals
for a full definition of the http cookie header fields, see http://tools.ietf.org/html/rfc6265- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HttpCookie(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension)
Deprecated.Please use HttpCookie(name, value).withXxx().HttpCookie(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension, scala.Option<SameSite> sameSite)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static HttpCookie
apply(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension)
You are encouraged to provide only 'name' and 'value' here, and use 'withXxx' methods to populate other fields.boolean
canEqual(java.lang.Object that)
HttpCookie
copy(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension)
Deprecated.for binary compatibility.HttpCookie
copy(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension, scala.Option<SameSite> sameSite)
scala.Option<java.lang.String>
domain()
static akka.parboiled2.CharPredicate
domainChars()
boolean
equals(java.lang.Object obj)
scala.Option<DateTime>
expires()
scala.Option<java.lang.String>
extension()
static HttpCookie
fromPair(HttpCookiePair pair, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension)
Deprecated.Use HttpCookiePair.toCookie and withXxx methods instead.java.util.Optional<java.lang.String>
getDomain()
Java APIjava.util.Optional<DateTime>
getExpires()
Java APIjava.util.Optional<java.lang.String>
getExtension()
Java APIjava.util.OptionalLong
getMaxAge()
Java APIjava.util.Optional<java.lang.String>
getPath()
Java APIjava.util.Optional<SameSite>
getSameSite()
Java APIboolean
httpOnly()
scala.Option<java.lang.Object>
maxAge()
java.lang.String
name()
static akka.parboiled2.CharPredicate
nameChars()
HttpCookiePair
pair()
Returns the name/value pair for this cookie, to be used inCookie
headers.scala.Option<java.lang.String>
path()
static akka.parboiled2.CharPredicate
pathOrExtChars()
int
productArity()
java.lang.Object
productElement(int n)
static akka.parboiled2.CharPredicate
rawValueChars()
<R extends Rendering>
Renderingrender(R r)
scala.Option<SameSite>
sameSite()
boolean
secure()
static scala.Option<scala.Tuple9<java.lang.String,java.lang.String,scala.Option<DateTime>,scala.Option<java.lang.Object>,scala.Option<java.lang.String>,scala.Option<java.lang.String>,java.lang.Object,java.lang.Object,scala.Option<java.lang.String>>>
unapply(HttpCookie cookie)
Deprecated.Pattern matching on HttpCookie is deprecated because of the big number of fields and potential future compatibility hazards.java.lang.String
value()
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 backslashHttpCookie
withDomain(java.lang.String domain)
Returns a copy of this HttpCookie instance with the given domain set.HttpCookie
withExpires(DateTime dateTime)
Java APIHttpCookie
withExpires(DateTime dateTime)
Scala APIHttpCookie
withExtension(java.lang.String extension)
Returns a copy of this HttpCookie instance with the given extension set.HttpCookie
withHttpOnly(boolean httpOnly)
Returns a copy of this HttpCookie instance with the given http-only flag set.HttpCookie
withMaxAge(long maxAge)
Returns a copy of this HttpCookie instance with the given max age set.HttpCookie
withName(java.lang.String name)
HttpCookie
withPath(java.lang.String path)
Returns a copy of this HttpCookie instance with the given path set.HttpCookie
withSameSite(SameSite sameSite)
Java APIHttpCookie
withSameSite(SameSite sameSite)
Scala APIHttpCookie
withSameSite(java.util.Optional<SameSite> sameSite)
Returns a copy of this HttpCookie instance with the given OptionalSameSite
set.HttpCookie
withSameSite(scala.Option<SameSite> sameSite)
HttpCookie
withSecure(boolean secure)
Returns a copy of this HttpCookie instance with the given secure flag set.HttpCookie
withValue(java.lang.String value)
-
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 Detail
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension, scala.Option<SameSite> sameSite)
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension)
Deprecated.Please use HttpCookie(name, value).withXxx(). Since 10.2.0.
-
-
Method Detail
-
apply
public static HttpCookie apply(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.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<java.lang.String,java.lang.String,scala.Option<DateTime>,scala.Option<java.lang.Object>,scala.Option<java.lang.String>,scala.Option<java.lang.String>,java.lang.Object,java.lang.Object,scala.Option<java.lang.String>>> unapply(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<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.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
public java.lang.String name()
- Specified by:
name
in classHttpCookie
-
value
public java.lang.String value()
- Specified by:
value
in classHttpCookie
-
expires
public scala.Option<DateTime> expires()
-
maxAge
public scala.Option<java.lang.Object> maxAge()
-
domain
public scala.Option<java.lang.String> domain()
-
path
public scala.Option<java.lang.String> path()
-
secure
public boolean secure()
- Specified by:
secure
in classHttpCookie
-
httpOnly
public boolean httpOnly()
- Specified by:
httpOnly
in classHttpCookie
-
extension
public scala.Option<java.lang.String> extension()
-
sameSite
public scala.Option<SameSite> sameSite()
-
copy
public HttpCookie copy(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension)
Deprecated.for binary compatibility. Since 10.2.0.
-
copy
public HttpCookie copy(java.lang.String name, java.lang.String value, scala.Option<DateTime> expires, scala.Option<java.lang.Object> maxAge, scala.Option<java.lang.String> domain, scala.Option<java.lang.String> path, boolean secure, boolean httpOnly, scala.Option<java.lang.String> extension, scala.Option<SameSite> sameSite)
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int n)
- Specified by:
productElement
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object that)
- Specified by:
canEqual
in interfacescala.Equals
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
pair
public HttpCookiePair pair()
Returns the name/value pair for this cookie, to be used inCookie
headers.- Specified by:
pair
in classHttpCookie
-
render
public <R extends Rendering> Rendering render(R r)
- Specified by:
render
in interfaceRenderable
-
getSameSite
public java.util.Optional<SameSite> getSameSite()
Java API- Specified by:
getSameSite
in classHttpCookie
-
getExtension
public java.util.Optional<java.lang.String> getExtension()
Java API- Specified by:
getExtension
in classHttpCookie
-
getPath
public java.util.Optional<java.lang.String> getPath()
Java API- Specified by:
getPath
in classHttpCookie
-
getDomain
public java.util.Optional<java.lang.String> getDomain()
Java API- Specified by:
getDomain
in classHttpCookie
-
getMaxAge
public java.util.OptionalLong getMaxAge()
Java API- Specified by:
getMaxAge
in classHttpCookie
-
getExpires
public java.util.Optional<DateTime> getExpires()
Java API- Specified by:
getExpires
in classHttpCookie
-
withName
public HttpCookie withName(java.lang.String name)
-
withValue
public HttpCookie withValue(java.lang.String value)
-
withExpires
public HttpCookie withExpires(DateTime dateTime)
Scala API
-
withExpires
public HttpCookie withExpires(DateTime dateTime)
Java API- Specified by:
withExpires
in classHttpCookie
-
withDomain
public HttpCookie withDomain(java.lang.String domain)
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given domain set.- Specified by:
withDomain
in classHttpCookie
-
withPath
public HttpCookie withPath(java.lang.String path)
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given path set.- Specified by:
withPath
in classHttpCookie
-
withMaxAge
public HttpCookie withMaxAge(long maxAge)
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given max age set.- Specified by:
withMaxAge
in classHttpCookie
-
withSecure
public HttpCookie withSecure(boolean secure)
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given secure flag set.- Specified by:
withSecure
in classHttpCookie
-
withHttpOnly
public HttpCookie withHttpOnly(boolean httpOnly)
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
public HttpCookie withSameSite(SameSite sameSite)
Scala API
-
withSameSite
public HttpCookie withSameSite(scala.Option<SameSite> sameSite)
-
withSameSite
public HttpCookie withSameSite(SameSite sameSite)
Java API- Specified by:
withSameSite
in classHttpCookie
-
withSameSite
public HttpCookie withSameSite(java.util.Optional<SameSite> sameSite)
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given OptionalSameSite
set.- Specified by:
withSameSite
in classHttpCookie
-
withExtension
public HttpCookie withExtension(java.lang.String extension)
Description copied from class:HttpCookie
Returns a copy of this HttpCookie instance with the given extension set.- Specified by:
withExtension
in classHttpCookie
-
-