Class CookieSet

java.lang.Object
com.nomagic.magicdraw.cookies.CookieSet

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Cookie cookie)
    Add a new cookie to the set.
    void
    add(Class[] cookieClasses, com.nomagic.magicdraw.cookies.CookieSet.Factory factory)
    Registers a Factory for given cookie classes
    void
    add(Class cookieClass, com.nomagic.magicdraw.cookies.CookieSet.Factory factory)
    Registers a Factory for given cookie class
    void
    Add a listener to changes in the cookie set.
    Get a cookie.
    void
    remove(Cookie cookie)
    Remove a cookie from the set.
    void
    remove(Class[] cookieClasses, com.nomagic.magicdraw.cookies.CookieSet.Factory factory)
    Unregisters a Factory for given cookie classes
    void
    remove(Class cookieClass, com.nomagic.magicdraw.cookies.CookieSet.Factory factory)
    Unregisters a Factory for given cookie class
    void
    Remove a listener to changes in the cookie set.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CookieSet

      public CookieSet()
  • Method Details

    • 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(Class clazz)
      Get a cookie.
      Parameters:
      clazz - the representation class
      Returns:
      a cookie assignable to the representation class, or null if there is none
    • addChangeListener

      public void addChangeListener(ChangeListener l)
      Add a listener to changes in the cookie set.
      Parameters:
      l - the listener to add
    • removeChangeListener

      public void removeChangeListener(ChangeListener l)
      Remove a listener to changes in the cookie set.
      Parameters:
      l - the listener to remove
    • add

      public void add(Class cookieClass, com.nomagic.magicdraw.cookies.CookieSet.Factory factory)
      Registers a Factory for given cookie class
    • add

      public void add(Class[] cookieClasses, com.nomagic.magicdraw.cookies.CookieSet.Factory factory)
      Registers a Factory for given cookie classes
    • remove

      public void remove(Class cookieClass, com.nomagic.magicdraw.cookies.CookieSet.Factory factory)
      Unregisters a Factory for given cookie class
      Since:
      2.6
    • remove

      public void remove(Class[] cookieClasses, com.nomagic.magicdraw.cookies.CookieSet.Factory factory)
      Unregisters a Factory for given cookie classes
      Since:
      2.6