Record Class BlockchainNode.NodeStatus

java.lang.Object
java.lang.Record
com.privatechain.core.builder.BlockchainNode.NodeStatus
Record Components:
chainHeight - number of blocks in the canonical chain
mempoolSize - number of unconfirmed transactions in the mempool
peerCount - number of currently connected peers (0 in standalone mode)
lastBlockTime - timestamp of the most recently added block; null if empty
consensusEngine - human-readable name of the active consensus engine
Enclosing class:
BlockchainNode

public static record BlockchainNode.NodeStatus(int chainHeight, int mempoolSize, int peerCount, Instant lastBlockTime, String consensusEngine) extends Record
Immutable snapshot of a node's operational status (NFR-UX-04).
Since:
1.0.0
  • Constructor Details

    • NodeStatus

      public NodeStatus(int chainHeight, int mempoolSize, int peerCount, Instant lastBlockTime, String consensusEngine)
      Creates an instance of a NodeStatus record class.
      Parameters:
      chainHeight - the value for the chainHeight record component
      mempoolSize - the value for the mempoolSize record component
      peerCount - the value for the peerCount record component
      lastBlockTime - the value for the lastBlockTime record component
      consensusEngine - the value for the consensusEngine record component
  • Method Details

    • 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.
    • chainHeight

      public int chainHeight()
      Returns the value of the chainHeight record component.
      Returns:
      the value of the chainHeight record component
    • mempoolSize

      public int mempoolSize()
      Returns the value of the mempoolSize record component.
      Returns:
      the value of the mempoolSize record component
    • peerCount

      public int peerCount()
      Returns the value of the peerCount record component.
      Returns:
      the value of the peerCount record component
    • lastBlockTime

      public Instant lastBlockTime()
      Returns the value of the lastBlockTime record component.
      Returns:
      the value of the lastBlockTime record component
    • consensusEngine

      public String consensusEngine()
      Returns the value of the consensusEngine record component.
      Returns:
      the value of the consensusEngine record component