com.lambdista.money

Money

case class Money(amount: BigDecimal, currency: Currency)(implicit converter: Converter) extends Ordered[Money] with 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, Ordered[Money], Comparable[Money], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Money
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Ordered
  7. Comparable
  8. AnyRef
  9. 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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. def !==(that: BigDecimal): Boolean

    Compares this Money with that.

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

    that

    the amount to compare this object with.

    returns

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

  4. final def ##(): Int

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

    Multiplies amount by this money.

    Multiplies amount by this money.

    that

    the amount to multiply by this money

    returns

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

  6. def *(that: Money): Money

    Multiplies that by this money.

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

    that

    the money to multiply by this money

    returns

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

  7. def +(that: BigDecimal): Money

    Adds amount to this money.

    Adds amount to this money.

    that

    the amount to sum to this money

    returns

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

  8. def +(that: Money): Money

    Adds this money to that.

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

    that

    the money to sum to this money

    returns

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

  9. def -(that: BigDecimal): Money

    Subtracts amount from this money.

    Subtracts amount from this money.

    that

    the amount to sum to this money

    returns

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

  10. def -(that: Money): Money

    Subtracts that from this money.

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

    that

    the money to subtract from this money

    returns

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

  11. def /(that: BigDecimal): Money

    Divides amount by this money.

    Divides amount by this money.

    that

    the amount to multiply by this money

    returns

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

  12. def /(that: Money): Money

    Divides this money by that.

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

    that

    the money to use ad divisor

    returns

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

  13. def <(that: Money): Boolean

    Definition Classes
    Ordered
  14. def <=(that: Money): Boolean

    Definition Classes
    Ordered
  15. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  17. def ===(that: BigDecimal): Boolean

    Compares this Money with that.

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

    that

    the amount to compare this object with.

    returns

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

  18. def >(that: Money): Boolean

    Definition Classes
    Ordered
  19. def >=(that: Money): Boolean

    Definition Classes
    Ordered
  20. val amount: BigDecimal

    the amount of this money

  21. 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

  22. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  23. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. def compare(that: Money): Int

    Compares this Money object with that.

    Compares this Money object with that.

    that

    the other Money object

    returns

    a number < 1 if this < that, a number > 1 if this > that, 0 if they are equal.

    Definition Classes
    Money → Ordered
  25. def compareTo(that: Money): Int

    Definition Classes
    Ordered → Comparable
  26. val currency: Currency

    the currency for this money

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

    Definition Classes
    AnyRef
  28. def finalize(): Unit

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

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

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

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

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

    Definition Classes
    AnyRef
  34. 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

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

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

    Just an alias for apply

  37. 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

  38. 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
  39. final def wait(): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. 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 Ordered[Money]

Inherited from Comparable[Money]

Inherited from AnyRef

Inherited from Any

Ungrouped