T - the dto type of the transaction object.public abstract class AbstractTransactionMapper<D,T extends Transaction> extends java.lang.Object implements TransactionMapper
| Constructor and Description |
|---|
AbstractTransactionMapper(JsonHelper jsonHelper,
TransactionType transactionType,
java.lang.Class<D> transactionDtoClass) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
copyToDto(T transaction,
D dto)
Subclasses need to map the values from the transaction model to the transaction dto.
|
protected abstract TransactionFactory<T> |
createFactory(NetworkType networkType,
Deadline deadline,
D transaction) |
protected TransactionFactory<T> |
createFactory(TransactionInfo transactionInfo,
java.lang.Object transactionDto) |
protected TransactionInfo |
createTransactionInfo(java.lang.Object meta,
java.lang.String id) |
JsonHelper |
getJsonHelper() |
TransactionType |
getTransactionType()
The type of transactions this mapper supports.
|
Transaction |
mapFromDto(java.lang.Object object)
It maps an embedded or top level transaction
|
java.lang.Object |
mapToDto(Transaction transaction,
java.lang.Boolean embedded)
It maps an transaction to an DTO transaction.
|
TransactionFactory<T> |
mapToFactoryFromDto(java.lang.Object object)
It maps an embedded or top level transaction to a factory.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetVersion, mapToDtopublic AbstractTransactionMapper(JsonHelper jsonHelper, TransactionType transactionType, java.lang.Class<D> transactionDtoClass)
public Transaction mapFromDto(java.lang.Object object)
TransactionMappermapFromDto in interface TransactionMapperobject - the transactionTransactionpublic TransactionFactory<T> mapToFactoryFromDto(java.lang.Object object)
TransactionMappermapToFactoryFromDto in interface TransactionMapperobject - the transactionTransactionFactoryprotected TransactionInfo createTransactionInfo(java.lang.Object meta, java.lang.String id)
public java.lang.Object mapToDto(Transaction transaction, java.lang.Boolean embedded)
TransactionMappermapToDto in interface TransactionMappertransaction - the the general transactionembedded - if it's known to be embedded.Objectprotected final TransactionFactory<T> createFactory(TransactionInfo transactionInfo, java.lang.Object transactionDto)
protected abstract TransactionFactory<T> createFactory(NetworkType networkType, Deadline deadline, D transaction)
protected abstract void copyToDto(T transaction, D dto)
transaction - the transaction modeldto - the transaction dto.public JsonHelper getJsonHelper()
public TransactionType getTransactionType()
TransactionMappergetTransactionType in interface TransactionMapper