use of io.nem.symbol.sdk.model.state.MerkleTreeLeaf in project nem2-sdk-java by nemtech.
the class MerkleMapper method toMerkleStateInfo.
public MerkleStateInfo toMerkleStateInfo(MerkleStateInfoDTO dto) {
MerkleTreeLeaf leaf = dto.getTree().stream().map(this::toLeaf).filter(Objects::nonNull).findFirst().orElse(null);
List<MerkleTreeBranch> branches = dto.getTree().stream().map(this::toBranch).filter(Objects::nonNull).collect(Collectors.toList());
MerkleTree tree = new MerkleTree(branches, leaf);
return new MerkleStateInfo(dto.getRaw(), tree);
}
use of io.nem.symbol.sdk.model.state.MerkleTreeLeaf in project nem2-sdk-java by nemtech.
the class MerkleMapper method toMerkleStateInfo.
public MerkleStateInfo toMerkleStateInfo(MerkleStateInfoDTO dto) {
MerkleTreeLeaf leaf = dto.getTree().stream().map(this::toLeaf).filter(Objects::nonNull).findFirst().orElse(null);
List<MerkleTreeBranch> branches = dto.getTree().stream().map(this::toBranch).filter(Objects::nonNull).collect(Collectors.toList());
MerkleTree tree = new MerkleTree(branches, leaf);
return new MerkleStateInfo(dto.getRaw(), tree);
}
Aggregations