Package com.exonum.binding.service
Class BlockCommittedEventImpl
- java.lang.Object
-
- com.exonum.binding.service.BlockCommittedEventImpl
-
- All Implemented Interfaces:
BlockCommittedEvent
public abstract class BlockCommittedEventImpl extends java.lang.Object implements BlockCommittedEvent
-
-
Constructor Summary
Constructors Constructor Description BlockCommittedEventImpl()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 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 java.util.OptionalIntgetValidatorId()If this node is a validator, returns its identifier.static BlockCommittedEventImplvalueOf(Snapshot snapshot, java.util.OptionalInt validatorId, long height)Creates a new block committed event.
-
-
-
Method Detail
-
valueOf
public static BlockCommittedEventImpl valueOf(Snapshot snapshot, java.util.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
public abstract Snapshot 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
public abstract java.util.OptionalInt 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
-
-