Class 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 API
      java.util.Optional<DateTime> getExpires()
      Java API
      java.util.Optional<java.lang.String> getExtension()
      Java API
      java.util.OptionalLong getMaxAge()
      Java API
      java.util.Optional<java.lang.String> getPath()
      Java API
      java.util.Optional<SameSite> getSameSite()
      Java API
      boolean 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 in Cookie 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>
      Rendering
      render​(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 backslash
      HttpCookie withDomain​(java.lang.String domain)
      Returns a copy of this HttpCookie instance with the given domain set.
      HttpCookie withExpires​(DateTime dateTime)
      Java API
      HttpCookie withExpires​(DateTime dateTime)
      Scala API
      HttpCookie 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 API
      HttpCookie withSameSite​(SameSite sameSite)
      Scala API
      HttpCookie withSameSite​(java.util.Optional<SameSite> sameSite)
      Returns a copy of this HttpCookie instance with the given Optional SameSite 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 java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface scala.Product

        productElementName, productElementNames, productIterator, productPrefix
    • 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 class HttpCookie
      • value

        public java.lang.String value()
        Specified by:
        value in class HttpCookie
      • 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()
      • 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 interface scala.Product
      • productElement

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

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

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object
      • getExtension

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

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

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

        public java.util.OptionalLong getMaxAge()
        Java API
        Specified by:
        getMaxAge in class HttpCookie
      • withName

        public HttpCookie withName​(java.lang.String name)
      • withValue

        public HttpCookie withValue​(java.lang.String value)
      • 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 class HttpCookie
      • 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 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
      • 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 class HttpCookie