Class BlocksRange

java.lang.Object
com.exonum.client.response.BlocksRange

public final class BlocksRange
extends Object
A closed range of blocks. It is allowed to contain «gaps» if blocks containing no transactions are filtered out. The actual range boundaries are accessible with getFromHeight() and getToHeight().
  • Constructor Details

    • BlocksRange

      public BlocksRange​(long fromHeight, long toHeight, List<Block> blocks)
      Creates a new range of blocks.
      Parameters:
      fromHeight - the height of the first requested block
      toHeight - the height of the last requested block
      blocks - the list blocks in the given range. It is allowed to not contain all blocks in the range
  • Method Details

    • getFromHeight

      public long getFromHeight()
      The height of the first block in the requested range.

      Please note that in case empty blocks are filtered out, the height of the first block in the list might differ from this value.

    • getToHeight

      public long getToHeight()
      The height of the last block in the requested range.

      Please note that in case empty blocks are filtered out, the height of the last block in the list might differ from this value.

    • getBlocks

      public List<Block> getBlocks()
      Blockchain blocks in ascending order by height. The list is not necessarily continuous if some blocks are filtered out. May be empty if no blocks are found.
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object