Package com.exonum.client.response
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 Summary
Constructors Constructor Description BlocksRange(long fromHeight, long toHeight, List<Block> blocks)
Creates a new range of blocks. -
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
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()
String
toString()
-
Constructor Details
-
BlocksRange
Creates a new range of blocks.- Parameters:
fromHeight
- the height of the first requested blocktoHeight
- the height of the last requested blockblocks
- 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
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
-
hashCode
public int hashCode() -
toString
-