use of io.nem.symbol.sdk.openapi.vertx.model.MosaicRestrictionsPage in project nem2-sdk-java by nemtech.
the class RestrictionMosaicRepositoryVertxImpl method search.
@Override
public Observable<Page<MosaicRestriction<?>>> search(MosaicRestrictionSearchCriteria criteria) {
String mosaicId = criteria.getMosaicId() == null ? null : criteria.getMosaicId().getIdAsHex();
MosaicRestrictionEntryTypeEnum entryType = criteria.getEntryType() == null ? null : MosaicRestrictionEntryTypeEnum.fromValue(criteria.getEntryType().getValue());
String targetAddress = toDto(criteria.getTargetAddress());
Integer pageSize = criteria.getPageSize();
Integer pageNumber = criteria.getPageNumber();
String offset = criteria.getOffset();
Order order = toDto(criteria.getOrder());
Consumer<Handler<AsyncResult<MosaicRestrictionsPage>>> callback = (h) -> getClient().searchMosaicRestrictions(mosaicId, entryType, targetAddress, pageSize, pageNumber, offset, order, h);
return call(callback, page -> toPage(page.getPagination(), page.getData().stream().map(this::toMosaicRestriction).collect(Collectors.toList())));
}
Aggregations