Interface Advisable<P extends Callback>

Type Parameters:
P - the type of the callback
All Known Subinterfaces:
Browser, MediaDevices, Navigation, Network, Permissions, Plugins

public interface Advisable<P extends Callback>
A common interface that all objects providing callbacks must implement.
  • Method Summary

    Modifier and Type
    Method
    Description
    <C extends P>
    Optional<C>
    get(Class<C> callbackClass)
    Returns an Optional that contains the callback of the given type or an empty Optional if there is no registered callback with the given type.
    <C extends P>
    C
    remove(Class<C> callbackClass)
    Removes a particular service callback.
    <C extends P>
    C
    set(Class<C> callbackClass, C callback)
    Sets a particular service callback.
  • Method Details

    • set

      <C extends P> C set(Class<C> callbackClass, C callback)
      Sets a particular service callback.

      Replaces the existing callback associated with the callbackClass, if any.

      Type Parameters:
      C - the callback type
      Parameters:
      callbackClass - the callback class
      callback - the callback object
      Returns:
      the previously configured callback
    • get

      <C extends P> Optional<C> get(Class<C> callbackClass)
      Returns an Optional that contains the callback of the given type or an empty Optional if there is no registered callback with the given type.
      Type Parameters:
      C - the callback type
      Parameters:
      callbackClass - the callback class
      Returns:
      an Optional that contains the callback of the given type
    • remove

      <C extends P> C remove(Class<C> callbackClass)
      Removes a particular service callback.
      Type Parameters:
      C - the callback type
      Parameters:
      callbackClass - the callback class
      Returns:
      the removed callback object