Package com.exonum.binding.core.service
Class BlockCommittedEventImpl
java.lang.Object
com.exonum.binding.core.service.BlockCommittedEventImpl
- All Implemented Interfaces:
BlockCommittedEvent
public abstract class BlockCommittedEventImpl extends Object implements BlockCommittedEvent
-
Constructor Summary
Constructors Constructor Description BlockCommittedEventImpl() -
Method Summary
Modifier and Type Method Description abstract longgetHeight()Returns the current blockchain height, which is the height of the last committed block.abstract SnapshotgetSnapshot()Returns the current database snapshot.abstract OptionalIntgetValidatorId()If this node is a validator, returns its identifier.static BlockCommittedEventImplvalueOf(Snapshot snapshot, OptionalInt validatorId, long height)Creates a new block committed event.
-
Constructor Details
-
BlockCommittedEventImpl
public BlockCommittedEventImpl()
-
-
Method Details
-
valueOf
public static BlockCommittedEventImpl valueOf(Snapshot snapshot, OptionalInt validatorId, long height)Creates a new block committed event.- Parameters:
snapshot- a snapshot of the blockchain statevalidatorId- a validator id.OptionalInt.empty()if this node is not a validatorheight- the current blockchain height
-
getSnapshot
Description copied from interface:BlockCommittedEventReturns the current database snapshot. It is immutable and represents the database state as of the block at the current height.- Specified by:
getSnapshotin interfaceBlockCommittedEvent
-
getValidatorId
Description copied from interface:BlockCommittedEventIf this node is a validator, returns its identifier. If this node is an auditor, it will returnOptionalInt.empty().- Specified by:
getValidatorIdin interfaceBlockCommittedEvent
-
getHeight
public abstract long getHeight()Description copied from interface:BlockCommittedEventReturns the current blockchain height, which is the height of the last committed block.- Specified by:
getHeightin interfaceBlockCommittedEvent
-