public class CheckedFlatMapProof extends java.lang.Object implements CheckedMapProof
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(com.google.protobuf.ByteString key)
If this proof is valid, returns true if there is a given key in the proof;
false — if there is no such key.
|
static CheckedFlatMapProof |
correct(HashCode rootHash,
java.util.Set<MapEntry> entries,
java.util.Set<com.google.protobuf.ByteString> missingKeys)
Creates a valid map proof.
|
com.google.protobuf.ByteString |
get(com.google.protobuf.ByteString key)
If this proof is valid, returns the value corresponding to the specified key
or null if there is no such key in the proof.
|
java.util.Set<MapEntry> |
getEntries()
Get all leaf entries of this proof.
|
java.util.Set<com.google.protobuf.ByteString> |
getMissingKeys()
Get all keys that were requested, but did not appear in this proof.
|
MapProofStatus |
getProofStatus()
Returns the status of this proof: whether it is structurally valid.
|
HashCode |
getRootHash()
Returns the calculated root hash of the proof.
|
static CheckedFlatMapProof |
invalid(MapProofStatus status)
Creates an invalid map proof.
|
boolean |
isValid()
Returns true if proof status is valid, false otherwise.
|
public static CheckedFlatMapProof correct(HashCode rootHash, java.util.Set<MapEntry> entries, java.util.Set<com.google.protobuf.ByteString> missingKeys)
rootHash
- the Merkle root hash calculated by the validatorentries
- the set of entries that are proved to be in the mapmissingKeys
- the set of keys that are proved not to be in the mappublic static CheckedFlatMapProof invalid(MapProofStatus status)
status
- the status explaining why the proof is not valid;
must not be MapProofStatus.CORRECT
public java.util.Set<MapEntry> getEntries()
CheckedMapProof
getEntries
in interface CheckedMapProof
public java.util.Set<com.google.protobuf.ByteString> getMissingKeys()
CheckedMapProof
getMissingKeys
in interface CheckedMapProof
public boolean containsKey(com.google.protobuf.ByteString key)
CheckedMapProof
containsKey
in interface CheckedMapProof
public HashCode getRootHash()
CheckedProof
getRootHash
in interface CheckedProof
public com.google.protobuf.ByteString get(com.google.protobuf.ByteString key)
CheckedMapProof
get
in interface CheckedMapProof
public MapProofStatus getProofStatus()
CheckedMapProof
getProofStatus
in interface CheckedProof
getProofStatus
in interface CheckedMapProof
public boolean isValid()
CheckedProof
CheckedProof.getProofStatus()
.isValid
in interface CheckedProof
Copyright © 2018 Exonum. All rights reserved.