Class CookieSet


  • @OpenApi
    public final class CookieSet
    extends java.lang.Object
    Support class for storing cookies and retrieving them by representation class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Cookie cookie)
      Add a new cookie to the set.
      Cookie getCookie​(java.lang.Class clazz)
      Get a cookie.
      void remove​(Cookie cookie)
      Remove a cookie from the set.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • add

        @OpenApi
        public void add​(Cookie cookie)
        Add a new cookie to the set. If a cookie of the same actual (not representation!) class is already there, it is replaced.

        Cookies inserted earlier are given preference during lookup, in case a supplied representation class matches more than one cookie in the set.

        Parameters:
        cookie - cookie to add
      • remove

        @OpenApi
        public void remove​(Cookie cookie)
        Remove a cookie from the set.
        Parameters:
        cookie - the cookie to remove
      • getCookie

        @CheckForNull
        @OpenApi
        public Cookie getCookie​(java.lang.Class clazz)
        Get a cookie.
        Parameters:
        clazz - the representation class
        Returns:
        a cookie assignable to the representation class, or null if there is none