Class BlocksRange

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

public final class BlocksRange
extends java.lang.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 Summary

    Constructors 
    Constructor Description
    BlocksRange​(long fromHeight, long toHeight, java.util.List<Block> blocks)
    Creates a new range of blocks.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    java.util.List<Block> getBlocks()
    Blockchain blocks in ascending order by height.
    long getFromHeight()
    The height of the first block in the requested range.
    long getToHeight()
    The height of the last block in the requested range.
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BlocksRange

      public BlocksRange​(long fromHeight, long toHeight, java.util.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 java.util.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​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

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

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