Class PropertySequencingPolicy.Builder<T,K>
java.lang.Object
org.axonframework.eventhandling.async.PropertySequencingPolicy.Builder<T,K>
- Type Parameters:
T- the type of the supported event payloadsK- the type of the extracted property
- Enclosing class:
PropertySequencingPolicy<T,K>
Builder class to instantiate a
PropertySequencingPolicy.
Upon initialization of this builder, the following fields are defaulted:
- The
fallbackSequencingPolicydefaults to an exception raising sequencing policy.
- The
payloadClasswhich defines the supported type of event message payload. - The
propertyExtractorwhich is applied to the payload and extract the sequence identifier. - The
fallbackSequencingPolicywhich defines the behaviour in case of an unsupported event payload.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aPropertySequencingPolicyas specified through this Builder.fallbackSequencingPolicy(SequencingPolicy<EventMessage> fallbackSequencingPolicy) Defines the fallback sequencing policy, the sequencing policy which is applied if the event message payload is not of a supported type.propertyExtractor(Function<T, K> propertyExtractor) Defines the property extractor, a function which is applied to the event message payload to extract the sequence identifier.propertyName(String propertyName) Defines the name of the property to be extracted as sequence identifier.
-
Method Details
-
propertyExtractor
Defines the property extractor, a function which is applied to the event message payload to extract the sequence identifier. This is usually some kind of getter reference.- Parameters:
propertyExtractor- The new property extractor.- Returns:
- The current Builder instance, for fluent interfacing
-
propertyName
Defines the name of the property to be extracted as sequence identifier. This can be used as an alternative topropertyExtractor(Function).- Parameters:
propertyName- The new name of the property to be extracted.- Returns:
- The current Builder instance, for fluent interfacing
-
fallbackSequencingPolicy
public PropertySequencingPolicy.Builder<T,K> fallbackSequencingPolicy(SequencingPolicy<EventMessage> fallbackSequencingPolicy) Defines the fallback sequencing policy, the sequencing policy which is applied if the event message payload is not of a supported type. Defaults to a policy that simply raises an exception.- Parameters:
fallbackSequencingPolicy- The new fallback sequencing policy.- Returns:
- The current Builder instance, for fluent interfacing
-
build
Initializes aPropertySequencingPolicyas specified through this Builder.- Returns:
- a
PropertySequencingPolicyas specified through this Builder
-