Class CompositeEventList<T>

java.lang.Object
org.oddjob.events.CompositeEventList<T>
Type Parameters:
T - The type of the events being combined.
All Implemented Interfaces:
CompositeEvent<T>, InstantEvent<T>

public class CompositeEventList<T> extends Object implements CompositeEvent<T>
An CompositeEvent created from some other events. The event of this event is youngest event of the composites. The time of this event is that of the youngest event.
  • Constructor Details

    • CompositeEventList

      public CompositeEventList(InstantEvent<? extends T>... events)
  • Method Details

    • getOf

      public T getOf()
      Description copied from interface: InstantEvent
      Get the underlying event or trigger. Will not be null.
      Specified by:
      getOf in interface InstantEvent<T>
      Returns:
      The event/trigger.
    • getEvents

      public InstantEvent<? extends T> getEvents(int index)
      Description copied from interface: CompositeEvent
      Get the event in the combination at the given index.
      Specified by:
      getEvents in interface CompositeEvent<T>
      Parameters:
      index - The index.
      Returns:
      The event.
    • getTime

      public Instant getTime()
      Description copied from interface: InstantEvent
      Get the UTC time of the event.
      Specified by:
      getTime in interface InstantEvent<T>
      Returns:
      The time.
    • getCount

      public int getCount()
      Description copied from interface: CompositeEvent
      Get the number of events that have been combined.
      Specified by:
      getCount in interface CompositeEvent<T>
      Returns:
      The number of events.
    • getOfs

      public List<T> getOfs()
      Description copied from interface: CompositeEvent
      Get all the ofs from all the events in this composite and it's children.
      Specified by:
      getOfs in interface CompositeEvent<T>
      Returns:
      A list of all the ofs.
    • stream

      public Stream<InstantEvent<? extends T>> stream()
      Description copied from interface: CompositeEvent
      Return the combined events as a stream.
      Specified by:
      stream in interface CompositeEvent<T>
      Returns:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object