Class CookieJar.Builder<B extends CookieJar.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
CookieJarDB.Builder, CookieJarText.Builder
Enclosing class:
CookieJar

public static class CookieJar.Builder<B extends CookieJar.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public CookieJar build()
      Finish building the CookieJar object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to CookieJar.
      Overrides:
      build in class GObject.Builder<B extends CookieJar.Builder<B>>
      Returns:
      a new instance of CookieJar with the properties that were set in the Builder object.
    • setAcceptPolicy

      public B setAcceptPolicy(CookieJarAcceptPolicy acceptPolicy)
      The policy the jar should follow to accept or reject cookies.
      Parameters:
      acceptPolicy - the value for the accept-policy property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setReadOnly

      public B setReadOnly(boolean readOnly)
      Whether or not the cookie jar is read-only.
      Parameters:
      readOnly - the value for the read-only property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onChanged

      public B onChanged(CookieJar.ChangedCallback handler)

      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.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: