Class LedgerEntriesImpl
- java.lang.Object
- 
- org.apache.bookkeeper.client.impl.LedgerEntriesImpl
 
- 
- All Implemented Interfaces:
- java.lang.AutoCloseable,- java.lang.Iterable<LedgerEntry>,- LedgerEntries
 
 public class LedgerEntriesImpl extends java.lang.Object implements LedgerEntries Ledger entries implementation. It is a simple wrap of a list of ledger entries.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close to release the resources held by this instance.static LedgerEntriesImplcreate(java.util.List<LedgerEntry> entries)Create ledger entries.LedgerEntrygetEntry(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.
 
- 
- 
- 
Method Detail- 
createpublic static LedgerEntriesImpl create(java.util.List<LedgerEntry> entries) Create ledger entries.- Parameters:
- entries- the entries with ordering
- Returns:
- the LedgerEntriesImpl
 
 - 
getEntrypublic LedgerEntry getEntry(long entryId) Gets a specific LedgerEntry by entryId.- Specified by:
- getEntryin interface- LedgerEntries
- Parameters:
- entryId- the LedgerEntry id
- Returns:
- the LedgerEntry, null if no LedgerEntry with such entryId
 
 - 
iteratorpublic 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 LedgerEntries.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 viaLedgerEntries.close().- Specified by:
- iteratorin interface- java.lang.Iterable<LedgerEntry>
- Specified by:
- iteratorin interface- LedgerEntries
- Returns:
- an iterator of LedgerEntry objects
 
 - 
closepublic void close() Description copied from interface:LedgerEntriesClose to release the resources held by this instance.- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- LedgerEntries
 
 
- 
 
-