Package com.privatechain.core.builder
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 chainmempoolSize- number of unconfirmed transactions in the mempoolpeerCount- number of currently connected peers (0 in standalone mode)lastBlockTime- timestamp of the most recently added block;nullif emptyconsensusEngine- 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 Summary
ConstructorsConstructorDescriptionNodeStatus(int chainHeight, int mempoolSize, int peerCount, Instant lastBlockTime, String consensusEngine) Creates an instance of aNodeStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thechainHeightrecord component.Returns the value of theconsensusEnginerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelastBlockTimerecord component.intReturns the value of themempoolSizerecord component.intReturns the value of thepeerCountrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NodeStatus
public NodeStatus(int chainHeight, int mempoolSize, int peerCount, Instant lastBlockTime, String consensusEngine) Creates an instance of aNodeStatusrecord class.- Parameters:
chainHeight- the value for thechainHeightrecord componentmempoolSize- the value for themempoolSizerecord componentpeerCount- the value for thepeerCountrecord componentlastBlockTime- the value for thelastBlockTimerecord componentconsensusEngine- the value for theconsensusEnginerecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
chainHeight
public int chainHeight()Returns the value of thechainHeightrecord component.- Returns:
- the value of the
chainHeightrecord component
-
mempoolSize
public int mempoolSize()Returns the value of themempoolSizerecord component.- Returns:
- the value of the
mempoolSizerecord component
-
peerCount
public int peerCount()Returns the value of thepeerCountrecord component.- Returns:
- the value of the
peerCountrecord component
-
lastBlockTime
Returns the value of thelastBlockTimerecord component.- Returns:
- the value of the
lastBlockTimerecord component
-
consensusEngine
Returns the value of theconsensusEnginerecord component.- Returns:
- the value of the
consensusEnginerecord component
-