Class NotificationFactory

java.lang.Object
com.reallifedeveloper.common.application.notification.NotificationFactory

public final class NotificationFactory extends Object
A factory for Notifications.
Author:
RealLifeDeveloper
  • Method Details

    • instance

      public static NotificationFactory instance(EventStore eventStore)
      Gives an instance of the factory that uses the given EventStore to create Notifications.
      Parameters:
      eventStore - the EventStore to use
      Returns:
      a NotificationFactory instance
    • fromStoredEvent

      public Notification fromStoredEvent(StoredEvent storedEvent)
      Creates a new Notification for the given StoredEvent.
      Parameters:
      storedEvent - the stored event for which to create a Notification
      Returns:
      a new Notification for the stored event
    • fromStoredEvents

      public List<Notification> fromStoredEvents(List<StoredEvent> storedEvents)
      Creates new Notifications for the given StoredEvents.
      Parameters:
      storedEvents - a list with the stored events for which to create Notifications
      Returns:
      a list of Notifications for the stored events