com.lambdista.money

Money

Related Doc: package money

case class Money(amount: BigDecimal, currency: Currency)(implicit converter: Converter) extends Product with Serializable

This is the main class of the lib. A Money is represented by its amount and currency.

amount

the amount of this money

currency

the currency for this money

converter

the Converter to use

Since

2014-10-27

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Money
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Money(amount: BigDecimal, currency: Currency)(implicit converter: Converter)

    amount

    the amount of this money

    currency

    the currency for this money

    converter

    the Converter to use

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. def !==(thatAmount: BigDecimal): Boolean

    Compares this Money with thatAmount.

    Compares this Money with thatAmount. The comparison is made between this amount and thatAmount

    thatAmount

    the amount to compare this object with.

    returns

    true if this amount is not equal to thatAmount, false otherwise.

  3. def !==(thatMoney: Money): Boolean

    Compares this Money with thatMoney.

    Compares this Money with thatMoney. The comparison is made between the amounts after normalizing both Money objects to the same currency.

    thatMoney

    the Money object to compare this object with.

    returns

    true if this Money is not equal to thatMoney, false otherwise.

  4. final def ##(): Int

    Definition Classes
    AnyRef → Any
  5. def *(thatAmount: BigDecimal): Money

    Multiplies amount by this money.

    Multiplies amount by this money.

    thatAmount

    the amount to multiply by this money

    returns

    a new object which is the result of multiplying amount to this money

  6. def *(thatMoney: Money): Money

    Multiplies thatMoney by this money.

    Multiplies thatMoney by this money. The result is expressed in terms of this money's currency.

    thatMoney

    the money to multiply by this money

    returns

    a new object which is the result of multiplying thatMoney by this money after converting thatMoney to this money's currency

  7. def +(thatAmount: BigDecimal): Money

    Adds amount to this money.

    Adds amount to this money.

    thatAmount

    the amount to sum to this money

    returns

    a new object which is the result of summing amount to this money

  8. def +(thatMoney: Money): Money

    Adds this money to thatMoney.

    Adds this money to thatMoney. The result is expressed in terms of this money's currency.

    thatMoney

    the money to sum to this money

    returns

    a new object which is the result of summing this money to thatMoney after converting thatMoney to this money's currency

  9. def -(thatAmount: BigDecimal): Money

    Subtracts amount from this money.

    Subtracts amount from this money.

    thatAmount

    the amount to sum to this money

    returns

    a new object which is the result of summing amount to this money

  10. def -(thatMoney: Money): Money

    Subtracts thatMoney from this money.

    Subtracts thatMoney from this money. The result is expressed in terms of this money's currency.

    thatMoney

    the money to subtract from this money

    returns

    a new object which is the result of subtracting thatMoney from this money after converting thatMoney to this money's currency

  11. def /(thatAmount: BigDecimal): Money

    Divides amount by this money.

    Divides amount by this money.

    thatAmount

    the amount to multiply by this money

    returns

    a new object which is the result of multiplying amount to this money

  12. def /(thatMoney: Money): Money

    Divides this money by thatMoney.

    Divides this money by thatMoney. The result is expressed in terms of this money's currency.

    thatMoney

    the money to use ad divisor

    returns

    a new object which is the result of dividing this money (dividend) by thatMoney (divisor) after converting thatMoney to this money's currency

  13. def <(thatAmount: BigDecimal): Boolean

    Compares this Money with thatAmount.

    Compares this Money with thatAmount. The comparison is made between this amount and thatAmount

    thatAmount

    the amount to compare this object with.

    returns

    true if this amount is lesser than thatAmount, false otherwise.

  14. def <(thatMoney: Money): Boolean

    Compares this Money with thatMoney.

    Compares this Money with thatMoney. The comparison is made between the amounts after normalizing both Money objects to the same currency.

    thatMoney

    the Money object to compare this object with.

    returns

    true if this Money is lesser than thatMoney, false otherwise.

  15. def <=(thatAmount: BigDecimal): Boolean

    Compares this Money with thatAmount.

    Compares this Money with thatAmount. The comparison is made between this amount and thatAmount

    thatAmount

    the amount to compare this object with.

    returns

    true if this amount is lesser than or equal to thatAmount, false otherwise.

  16. def <=(thatMoney: Money): Boolean

    Compares this Money with thatMoney.

    Compares this Money with thatMoney. The comparison is made between the amounts after normalizing both Money objects to the same currency.

    thatMoney

    the Money object to compare this object with.

    returns

    true if this Money is lesser than or equal to thatMoney, false otherwise.

  17. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  18. def ===(thatAmount: BigDecimal): Boolean

    Compares this Money with thatAmount.

    Compares this Money with thatAmount. The comparison is made between this amount and thatAmount

    thatAmount

    the amount to compare this object with.

    returns

    true if this amount is equal to thatAmount, false otherwise.

  19. def ===(thatMoney: Money): Boolean

    Compares this Money with thatMoney.

    Compares this Money with thatMoney. The comparison is made between the amounts after normalizing both Money objects to the same currency.

    thatMoney

    the Money object to compare this object with.

    returns

    true if this Money is equal to thatMoney, false otherwise.

  20. def >(thatMoney: Money): Boolean

    Compares this Money with thatMoney.

    Compares this Money with thatMoney. The comparison is made between the amounts after normalizing both Money objects to the same currency.

    thatMoney

    the Money object to compare this object with.

    returns

    true if this Money is greater than thatMoney, false otherwise.

  21. def >(thatAmount: BigDecimal): Boolean

    Compares this Money with thatAmount.

    Compares this Money with thatAmount. The comparison is made between this amount and thatAmount

    thatAmount

    the amount to compare this object with.

    returns

    true if this amount is greater than thatAmount, false otherwise.

  22. def >=(thatMoney: Money): Boolean

    Compares this Money with thatMoney.

    Compares this Money with thatMoney. The comparison is made between the amounts after normalizing both Money objects to the same currency.

    thatMoney

    the Money object to compare this object with.

    returns

    true if this Money is greater than or equal to thatMoney, false otherwise.

  23. def >=(thatAmount: BigDecimal): Boolean

    Compares this Money with thatAmount.

    Compares this Money with thatAmount. The comparison is made between this amount and thatAmount

    thatAmount

    the amount to compare this object with.

    returns

    true if this amount is greater than or equal to thatAmount, false otherwise.

  24. val amount: BigDecimal

    the amount of this money

  25. def apply(thatCurrency: Currency): Money

    Converts this money to another money represented using otherCurrency

    Converts this money to another money represented using otherCurrency

    thatCurrency

    the currency to convert this money to

    returns

    a new object where its currency is expressed in terms of otherCurrency

  26. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  27. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. val currency: Currency

    the currency for this money

  29. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  30. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  31. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  32. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  33. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  34. final def notify(): Unit

    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  36. def round(decimalDigits: Int, roundingMode: RoundingMode = RoundingMode.HALF_DOWN): Money

    Rounds this Money to the given number of decimalDigits using the provided roundingMode

    Rounds this Money to the given number of decimalDigits using the provided roundingMode

    decimalDigits

    the number of decimal digits to keep

    returns

    a new Money object whose number of decimal digits is decimalDigits

  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  38. val to: (Currency) ⇒ Money

    Just an alias for apply

  39. def toFormattedString(decimalDigits: Int = 5): String

    Formats this money object using a number of decimal digits equals to the decimalDigits param, which defaults to 5.

    Formats this money object using a number of decimal digits equals to the decimalDigits param, which defaults to 5.

    decimalDigits

    the number of decimal digits to include

    returns

    a formatted string representing this money object

  40. def toString(): String

    returns

    the string representation of this money which has, at most, 5 decimal digits. If you need to customize the number of decimal digits use toFormattedString instead

    Definition Classes
    Money → AnyRef → Any
  41. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped