Class

core3.utils

ExchangeRates

Related Doc: package utils

Permalink

class ExchangeRates extends AnyRef

Singleton class for handling exchange rate and currency operations.

Note: Exchange rates are (re)loaded when calling getCurrentRates.

Annotations
@Singleton()
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ExchangeRates
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ExchangeRates()(implicit ec: ExecutionContext, ws: WSClient, cache: CacheApi)

    Permalink

    ws

    the web service client to use for retrieving exchange rates

    cache

    the cache to use for storing the retrieved rates

    Annotations
    @Inject()

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def availableCurrencies: Seq[String]

    Permalink
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def convert(sourceValue: BigDecimal, sourceCurrency: String, targetCurrency: String): BigDecimal

    Permalink

    Converts the supplied source value from the specified source currency to the specified target currency.

    Converts the supplied source value from the specified source currency to the specified target currency.

    sourceValue

    the value to convert

    sourceCurrency

    the value's current currency

    targetCurrency

    the value's target currency

    returns

    the value in the target currency

  8. def convertSet(source: Seq[(BigDecimal, String)], targetCurrency: String): Seq[BigDecimal]

    Permalink

    Converts a set of currencies to the specified target currency.

    Converts a set of currencies to the specified target currency.

    source

    the currencies to convert (list of: (source value, source currency))

    targetCurrency

    the values' target currency

    returns

    the converted values

  9. def convertSetWith(source: Seq[(BigDecimal, String)], targetCurrency: String, rates: Map[String, BigDecimal], currencies: Seq[String]): Seq[BigDecimal]

    Permalink

    Converts a set of currencies to the specified target currency.

    Converts a set of currencies to the specified target currency.

    source

    the currencies to convert (list of: (source value, source currency))

    targetCurrency

    the values' target currency

    rates

    the rates to use for the conversion

    currencies

    the supported currencies

    returns

    the converted values

  10. def convertWith(sourceValue: BigDecimal, sourceCurrency: String, targetCurrency: String, rates: Map[String, BigDecimal], currencies: Seq[String]): BigDecimal

    Permalink

    Converts the supplied source value from the specified source currency to the specified target currency.

    Converts the supplied source value from the specified source currency to the specified target currency.

    sourceValue

    the value to convert

    sourceCurrency

    the value's current currency

    targetCurrency

    the value's target currency

    rates

    the rates to use for the conversion

    currencies

    the supported currencies

    returns

    the value in the target currency

  11. def decimalScale: Int

    Permalink
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. def getCurrentRates: Map[String, BigDecimal]

    Permalink

    Retrieves the currently available exchange rates.

    Retrieves the currently available exchange rates.

    Note: If the previously stored rates have expired or if they have never been retrieved, a request is made to the exchange rate provider and the caller will be forced to wait for that operation to complete.

    returns

    the requested exchange rates

  17. def hashCode(): Int

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

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

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. def roundingMode: scala.math.BigDecimal.RoundingMode.Value

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

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped