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 Details

    • 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, scala.Option<SameSite> sameSite)
    • 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,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. 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

      public String name()
      Specified by:
      name in class HttpCookie
    • value

      public String value()
      Specified by:
      value in class HttpCookie
    • expires

      public scala.Option<DateTime> expires()
    • maxAge

      public scala.Option<Object> maxAge()
    • domain

      public scala.Option<String> domain()
    • path

      public scala.Option<String> path()
    • secure

      public boolean secure()
      Specified by:
      secure in class HttpCookie
    • httpOnly

      public boolean httpOnly()
      Specified by:
      httpOnly in class HttpCookie
    • extension

      public scala.Option<String> extension()
    • sameSite

      public scala.Option<SameSite> 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

      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, scala.Option<SameSite> sameSite)
    • productArity

      public int productArity()
      Specified by:
      productArity in interface scala.Product
    • productElement

      public Object productElement(int n)
      Specified by:
      productElement in interface scala.Product
    • canEqual

      public boolean canEqual(Object that)
      Specified by:
      canEqual in interface scala.Equals
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface scala.Equals
      Overrides:
      equals in class Object
    • pair

      public HttpCookiePair pair()
      Returns the name/value pair for this cookie, to be used in Cookie headers.
      Specified by:
      pair in class HttpCookie
    • render

      public <R extends Rendering> Rendering render(R r)
      Specified by:
      render in interface Renderable
    • getSameSite

      public Optional<SameSite> getSameSite()
      Java API
      Specified by:
      getSameSite in class HttpCookie
    • getExtension

      public Optional<String> getExtension()
      Java API
      Specified by:
      getExtension in class HttpCookie
    • getPath

      public Optional<String> getPath()
      Java API
      Specified by:
      getPath in class HttpCookie
    • getDomain

      public Optional<String> getDomain()
      Java API
      Specified by:
      getDomain in class HttpCookie
    • getMaxAge

      public OptionalLong getMaxAge()
      Java API
      Specified by:
      getMaxAge in class HttpCookie
    • getExpires

      public Optional<DateTime> getExpires()
      Java API
      Specified by:
      getExpires in class HttpCookie
    • withName

      public HttpCookie withName(String name)
    • withValue

      public HttpCookie withValue(String value)
    • withExpires

      public HttpCookie withExpires(DateTime dateTime)
      Scala API
    • withExpires

      public HttpCookie withExpires(DateTime dateTime)
      Java API
      Specified by:
      withExpires in class HttpCookie
    • withDomain

      public HttpCookie withDomain(String domain)
      Description copied from class: HttpCookie
      Returns a copy of this HttpCookie instance with the given domain set.
      Specified by:
      withDomain in class HttpCookie
    • withPath

      public HttpCookie withPath(String path)
      Description copied from class: HttpCookie
      Returns a copy of this HttpCookie instance with the given path set.
      Specified by:
      withPath in class HttpCookie
    • 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 class HttpCookie
    • 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 class HttpCookie
    • 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 class HttpCookie
    • 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 class HttpCookie
    • withSameSite

      public HttpCookie withSameSite(Optional<SameSite> sameSite)
      Description copied from class: HttpCookie
      Returns a copy of this HttpCookie instance with the given Optional SameSite set.
      Specified by:
      withSameSite in class HttpCookie
    • withExtension

      public HttpCookie withExtension(String extension)
      Description copied from class: HttpCookie
      Returns a copy of this HttpCookie instance with the given extension set.
      Specified by:
      withExtension in class HttpCookie