Class AbstractDomainObjectListenerBuilder<R extends DomainObjectChangeRecord,B extends AbstractDomainObjectListenerBuilder<R,B>>

java.lang.Object
ghidra.framework.model.AbstractDomainObjectListenerBuilder<R,B>
Type Parameters:
R - The DomainObjectChangeRecord type
B - The AbstractDomainObjectListeBuilder type (the only difference is R, the record type)
Direct Known Subclasses:
DomainObjectListenerBuilder

public abstract class AbstractDomainObjectListenerBuilder<R extends DomainObjectChangeRecord,B extends AbstractDomainObjectListenerBuilder<R,B>> extends Object
Base class for creating a compact and efficient DomainObjectListeners. See DomainObjectListenerBuilder for full documentation.
  • Constructor Details

    • AbstractDomainObjectListenerBuilder

      public AbstractDomainObjectListenerBuilder(String name, Class<R> recordClass)
      Creates a builder with the given recordClass as the default record class
      Parameters:
      name - the name of the client class that created this builder
      recordClass - the class of event records consumers will be using in any calls that take a consumer
  • Method Details

    • getName

      public String getName()
      Returns the name that will be associated with the domainObjectListener. this is for debugging purposes so that you can tell where this listener came from (since it is no longer implemented by the client class)
      Returns:
      the name assigned to this builder (and ultimately the listener)
    • self

      protected abstract B self()
    • ignoreWhen

      public B ignoreWhen(BooleanSupplier supplier)
      Sets a boolean supplier that can be checked to see if the client is in a state where they don't want events to be processed at this time.
      Parameters:
      supplier - the boolean supplier that if returns true, events are not processed
      Returns:
      this builder (for chaining)
    • any

      Allows for specifying multiple event types that if the event contains any records with and of the given types, then a callback or callback with terminate will be triggered, depending on if the next builder operation is either a call or terminate respectively.
      Parameters:
      eventTypes - the list of events to trigger on
      Returns:
      A sub-builder for specifying the call or call with terminate
    • each

      Allows for specifying multiple event types that for each record with one of the specified types, the follow on consumer will be called.
      Parameters:
      eventTypes - the list of events to trigger on
      Returns:
      A sub-builder for specifying the consumer to be used for records with any of these types
    • with

      public <R2 extends DomainObjectChangeRecord, B2 extends AbstractDomainObjectListenerBuilder<R2, B2>> B2 with(Class<R2> clazz)
      Allows for specifying a new record type that any follow on consumers will use for any defined "each" handlers.
      Type Parameters:
      R2 - the new record type
      B2 - the new builder type that expects consumers of the new record type
      Parameters:
      clazz - the class of the new record type
      Returns:
      this builder with its consumer record type changed
    • build

      public DomainObjectListener build()
      Builds and returns a new DomainObjectEventHandler
      Returns:
      a new DomainObjectEventHandler from this builder