Package net.amcintosh.freshbooks.models
Class Money
java.lang.Object
net.amcintosh.freshbooks.models.Money
- All Implemented Interfaces:
ConvertibleContent
Monetary amount represented by a decimal value and a currency code.
-
Constructor Summary
ConstructorDescriptionMoney()
Create an uninitialized Money object.Money
(BigDecimal amount, String code) Create a Money object. -
Method Summary
Modifier and TypeMethodDescriptionMonetary amount with decimal places appropriate to the currency.getCode()
The three-letter currency codeReturn the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.void
setAmount
(BigDecimal amount) Monetary amount with decimal places appropriate to the currency.void
The three-letter currency code
-
Constructor Details
-
Money
public Money()Create an uninitialized Money object. -
Money
Create a Money object.- Parameters:
amount
- Decimal amountcode
- Three-letter currency code (Eg. USD, CAD, EUR, GBP)
-
-
Method Details
-
getAmount
Monetary amount with decimal places appropriate to the currency.- Returns:
- Eg. BigDecimal("9.99")
-
setAmount
Monetary amount with decimal places appropriate to the currency.- Parameters:
amount
- Eg. BigDecimal("9.99")
-
getCode
The three-letter currency code- Returns:
- (Eg. USD, CAD, EUR, GBP)
-
setCode
The three-letter currency code- Parameters:
code
- (Eg. USD, CAD, EUR, GBP)
-
getContent
Description copied from interface:ConvertibleContent
Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.- Specified by:
getContent
in interfaceConvertibleContent
- Returns:
-