Package ej.hoka.http

Class Cookie


  • public class Cookie
    extends java.lang.Object
    Web Cookie.
    • Method Detail

      • builder

        public static Cookie.Builder builder()
        Configures and builds a cookie.
        Returns:
        builder instance to continue configuring the cookie or building the instance by calling Cookie.Builder.build()
      • getName

        @Nullable
        public java.lang.String getName()
        Gets the name.
        Returns:
        the name.
      • getValue

        @Nullable
        public java.lang.String getValue()
        Gets the value.
        Returns:
        the value.
      • getExpires

        @Nullable
        public java.util.Date getExpires()
        Gets the expiration date.
        Returns:
        the expiration date (may be null).
      • getDomain

        @Nullable
        public java.lang.String getDomain()
        Gets the domain.
        Returns:
        the domain (may be null).
      • getPath

        @Nullable
        public java.lang.String getPath()
        Gets the path.
        Returns:
        the path (may be null).
      • getMaxAge

        public int getMaxAge()
        Gets the max age of the cookie.
        Returns:
        the maxAge.
      • isSecure

        public boolean isSecure()
        Checks if the cookie is secured.
        Returns:
        true if the cookie is secured, false otherwise.
      • isHttpOnly

        public boolean isHttpOnly()
        Checks if the cookie is for http only.
        Returns:
        true if the cookie is for http only, false otherwise.
      • getSameSite

        @Nullable
        public Cookie.SameSite getSameSite()
        Gets the same site policy.
        Returns:
        the same site policy value (may be null).
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object