Search in sources :

Example 1 with MosaicRestrictionTypeDto

use of io.nem.symbol.catapult.builders.MosaicRestrictionTypeDto in project nem2-sdk-java by nemtech.

the class MosaicGlobalRestriction method toGlobalKeyValueSetBuilder.

private GlobalKeyValueBuilder toGlobalKeyValueSetBuilder(Entry<BigInteger, MosaicGlobalRestrictionItem> entry) {
    MosaicRestrictionKeyDto key = new MosaicRestrictionKeyDto(entry.getKey().longValue());
    MosaicIdDto referenceMosaicId = SerializationUtils.toMosaicIdDto(entry.getValue().getReferenceMosaicId());
    long restrictionValue = entry.getValue().getRestrictionValue().longValue();
    MosaicRestrictionTypeDto restrictionType = MosaicRestrictionTypeDto.rawValueOf(entry.getValue().getRestrictionType().getValue());
    RestrictionRuleBuilder restrictionRule = RestrictionRuleBuilder.create(referenceMosaicId, restrictionValue, restrictionType);
    return GlobalKeyValueBuilder.create(key, restrictionRule);
}
Also used : MosaicRestrictionKeyDto(io.nem.symbol.catapult.builders.MosaicRestrictionKeyDto) MosaicIdDto(io.nem.symbol.catapult.builders.MosaicIdDto) MosaicRestrictionTypeDto(io.nem.symbol.catapult.builders.MosaicRestrictionTypeDto) RestrictionRuleBuilder(io.nem.symbol.catapult.builders.RestrictionRuleBuilder)

Aggregations

MosaicIdDto (io.nem.symbol.catapult.builders.MosaicIdDto)1 MosaicRestrictionKeyDto (io.nem.symbol.catapult.builders.MosaicRestrictionKeyDto)1 MosaicRestrictionTypeDto (io.nem.symbol.catapult.builders.MosaicRestrictionTypeDto)1 RestrictionRuleBuilder (io.nem.symbol.catapult.builders.RestrictionRuleBuilder)1