@Embeddable public class TransactionAmount extends DomainObject implements IAmount<TransactionAmount>
Constructor and Description |
---|
TransactionAmount() |
TransactionAmount(Double amount)
Initialized version will initialize all numerals to 0D
|
TransactionAmount(Double total,
String currency) |
TransactionAmount(IAmount amt) |
Modifier and Type | Method and Description |
---|---|
TransactionAmount |
add(TransactionAmount amt)
Will add the amount to the current amount and return the updated current amount;
parameter null values are skipped
|
TransactionAmount |
clone() |
int |
compareTo(IAmount o) |
TransactionAmount |
deduct(TransactionAmount amt)
Will deduct the amount to the current amount and return the updated current amount;
parameter null values are skipped
|
boolean |
equals(Object obj) |
Double |
getAmount()
The amount
|
String |
getConversionMetaData()
Details about currency conversion (if any).
Implementation is Application dependent. Preferably the rate value or in JSON format. |
String |
getCurrency()
The currency
|
Double |
getTotal() |
int |
hashCode() |
void |
setAmount(Double amount)
The amount
|
void |
setConversionMetaData(String conversionMetaData)
Details about currency conversion (if any).
Implementation is Application dependent. Preferably the rate value or in JSON format. |
void |
setCurrency(String currency)
The currency
|
String |
toString() |
public TransactionAmount()
public TransactionAmount(Double amount)
amount
- as Doublepublic TransactionAmount(IAmount amt)
public Double getAmount()
public void setAmount(Double amount)
public String getCurrency()
getCurrency
in interface IAmount<TransactionAmount>
public void setCurrency(String currency)
public String getConversionMetaData()
public void setConversionMetaData(String conversionMetaData)
public TransactionAmount add(TransactionAmount amt)
add
in interface IAmount<TransactionAmount>
amt
- as TransactionAmount
TransactionAmount
TODO: Add Unit test case; esp null scenariospublic TransactionAmount deduct(TransactionAmount amt)
deduct
in interface IAmount<TransactionAmount>
amt
- as TransactionAmount
TransactionAmount
TODO: Add Unit test case; esp null scenariospublic TransactionAmount clone()
public int compareTo(IAmount o)
compareTo
in interface Comparable<IAmount>
public Double getTotal()
getTotal
in interface IAmount<TransactionAmount>
Copyright © 2018. All rights reserved.