Class PagingContext

  • All Implemented Interfaces:
    java.io.Serializable

    public class PagingContext
    extends java.lang.Object
    implements java.io.Serializable
    Data structure which keeps track of all ids which are associated with the latest timestamp. As ids are added (add(long, Long)) to the context, if the time for the id is later than the previous latest time, the set reinitialized. Any ids with a the same timestamp as the current latest time is added to the set of ids. Ids with earlier timestamps are ignored.

    This data structure is necessary to handle the case when a paging request is fulfilled within a series of events with the same timestamp. The context allows the API to resume the page at the proper location within the timestamp.

    See Also:
    Serialized Form
    • Constructor Detail

      • PagingContext

        public PagingContext()
    • Method Detail

      • getTimestamp

        public long getTimestamp()
      • getIds

        public java.util.HashSet<java.lang.Long> getIds()
      • contains

        public boolean contains​(long id)
      • add

        public void add​(long t,
                        java.lang.Long id)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object