Class BlockchainEvent.BlockAddedEvent

java.lang.Object
com.privatechain.core.event.BlockchainEvent
com.privatechain.core.event.BlockchainEvent.BlockAddedEvent
Enclosing class:
BlockchainEvent

public static final class BlockchainEvent.BlockAddedEvent extends BlockchainEvent
Fired after a new block is successfully appended to the canonical chain.

Listeners receive this event after all validators and the storage write have completed, so the chain is already in its new state when the listener runs.

Since:
1.0.0
  • Constructor Details

    • BlockAddedEvent

      public BlockAddedEvent(Block block)
      Constructs a BlockAddedEvent.
      Parameters:
      block - the block that was added (non-null)
      Throws:
      NullPointerException - if block is null
  • Method Details

    • getBlock

      public Block getBlock()
      Returns the block that was added to the chain.
      Returns:
      non-null Block
    • toString

      public String toString()
      Overrides:
      toString in class Object