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 long
getHeight()
Returns the current blockchain height, which is the height of the last committed block.abstract Snapshot
getSnapshot()
Returns the current database snapshot.abstract OptionalInt
getValidatorId()
If this node is a validator, returns its identifier.static BlockCommittedEventImpl
valueOf(Snapshot snapshot, OptionalInt validatorId, long height)
Creates a new block committed event.
-
-
-
Method Detail
-
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
public abstract Snapshot getSnapshot()
Description copied from interface:BlockCommittedEvent
Returns the current database snapshot. It is immutable and represents the database state as of the block at the current height.- Specified by:
getSnapshot
in interfaceBlockCommittedEvent
-
getValidatorId
public abstract OptionalInt getValidatorId()
Description copied from interface:BlockCommittedEvent
If this node is a validator, returns its identifier. If this node is an auditor, it will returnOptionalInt.empty()
.- Specified by:
getValidatorId
in interfaceBlockCommittedEvent
-
getHeight
public abstract long getHeight()
Description copied from interface:BlockCommittedEvent
Returns the current blockchain height, which is the height of the last committed block.- Specified by:
getHeight
in interfaceBlockCommittedEvent
-
-