Interface CookieJar.ChangedCallback

All Superinterfaces:
FunctionPointer
Enclosing class:
CookieJar
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface CookieJar.ChangedCallback extends FunctionPointer

Functional interface declaration of the ChangedCallback callback.

See Also:
  • Method Details

    • run

      void run(@Nullable Cookie oldCookie, @Nullable Cookie newCookie)

      Emitted when jar changes.

      If a cookie has been added, newCookie will contain the newly-added cookie and oldCookie will be null. If a cookie has been deleted, oldCookie will contain the to-be-deleted cookie and newCookie will be null. If a cookie has been changed, oldCookie will contain its old value, and newCookie its new value.

    • upcall

      default void upcall(MemorySegment sourceCookieJar, MemorySegment oldCookie, MemorySegment newCookie)
      The upcall method is called from native code. The parameters are marshaled and run(Cookie, Cookie) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer