Record Class Block

java.lang.Object
java.lang.Record
software.sava.rpc.json.http.response.Block

public record Block(long blockHeight, long blockTime, String blockHash, String previousBlockHash, long parentSlot, List<TxReward> rewards, List<String> signatures, List<BlockTx> transactions) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    Block(long blockHeight, long blockTime, String blockHash, String previousBlockHash, long parentSlot, List<TxReward> rewards, List<String> signatures, List<BlockTx> transactions)
    Creates an instance of a Block record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the blockHash record component.
    long
    Returns the value of the blockHeight record component.
    long
    Returns the value of the blockTime record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the parentSlot record component.
    static Block
    parse(systems.comodal.jsoniter.JsonIterator ji)
     
    Returns the value of the previousBlockHash record component.
    Returns the value of the rewards record component.
    Returns the value of the signatures record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the transactions record component.

    Methods inherited from class java.lang.Object

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

    • Block

      public Block(long blockHeight, long blockTime, String blockHash, String previousBlockHash, long parentSlot, List<TxReward> rewards, List<String> signatures, List<BlockTx> transactions)
      Creates an instance of a Block record class.
      Parameters:
      blockHeight - the value for the blockHeight record component
      blockTime - the value for the blockTime record component
      blockHash - the value for the blockHash record component
      previousBlockHash - the value for the previousBlockHash record component
      parentSlot - the value for the parentSlot record component
      rewards - the value for the rewards record component
      signatures - the value for the signatures record component
      transactions - the value for the transactions record component
  • Method Details

    • parse

      public static Block parse(systems.comodal.jsoniter.JsonIterator ji)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • blockHeight

      public long blockHeight()
      Returns the value of the blockHeight record component.
      Returns:
      the value of the blockHeight record component
    • blockTime

      public long blockTime()
      Returns the value of the blockTime record component.
      Returns:
      the value of the blockTime record component
    • blockHash

      public String blockHash()
      Returns the value of the blockHash record component.
      Returns:
      the value of the blockHash record component
    • previousBlockHash

      public String previousBlockHash()
      Returns the value of the previousBlockHash record component.
      Returns:
      the value of the previousBlockHash record component
    • parentSlot

      public long parentSlot()
      Returns the value of the parentSlot record component.
      Returns:
      the value of the parentSlot record component
    • rewards

      public List<TxReward> rewards()
      Returns the value of the rewards record component.
      Returns:
      the value of the rewards record component
    • signatures

      public List<String> signatures()
      Returns the value of the signatures record component.
      Returns:
      the value of the signatures record component
    • transactions

      public List<BlockTx> transactions()
      Returns the value of the transactions record component.
      Returns:
      the value of the transactions record component