public class EventCollectionDAO extends Object implements EventDAO
Data source backed by a collection of events.
Constructor and Description |
---|
EventCollectionDAO(Collection<? extends Event> evts)
Deprecated.
use
create(Collection) instead |
Modifier and Type | Method and Description |
---|---|
static EventDAO |
create(Collection<? extends Event> evts)
Create a new data source from a collection of events.
|
static EventDAO |
create(Event... evts)
Create a new data source from an array of events.
|
static EventDAO |
empty()
Empty event collection DAO.
|
static EventDAO |
fromStream(ObjectStream<Event> stream)
Create a new data source from a stream of events.
|
static EventDAO |
loadAndWrap(EventDAO eventDAO)
Create a new data source from an EventDAO.
|
ObjectStream<Event> |
streamEvents()
Stream all events.
|
<E extends Event> |
streamEvents(Class<E> type)
Stream all events of a given type.
|
<E extends Event> |
streamEvents(Class<E> type,
SortOrder order)
Stream all events of a given type in a specified order.
|
String |
toString() |
@Deprecated public EventCollectionDAO(Collection<? extends Event> evts)
create(Collection)
insteadConstruct a new data source from a collection of events.
evts
- The events to use.public static EventDAO empty()
Empty event collection DAO.
public static EventDAO create(Collection<? extends Event> evts)
Create a new data source from a collection of events.
evts
- The events collection to be used.public static EventDAO create(Event... evts)
Create a new data source from an array of events.
evts
- The events to be used.public static EventDAO fromStream(@WillClose ObjectStream<Event> stream)
Create a new data source from a stream of events.
stream
- The event stream to be used.public static EventDAO loadAndWrap(EventDAO eventDAO)
Create a new data source from an EventDAO.
eventDAO
- The EventDAO to be used.public ObjectStream<Event> streamEvents()
EventDAO
Stream all events.
streamEvents
in interface EventDAO
public <E extends Event> ObjectStream<E> streamEvents(Class<E> type)
EventDAO
Stream all events of a given type.
streamEvents
in interface EventDAO
type
- The event type.public <E extends Event> ObjectStream<E> streamEvents(Class<E> type, SortOrder order)
EventDAO
Stream all events of a given type in a specified order.
streamEvents
in interface EventDAO
type
- The event type.order
- The order.