Package ghidra.framework.model
Class AbstractDomainObjectListenerBuilder<R extends DomainObjectChangeRecord,B extends AbstractDomainObjectListenerBuilder<R,B>>
java.lang.Object
ghidra.framework.model.AbstractDomainObjectListenerBuilder<R,B>
- Type Parameters:
R
- The DomainObjectChangeRecord typeB
- 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
DomainObjectListener
s. See
DomainObjectListenerBuilder
for full documentation.-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Sub-builder for collection eventTypes before eventually being association with a callback or callback with terminationclass
Sub-builder for collection eventTypes before eventually being associated with a consumer for records with those types -
Constructor Summary
ConstructorDescriptionAbstractDomainObjectListenerBuilder
(String name, Class<R> recordClass) Creates a builder with the given recordClass as the default record class -
Method Summary
Modifier and TypeMethodDescriptionAllows 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.build()
Builds and returns a new DomainObjectEventHandlerAllows for specifying multiple event types that for each record with one of the specified types, the follow on consumer will be called.getName()
Returns the name that will be associated with the domainObjectListener.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.protected abstract B
self()
<R2 extends DomainObjectChangeRecord,
B2 extends AbstractDomainObjectListenerBuilder<R2, B2>>
B2Allows for specifying a new record type that any follow on consumers will use for any defined "each" handlers.
-
Constructor Details
-
AbstractDomainObjectListenerBuilder
Creates a builder with the given recordClass as the default record class- Parameters:
name
- the name of the client class that created this builderrecordClass
- the class of event records consumers will be using in any calls that take a consumer
-
-
Method Details
-
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
-
ignoreWhen
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 withB2>> (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 typeB2
- 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
Builds and returns a new DomainObjectEventHandler- Returns:
- a new DomainObjectEventHandler from this builder
-