Class Money

java.lang.Object
net.amcintosh.freshbooks.models.Money
All Implemented Interfaces:
ConvertibleContent

public class Money extends Object implements ConvertibleContent
Monetary amount represented by a decimal value and a currency code.
  • Constructor Details

    • Money

      public Money()
      Create an uninitialized Money object.
    • Money

      public Money(BigDecimal amount, String code)
      Create a Money object.
      Parameters:
      amount - Decimal amount
      code - Three-letter currency code (Eg. USD, CAD, EUR, GBP)
  • Method Details

    • getAmount

      public BigDecimal getAmount()
      Monetary amount with decimal places appropriate to the currency.
      Returns:
      Eg. BigDecimal("9.99")
    • setAmount

      public void setAmount(BigDecimal amount)
      Monetary amount with decimal places appropriate to the currency.
      Parameters:
      amount - Eg. BigDecimal("9.99")
    • getCode

      public String getCode()
      The three-letter currency code
      Returns:
      (Eg. USD, CAD, EUR, GBP)
    • setCode

      public void setCode(String code)
      The three-letter currency code
      Parameters:
      code - (Eg. USD, CAD, EUR, GBP)
    • getContent

      public Map<String,Object> 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 interface ConvertibleContent
      Returns: