java.lang.Object
org.apache.pekko.http.javadsl.model.headers.HttpCookie
Direct Known Subclasses:
HttpCookie

@DoNotInherit public abstract class HttpCookie extends Object
  • Constructor Details

    • HttpCookie

      public HttpCookie()
  • Method Details

    • name

      public abstract String name()
    • value

      public abstract String value()
    • pair

      public abstract HttpCookiePair pair()
    • getExpires

      public abstract Optional<DateTime> getExpires()
    • getMaxAge

      public abstract OptionalLong getMaxAge()
    • getDomain

      public abstract Optional<String> getDomain()
    • getPath

      public abstract Optional<String> getPath()
    • secure

      public abstract boolean secure()
    • httpOnly

      public abstract boolean httpOnly()
    • getExtension

      public abstract Optional<String> getExtension()
    • getSameSite

      public abstract Optional<SameSite> getSameSite()
    • create

      public static HttpCookie create(String name, String value)
    • create

      public static HttpCookie create(String name, String value, Optional<String> domain, Optional<String> path)
    • create

      public static HttpCookie create(String name, String value, Optional<DateTime> expires, OptionalLong maxAge, Optional<String> domain, Optional<String> path, boolean secure, boolean httpOnly, Optional<String> extension, Optional<SameSite> sameSite)
    • withExpires

      public abstract HttpCookie withExpires(DateTime dateTime)
      Returns a copy of this HttpCookie instance with the given expiration set.
    • withMaxAge

      public abstract HttpCookie withMaxAge(long maxAge)
      Returns a copy of this HttpCookie instance with the given max age set.
    • withDomain

      public abstract HttpCookie withDomain(String domain)
      Returns a copy of this HttpCookie instance with the given domain set.
    • withPath

      public abstract HttpCookie withPath(String path)
      Returns a copy of this HttpCookie instance with the given path set.
    • withSecure

      public abstract HttpCookie withSecure(boolean secure)
      Returns a copy of this HttpCookie instance with the given secure flag set.
    • withHttpOnly

      public abstract HttpCookie withHttpOnly(boolean httpOnly)
      Returns a copy of this HttpCookie instance with the given http-only flag set.
    • withSameSite

      public abstract HttpCookie withSameSite(SameSite sameSite)
      Returns a copy of this HttpCookie instance with the given SameSite set.
    • withSameSite

      public abstract HttpCookie withSameSite(Optional<SameSite> sameSite)
      Returns a copy of this HttpCookie instance with the given Optional SameSite set.
    • withExtension

      public abstract HttpCookie withExtension(String extension)
      Returns a copy of this HttpCookie instance with the given extension set.