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 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)
  • 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

      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, 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