Package com.privatechain.crypto
Class MerkleTree.MerkleProof.ProofNode
java.lang.Object
com.privatechain.crypto.MerkleTree.MerkleProof.ProofNode
- Enclosing class:
MerkleTree.MerkleProof
Immutable value holding a sibling hash and its relative position at one
level of the Merkle tree.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the sibling's hash at this level of the tree.booleanReturnstrueif the sibling is to the left of the current node (meaning the current node is a right child at this level).toString()
-
Constructor Details
-
ProofNode
Constructs aProofNode.- Parameters:
siblingHash- the sibling's hash (non-null, non-blank)siblingOnLeft-trueif the sibling is to the left of the current node- Throws:
NullPointerException- if siblingHash is nullIllegalArgumentException- if siblingHash is blank
-
-
Method Details
-
getSiblingHash
Returns the sibling's hash at this level of the tree.- Returns:
- non-null, non-blank hex hash string
-
isSiblingOnLeft
public boolean isSiblingOnLeft()Returnstrueif the sibling is to the left of the current node (meaning the current node is a right child at this level).- Returns:
- sibling position flag
-
toString
-