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 payloads
K - the type of the extracted property
Enclosing class:
PropertySequencingPolicy<T,K>

public static final class PropertySequencingPolicy.Builder<T,K> extends Object
Builder class to instantiate a PropertySequencingPolicy.

Upon initialization of this builder, the following fields are defaulted:

  • The fallbackSequencingPolicy defaults to an exception raising sequencing policy.
The following fields of this builder are hard requirements and as such should be provided:
  • The payloadClass which defines the supported type of event message payload.
  • The propertyExtractor which is applied to the payload and extract the sequence identifier.
  • The fallbackSequencingPolicy which defines the behaviour in case of an unsupported event payload.
  • Method Details

    • propertyExtractor

      public PropertySequencingPolicy.Builder<T,K> propertyExtractor(Function<T,K> 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

      public PropertySequencingPolicy.Builder<T,K> propertyName(String propertyName)
      Defines the name of the property to be extracted as sequence identifier. This can be used as an alternative to propertyExtractor(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

      public PropertySequencingPolicy<T,K> build()
      Initializes a PropertySequencingPolicy as specified through this Builder.
      Returns:
      a PropertySequencingPolicy as specified through this Builder