Class MerkleTree.MerkleProof.ProofNode

java.lang.Object
com.privatechain.crypto.MerkleTree.MerkleProof.ProofNode
Enclosing class:
MerkleTree.MerkleProof

public static final class MerkleTree.MerkleProof.ProofNode extends Object
Immutable value holding a sibling hash and its relative position at one level of the Merkle tree.
Since:
1.0.0
  • Constructor Details

    • ProofNode

      public ProofNode(String siblingHash, boolean siblingOnLeft)
      Constructs a ProofNode.
      Parameters:
      siblingHash - the sibling's hash (non-null, non-blank)
      siblingOnLeft - true if the sibling is to the left of the current node
      Throws:
      NullPointerException - if siblingHash is null
      IllegalArgumentException - if siblingHash is blank
  • Method Details

    • getSiblingHash

      public String getSiblingHash()
      Returns the sibling's hash at this level of the tree.
      Returns:
      non-null, non-blank hex hash string
    • isSiblingOnLeft

      public boolean isSiblingOnLeft()
      Returns true if 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

      public String toString()
      Overrides:
      toString in class Object