Class EventStreamUtils

java.lang.Object
org.axonframework.eventsourcing.EventStreamUtils

public abstract class EventStreamUtils extends Object
Utility class for dealing with event streams.
Since:
4.0
Author:
Steven van Beelen
  • Method Details

    • upcastAndDeserializeDomainEvents

      public static DomainEventStream upcastAndDeserializeDomainEvents(Stream<? extends DomainEventData<?>> eventEntryStream, Serializer serializer, EventUpcaster upcasterChain)
      Upcasts and deserializes the given eventEntryStream using the given serializer and upcasterChain.

      The list of events returned contains lazy deserializing events for optimization purposes. Events represented with unknown classes are ignored if skipUnknownTypes is true

      Parameters:
      eventEntryStream - the stream of entries containing the data of the serialized event
      serializer - the serializer to deserialize the event with
      upcasterChain - the chain containing the upcasters to upcast the events with
      Returns:
      a stream of lazy deserializing events
    • asStream

      public static Stream<? extends DomainEventMessage<?>> asStream(DomainEventStream domainEventStream)
      Convert the given domainEventStream to a regular java Stream of domain event messages.
      Parameters:
      domainEventStream - the input DomainEventStream
      Returns:
      the output Stream after conversion