use of io.nem.symbol.sdk.model.restriction.MosaicGlobalRestrictionItem in project nem2-sdk-java by nemtech.
the class RestrictionMosaicRepositoryOkHttpImpl method toMosaicGlobalRestriction.
private MosaicGlobalRestriction toMosaicGlobalRestriction(MosaicGlobalRestrictionDTO mosaicGlobalRestrictionDTO) {
MosaicGlobalRestrictionEntryWrapperDTO dto = mosaicGlobalRestrictionDTO.getMosaicRestrictionEntry();
Map<BigInteger, MosaicGlobalRestrictionItem> restrictions = dto.getRestrictions().stream().collect(Collectors.toMap(e -> new BigInteger(e.getKey()), e -> toMosaicGlobalRestrictionItem(e.getRestriction()), (x, y) -> y, LinkedHashMap::new));
return new MosaicGlobalRestriction(mosaicGlobalRestrictionDTO.getId(), ObjectUtils.defaultIfNull(mosaicGlobalRestrictionDTO.getMosaicRestrictionEntry().getVersion(), 1), dto.getCompositeHash(), MosaicRestrictionEntryType.rawValueOf(dto.getEntryType().getValue()), MapperUtils.toMosaicId(dto.getMosaicId()), restrictions);
}
use of io.nem.symbol.sdk.model.restriction.MosaicGlobalRestrictionItem in project nem2-sdk-java by nemtech.
the class RestrictionMosaicRepositoryVertxImpl method toMosaicGlobalRestriction.
private MosaicGlobalRestriction toMosaicGlobalRestriction(MosaicGlobalRestrictionDTO mosaicGlobalRestrictionDTO) {
MosaicGlobalRestrictionEntryWrapperDTO dto = mosaicGlobalRestrictionDTO.getMosaicRestrictionEntry();
Map<BigInteger, MosaicGlobalRestrictionItem> restrictions = dto.getRestrictions().stream().collect(Collectors.toMap(e -> new BigInteger(e.getKey()), e -> toMosaicGlobalRestrictionItem(e.getRestriction()), (x, y) -> y, LinkedHashMap::new));
return new MosaicGlobalRestriction(mosaicGlobalRestrictionDTO.getId(), ObjectUtils.defaultIfNull(mosaicGlobalRestrictionDTO.getMosaicRestrictionEntry().getVersion(), 1), dto.getCompositeHash(), MosaicRestrictionEntryType.rawValueOf(dto.getEntryType().getValue()), MapperUtils.toMosaicId(dto.getMosaicId()), restrictions);
}
Aggregations