use of io.nem.symbol.sdk.model.account.SupplementalAccountKeys in project nem2-sdk-java by nemtech.
the class AccountRepositoryVertxImpl method toDto.
private SupplementalAccountKeys toDto(SupplementalPublicKeysDTO dto) {
if (dto == null) {
return new SupplementalAccountKeys(null, null, null, Collections.emptyList());
}
PublicKey linked = toPublicKey(dto.getLinked());
PublicKey node = toPublicKey(dto.getNode());
PublicKey vrf = toPublicKey(dto.getVrf());
List<AccountLinkVotingKey> voting = dto.getVoting() == null || dto.getVoting().getPublicKeys() == null ? Collections.emptyList() : dto.getVoting().getPublicKeys().stream().map(p -> new AccountLinkVotingKey(p.getPublicKey(), (p.getStartEpoch()), (p.getEndEpoch()))).collect(Collectors.toList());
return new SupplementalAccountKeys(linked, node, vrf, voting);
}
use of io.nem.symbol.sdk.model.account.SupplementalAccountKeys in project nem2-sdk-java by nemtech.
the class AccountRepositoryOkHttpImpl method toDto.
private SupplementalAccountKeys toDto(SupplementalPublicKeysDTO dto) {
if (dto == null) {
return new SupplementalAccountKeys(null, null, null, Collections.emptyList());
}
PublicKey linked = toPublicKey(dto.getLinked());
PublicKey node = toPublicKey(dto.getNode());
PublicKey vrf = toPublicKey(dto.getVrf());
List<AccountLinkVotingKey> voting = dto.getVoting() == null || dto.getVoting().getPublicKeys() == null ? Collections.emptyList() : dto.getVoting().getPublicKeys().stream().map(p -> new AccountLinkVotingKey(p.getPublicKey(), (p.getStartEpoch()), (p.getEndEpoch()))).collect(Collectors.toList());
return new SupplementalAccountKeys(linked, node, vrf, voting);
}
Aggregations