use of io.nem.symbol.sdk.api.AccountSearchCriteria in project nem2-sdk-java by nemtech.
the class MerkleLoaderIntegrationTest method accounts.
public List<Arguments> accounts() {
RepositoryFactory repositoryFactory = getRepositoryFactory(DEFAULT_REPOSITORY_TYPE);
AccountRepository repository = repositoryFactory.createAccountRepository();
return getArguments(repository, new AccountSearchCriteria().order(ORDER_BY));
}
use of io.nem.symbol.sdk.api.AccountSearchCriteria in project nem2-sdk-java by nemtech.
the class AccountRepositoryOkHttpImpl method search.
@Override
public Observable<Page<AccountInfo>> search(AccountSearchCriteria criteria) {
Integer pageSize = criteria.getPageSize();
Integer pageNumber = criteria.getPageNumber();
String offset = criteria.getOffset();
Order order = toDto(criteria.getOrder());
AccountOrderByEnum orderBy = criteria.getOrderBy() == null ? null : AccountOrderByEnum.fromValue(criteria.getOrderBy().getValue());
String mosaicId = criteria.getMosaicId() == null ? null : criteria.getMosaicId().getIdAsHex();
Callable<AccountPage> callback = () -> getClient().searchAccounts(pageSize, pageNumber, offset, order, orderBy, mosaicId);
return exceptionHandling(call(callback).map(page -> this.toPage(page.getPagination(), page.getData().stream().map(this::toAccountInfo).collect(Collectors.toList()))));
}
Aggregations