Class Cookies.CookieKey

java.lang.Object
org.attribyte.snook.Cookies.CookieKey
Enclosing class:
Cookies

public static class Cookies.CookieKey extends Object
A key that uniquely identifies a cookie.
  • Field Details

    • name

      public final String name
      The cookie name.
    • domain

      public final String domain
      The domain.
    • path

      public final String path
      The path.
  • Constructor Details

    • CookieKey

      public CookieKey(jakarta.servlet.http.Cookie cookie)
      Creates a cookie key from an existing cookie.
      Parameters:
      cookie - The cookie.
    • CookieKey

      public CookieKey(String name, String domain, String path)
      Creates a key.
      Parameters:
      name - The cookie name. Must not be null or empty.
      domain - The domain.
      path - The path.
      Throws:
      IllegalArgumentException - if name is null or empty.
    • CookieKey

      public CookieKey(String name)
      Creates a key that applies to any path for the current domain.
      Parameters:
      name - The cookie name.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • cookie

      public jakarta.servlet.http.Cookie cookie(String value)
      Creates a (mutable) cookie with this key.
      Parameters:
      value - The value.
      Returns:
      The cookie.