Class BlocksResponse

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

public final class BlocksResponse
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    BlocksResponse​(java.util.List<Block> blocks, long blocksRangeStart, long blocksRangeEnd)  
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    java.util.List<Block> getBlocks()
    Blockchain blocks in descending order (not necessarily continuous) by height.
    long getBlocksRangeEnd()
    The largest height of the returned blocks that match the search criteria, plus one.
    long getBlocksRangeStart()
    The smallest height of the returned blocks that match the search criteria.
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

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

    • BlocksResponse

      public BlocksResponse​(java.util.List<Block> blocks, long blocksRangeStart, long blocksRangeEnd)
  • Method Details

    • getBlocks

      public java.util.List<Block> getBlocks()
      Blockchain blocks in descending order (not necessarily continuous) by height. It is allowed to be empty if no blocks found.
    • getBlocksRangeStart

      public long getBlocksRangeStart()
      The smallest height of the returned blocks that match the search criteria.
    • getBlocksRangeEnd

      public long getBlocksRangeEnd()
      The largest height of the returned blocks that match the search criteria, plus one.

      WARNING: do not rely on the value, because it's unpredictable in some queries. It'll be fixed in future releases. Read below if would still like to use it.

      The value is always equal to blocks[0].height + 1 for responses with blocks. For responses without blocks the value is set mostly randomly depending on request parameters and blockchain state: The value is equal to heightMax + 1 if heightMax request parameter is passed. If the heightMax request parameter is greater then last committed block height at the moment then blocksRangeEnd value will be equal to last_committed_block.height + 1. If some blocks in the range do not match the search criteria then: blocksRangeEnd - blocksRangeStart != blocks.size.

    • 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