Class Block.BlockBuilder

java.lang.Object
com.exonum.client.response.Block.BlockBuilder
Enclosing class:
Block

public static class Block.BlockBuilder
extends java.lang.Object
  • Method Summary

    Modifier and Type Method Description
    Block build()  
    Block.BlockBuilder commitTime​(java.time.ZonedDateTime commitTime)
    Time when the block was committed to the blockchain.
    Block.BlockBuilder height​(long height)
    The height of this block which is a distance between the last block and the "genesis" block.
    Block.BlockBuilder numTransactions​(int numTransactions)
    Number of transactions in this block.
    Block.BlockBuilder previousBlockHash​(@NonNull com.exonum.binding.common.hash.HashCode previousBlockHash)
    Hash link to the previous block in the blockchain.
    Block.BlockBuilder proposerId​(int proposerId)
    Identifier of the leader node which has proposed the block.
    Block.BlockBuilder stateHash​(@NonNull com.exonum.binding.common.hash.HashCode stateHash)
    Hash of the blockchain state after applying transactions in the block.
    java.lang.String toString()  
    Block.BlockBuilder txRootHash​(@NonNull com.exonum.binding.common.hash.HashCode txRootHash)
    Root hash of the Merkle tree of transactions in this block.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • proposerId

      public Block.BlockBuilder proposerId​(int proposerId)
      Identifier of the leader node which has proposed the block.
      Returns:
      this.
    • height

      public Block.BlockBuilder height​(long height)
      The height of this block which is a distance between the last block and the "genesis" block. Genesis block has 0 height. Therefore, the blockchain height is equal to the number of blocks plus one.

      The height also identifies each block in the blockchain.

      Returns:
      this.
    • numTransactions

      public Block.BlockBuilder numTransactions​(int numTransactions)
      Number of transactions in this block.
      Returns:
      this.
    • previousBlockHash

      public Block.BlockBuilder previousBlockHash​(@NonNull @NonNull com.exonum.binding.common.hash.HashCode previousBlockHash)
      Hash link to the previous block in the blockchain.
      Returns:
      this.
    • txRootHash

      public Block.BlockBuilder txRootHash​(@NonNull @NonNull com.exonum.binding.common.hash.HashCode txRootHash)
      Root hash of the Merkle tree of transactions in this block.
      Returns:
      this.
    • stateHash

      public Block.BlockBuilder stateHash​(@NonNull @NonNull com.exonum.binding.common.hash.HashCode stateHash)
      Hash of the blockchain state after applying transactions in the block.
      Returns:
      this.
    • commitTime

      public Block.BlockBuilder commitTime​(java.time.ZonedDateTime commitTime)
      Time when the block was committed to the blockchain.
      Returns:
      this.
    • build

      public Block build()
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object