Search in sources :

Example 1 with AccountOperationRestrictionTransactionFactory

use of io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransactionFactory 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)

Example 2 with AccountOperationRestrictionTransactionFactory

use of io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransactionFactory 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 : Deadline(io.nem.symbol.sdk.model.transaction.Deadline) List(java.util.List) AccountRestrictionFlagsEnum(io.nem.symbol.sdk.openapi.vertx.model.AccountRestrictionFlagsEnum) AccountOperationRestrictionTransactionDTO(io.nem.symbol.sdk.openapi.vertx.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.vertx.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)2 AccountOperationRestrictionFlags (io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionFlags)2 AccountOperationRestrictionTransaction (io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransaction)2 AccountOperationRestrictionTransactionFactory (io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransactionFactory)2 Deadline (io.nem.symbol.sdk.model.transaction.Deadline)2 JsonHelper (io.nem.symbol.sdk.model.transaction.JsonHelper)2 TransactionType (io.nem.symbol.sdk.model.transaction.TransactionType)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 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 AccountOperationRestrictionTransactionDTO (io.nem.symbol.sdk.openapi.vertx.model.AccountOperationRestrictionTransactionDTO)1 AccountRestrictionFlagsEnum (io.nem.symbol.sdk.openapi.vertx.model.AccountRestrictionFlagsEnum)1 TransactionTypeEnum (io.nem.symbol.sdk.openapi.vertx.model.TransactionTypeEnum)1