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, wait
getVersion, mapToDto
public AbstractTransactionMapper(JsonHelper jsonHelper, TransactionType transactionType, java.lang.Class<D> transactionDtoClass)
public Transaction mapFromDto(java.lang.Object object)
TransactionMapper
mapFromDto
in interface TransactionMapper
object
- the transactionTransaction
public TransactionFactory<T> mapToFactoryFromDto(java.lang.Object object)
TransactionMapper
mapToFactoryFromDto
in interface TransactionMapper
object
- the transactionTransactionFactory
protected TransactionInfo createTransactionInfo(java.lang.Object meta, java.lang.String id)
public java.lang.Object mapToDto(Transaction transaction, java.lang.Boolean embedded)
TransactionMapper
mapToDto
in interface TransactionMapper
transaction
- the the general transactionembedded
- if it's known to be embedded.Object
protected 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()
TransactionMapper
getTransactionType
in interface TransactionMapper