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 HttpCookieapply(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.booleancanEqual(java.lang.Object that)HttpCookiecopy(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.HttpCookiecopy(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.CharPredicatedomainChars()booleanequals(java.lang.Object obj)scala.Option<DateTime>expires()scala.Option<java.lang.String>extension()static HttpCookiefromPair(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.OptionalLonggetMaxAge()Java APIjava.util.Optional<java.lang.String>getPath()Java APIjava.util.Optional<SameSite>getSameSite()Java APIbooleanhttpOnly()scala.Option<java.lang.Object>maxAge()java.lang.Stringname()static akka.parboiled2.CharPredicatenameChars()HttpCookiePairpair()Returns the name/value pair for this cookie, to be used inCookieheaders.scala.Option<java.lang.String>path()static akka.parboiled2.CharPredicatepathOrExtChars()intproductArity()java.lang.ObjectproductElement(int n)static akka.parboiled2.CharPredicaterawValueChars()<R extends Rendering>
Renderingrender(R r)scala.Option<SameSite>sameSite()booleansecure()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.Stringvalue()static akka.parboiled2.CharPredicatevalueChars()http://tools.ietf.org/html/rfc6265#section-4.1.1 US-ASCII characters excluding CTLs, whitespace DQUOTE, comma, semicolon, and backslashHttpCookiewithDomain(java.lang.String domain)Returns a copy of this HttpCookie instance with the given domain set.HttpCookiewithExpires(DateTime dateTime)Java APIHttpCookiewithExpires(DateTime dateTime)Scala APIHttpCookiewithExtension(java.lang.String extension)Returns a copy of this HttpCookie instance with the given extension set.HttpCookiewithHttpOnly(boolean httpOnly)Returns a copy of this HttpCookie instance with the given http-only flag set.HttpCookiewithMaxAge(long maxAge)Returns a copy of this HttpCookie instance with the given max age set.HttpCookiewithName(java.lang.String name)HttpCookiewithPath(java.lang.String path)Returns a copy of this HttpCookie instance with the given path set.HttpCookiewithSameSite(SameSite sameSite)Java APIHttpCookiewithSameSite(SameSite sameSite)Scala APIHttpCookiewithSameSite(java.util.Optional<SameSite> sameSite)Returns a copy of this HttpCookie instance with the given OptionalSameSiteset.HttpCookiewithSameSite(scala.Option<SameSite> sameSite)HttpCookiewithSecure(boolean secure)Returns a copy of this HttpCookie instance with the given secure flag set.HttpCookiewithValue(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:
namein classHttpCookie
-
value
public java.lang.String value()
- Specified by:
valuein 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:
securein classHttpCookie
-
httpOnly
public boolean httpOnly()
- Specified by:
httpOnlyin 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:
productArityin interfacescala.Product
-
productElement
public java.lang.Object productElement(int n)
- Specified by:
productElementin interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object that)
- Specified by:
canEqualin interfacescala.Equals
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfacescala.Equals- Overrides:
equalsin classjava.lang.Object
-
pair
public HttpCookiePair pair()
Returns the name/value pair for this cookie, to be used inCookieheaders.- Specified by:
pairin classHttpCookie
-
render
public <R extends Rendering> Rendering render(R r)
- Specified by:
renderin interfaceRenderable
-
getSameSite
public java.util.Optional<SameSite> getSameSite()
Java API- Specified by:
getSameSitein classHttpCookie
-
getExtension
public java.util.Optional<java.lang.String> getExtension()
Java API- Specified by:
getExtensionin classHttpCookie
-
getPath
public java.util.Optional<java.lang.String> getPath()
Java API- Specified by:
getPathin classHttpCookie
-
getDomain
public java.util.Optional<java.lang.String> getDomain()
Java API- Specified by:
getDomainin classHttpCookie
-
getMaxAge
public java.util.OptionalLong getMaxAge()
Java API- Specified by:
getMaxAgein classHttpCookie
-
getExpires
public java.util.Optional<DateTime> getExpires()
Java API- Specified by:
getExpiresin 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:
withExpiresin classHttpCookie
-
withDomain
public HttpCookie withDomain(java.lang.String domain)
Description copied from class:HttpCookieReturns a copy of this HttpCookie instance with the given domain set.- Specified by:
withDomainin classHttpCookie
-
withPath
public HttpCookie withPath(java.lang.String path)
Description copied from class:HttpCookieReturns a copy of this HttpCookie instance with the given path set.- Specified by:
withPathin classHttpCookie
-
withMaxAge
public HttpCookie withMaxAge(long maxAge)
Description copied from class:HttpCookieReturns a copy of this HttpCookie instance with the given max age set.- Specified by:
withMaxAgein classHttpCookie
-
withSecure
public HttpCookie withSecure(boolean secure)
Description copied from class:HttpCookieReturns a copy of this HttpCookie instance with the given secure flag set.- Specified by:
withSecurein classHttpCookie
-
withHttpOnly
public HttpCookie withHttpOnly(boolean httpOnly)
Description copied from class:HttpCookieReturns a copy of this HttpCookie instance with the given http-only flag set.- Specified by:
withHttpOnlyin 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:
withSameSitein classHttpCookie
-
withSameSite
public HttpCookie withSameSite(java.util.Optional<SameSite> sameSite)
Description copied from class:HttpCookieReturns a copy of this HttpCookie instance with the given OptionalSameSiteset.- Specified by:
withSameSitein classHttpCookie
-
withExtension
public HttpCookie withExtension(java.lang.String extension)
Description copied from class:HttpCookieReturns a copy of this HttpCookie instance with the given extension set.- Specified by:
withExtensionin classHttpCookie
-
-