use of io.nem.symbol.sdk.openapi.okhttp_gson.model.MosaicRestrictionEntryTypeEnum in project nem2-sdk-java by nemtech.
the class RestrictionMosaicRepositoryOkHttpImpl 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());
Callable<MosaicRestrictionsPage> callback = () -> getClient().searchMosaicRestrictions(mosaicId, entryType, targetAddress, pageSize, pageNumber, offset, order);
return call(callback, page -> toPage(page.getPagination(), page.getData().stream().map(this::toMosaicRestriction).collect(Collectors.toList())));
}
Aggregations