public static final class EventEnricher.Builder extends EnricherBuilder<io.spine.base.EventMessage,io.spine.core.EventContext,EventEnricher.Builder>
EventEnricher
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
<M extends io.spine.base.EventMessage,R extends com.google.protobuf.Message> |
add(java.lang.Class<M> eventClassOrInterface,
java.lang.Class<R> enrichmentClass,
EventEnrichmentFn<M,R> func)
Adds event enrichment function to the builder.
|
EventEnricher |
build()
Creates a new
Enricher . |
doAdd, remove
@CanIgnoreReturnValue public <M extends io.spine.base.EventMessage,R extends com.google.protobuf.Message> EventEnricher.Builder add(java.lang.Class<M> eventClassOrInterface, java.lang.Class<R> enrichmentClass, EventEnrichmentFn<M,R> func)
M
- the type of the event messageR
- the type of the enrichment message produced by the functioneventClassOrInterface
- the class or common interface of the events the passed function enrichesenrichmentClass
- the class of the enrichments the passed function producesfunc
- the enrichment functionthis
builderjava.lang.IllegalArgumentException
- if the builder already contains a function which produces instances of
enrichmentClass
for the passed class or interface of events, or for
its super-interface, or a sub-interface, or a sub-classEnricherBuilder.remove(Class, Class)
public EventEnricher build()
EnricherBuilder
Enricher
.build
in class EnricherBuilder<io.spine.base.EventMessage,io.spine.core.EventContext,EventEnricher.Builder>