Class CheckedListProofImpl<E>
- java.lang.Object
-
- com.exonum.binding.common.proofs.list.CheckedListProofImpl<E>
-
- All Implemented Interfaces:
CheckedProof
,CheckedListProof
public class CheckedListProofImpl<E> extends java.lang.Object implements CheckedListProof
A checked list proof includes list proof verification results.If it is correct you may access:
- a calculated Merkle root hash
- proof elements
getProofStatus()
with description of why the proof is not valid.
-
-
Constructor Summary
Constructors Constructor Description CheckedListProofImpl(HashCode calculatedRootHash, java.util.NavigableMap<java.lang.Long,E> elements, ListProofStatus proofStatus)
Creates checked list proof.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.NavigableMap<java.lang.Long,E>
getElements()
Get all list elements.ListProofStatus
getProofStatus()
Returns the status of this proof: whether it is structurally valid.HashCode
getRootHash()
Returns the calculated root hash of the proof.boolean
isValid()
Returns true if proof status is valid, false otherwise.
-
-
-
Constructor Detail
-
CheckedListProofImpl
public CheckedListProofImpl(HashCode calculatedRootHash, java.util.NavigableMap<java.lang.Long,E> elements, ListProofStatus proofStatus)
Creates checked list proof.- Parameters:
calculatedRootHash
- calculated root hash of the proofelements
- proof elements collectionproofStatus
- a status of proof verification
-
-
Method Detail
-
getElements
public java.util.NavigableMap<java.lang.Long,E> getElements()
Description copied from interface:CheckedListProof
Get all list elements. There might be several consecutive ranges.- Specified by:
getElements
in interfaceCheckedListProof<E>
-
getRootHash
public HashCode getRootHash()
Description copied from interface:CheckedProof
Returns the calculated root hash of the proof. Must be equal to the Merkle root hash of the collection, providing this proof.- Specified by:
getRootHash
in interfaceCheckedProof
-
getProofStatus
public ListProofStatus getProofStatus()
Description copied from interface:CheckedListProof
Returns the status of this proof: whether it is structurally valid.- Specified by:
getProofStatus
in interfaceCheckedListProof<E>
- Specified by:
getProofStatus
in interfaceCheckedProof
-
isValid
public boolean isValid()
Description copied from interface:CheckedProof
Returns true if proof status is valid, false otherwise. Details about the proof verification status could be obtained viaCheckedProof.getProofStatus()
.- Specified by:
isValid
in interfaceCheckedProof
-
-