Search in sources :

Example 1 with TransactionTypeEnum

use of io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionTypeEnum in project nem2-sdk-java by nemtech.

the class AccountOperationRestrictionTransactionMapper method createFactory.

@Override
protected AccountOperationRestrictionTransactionFactory createFactory(NetworkType networkType, Deadline deadline, AccountOperationRestrictionTransactionDTO transaction) {
    AccountOperationRestrictionFlags restrictionFlags = AccountOperationRestrictionFlags.rawValueOf(transaction.getRestrictionFlags().getValue());
    List<TransactionType> additions = transaction.getRestrictionAdditions().stream().map(transactionTypeEnum -> TransactionType.rawValueOf(transactionTypeEnum.getValue())).collect(Collectors.toList());
    List<TransactionType> deletions = transaction.getRestrictionDeletions().stream().map(transactionTypeEnum -> TransactionType.rawValueOf(transactionTypeEnum.getValue())).collect(Collectors.toList());
    return AccountOperationRestrictionTransactionFactory.create(networkType, deadline, restrictionFlags, additions, deletions);
}
Also used : AccountRestrictionFlagsEnum(io.nem.symbol.sdk.openapi.okhttp_gson.model.AccountRestrictionFlagsEnum) Deadline(io.nem.symbol.sdk.model.transaction.Deadline) List(java.util.List) AccountOperationRestrictionTransactionDTO(io.nem.symbol.sdk.openapi.okhttp_gson.model.AccountOperationRestrictionTransactionDTO) JsonHelper(io.nem.symbol.sdk.model.transaction.JsonHelper) AccountOperationRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransaction) TransactionType(io.nem.symbol.sdk.model.transaction.TransactionType) AccountOperationRestrictionFlags(io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionFlags) NetworkType(io.nem.symbol.sdk.model.network.NetworkType) TransactionTypeEnum(io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionTypeEnum) Collectors(java.util.stream.Collectors) AccountOperationRestrictionTransactionFactory(io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransactionFactory) AccountOperationRestrictionFlags(io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionFlags) TransactionType(io.nem.symbol.sdk.model.transaction.TransactionType)

Aggregations

NetworkType (io.nem.symbol.sdk.model.network.NetworkType)1 AccountOperationRestrictionFlags (io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionFlags)1 AccountOperationRestrictionTransaction (io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransaction)1 AccountOperationRestrictionTransactionFactory (io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransactionFactory)1 Deadline (io.nem.symbol.sdk.model.transaction.Deadline)1 JsonHelper (io.nem.symbol.sdk.model.transaction.JsonHelper)1 TransactionType (io.nem.symbol.sdk.model.transaction.TransactionType)1 AccountOperationRestrictionTransactionDTO (io.nem.symbol.sdk.openapi.okhttp_gson.model.AccountOperationRestrictionTransactionDTO)1 AccountRestrictionFlagsEnum (io.nem.symbol.sdk.openapi.okhttp_gson.model.AccountRestrictionFlagsEnum)1 TransactionTypeEnum (io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionTypeEnum)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1