Interface LedgerEntries

  • All Superinterfaces:
    java.lang.AutoCloseable, java.lang.Iterable<LedgerEntry>
    All Known Implementing Classes:
    LedgerEntriesImpl

    public interface LedgerEntries
    extends java.lang.AutoCloseable, java.lang.Iterable<LedgerEntry>
    Interface to wrap a sequence of entries.
    Since:
    4.6
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Close to release the resources held by this instance.
      LedgerEntry getEntry​(long entryId)
      Gets a specific LedgerEntry by entryId.
      java.util.Iterator<LedgerEntry> iterator()
      Get an iterator over all the ledger entries contained in the LedgerEntries object.
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • getEntry

        LedgerEntry getEntry​(long entryId)
        Gets a specific LedgerEntry by entryId.
        Parameters:
        entryId - the LedgerEntry id
        Returns:
        the LedgerEntry, null if no LedgerEntry with such entryId
      • iterator

        java.util.Iterator<LedgerEntry> iterator()
        Get an iterator over all the ledger entries contained in the LedgerEntries object.

        Calling this method does not modify the reference count of the ByteBuf in the returned LedgerEntry objects. The caller who calls iterator() should make sure that they do not call ByteBuf.release() on the LedgerEntry objects to avoid a double free. All reference counts will be decremented when the containing LedgerEntries object is closed via close().

        Specified by:
        iterator in interface java.lang.Iterable<LedgerEntry>
        Returns:
        an iterator of LedgerEntry objects
      • close

        void close()
        Close to release the resources held by this instance.
        Specified by:
        close in interface java.lang.AutoCloseable