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
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 BlockchainDatagetSnapshot()Returns the current database snapshot for the executing service.abstract OptionalIntgetValidatorId()If this node is a validator, returns its identifier.static BlockCommittedEventImplvalueOf(BlockchainData snapshot, OptionalInt validatorId, long height)Creates a new block committed event.
-
-
-
Method Detail
-
valueOf
public static BlockCommittedEventImpl valueOf(BlockchainData 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
public abstract BlockchainData getSnapshot()
Description copied from interface:BlockCommittedEventReturns the current database snapshot for the executing service. It is immutable and represents the database state as of the block at the current height.- Specified by:
getSnapshotin interfaceBlockCommittedEvent
-
getValidatorId
public abstract 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
-
-