use of io.nem.symbol.catapult.builders.GlobalKeyValueSetBuilder in project nem2-sdk-java by nemtech.
the class MosaicGlobalRestriction method serialize.
/**
* @return serializes the state of this object.
*/
public byte[] serialize() {
MosaicIdDto mosaicId = SerializationUtils.toMosaicIdDto(getMosaicId());
GlobalKeyValueSetBuilder restrictions = GlobalKeyValueSetBuilder.create(getRestrictions().entrySet().stream().sorted(Entry.comparingByKey()).map(this::toGlobalKeyValueSetBuilder).collect(Collectors.toList()));
MosaicGlobalRestrictionEntryBuilder entry = MosaicGlobalRestrictionEntryBuilder.create(mosaicId, restrictions);
return MosaicRestrictionEntryBuilder.createGlobal((short) getVersion(), entry).serialize();
}
Aggregations