Issue Details (XML | Word | Printable)

Key: JAVAMONEY-26
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: atsticks
Reporter: atsticks
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
javamoney

Multi ExchangeRate

Created: 02/Feb/13 08:27 AM   Updated: 11/Mar/14 08:34 PM   Resolved: 11/Mar/14 08:34 PM
Component/s: API
Affects Version/s: None
Fix Version/s: 0.8

Time Tracking:
Not Specified

Tags: compound_rate exchange_rate
Participants: atsticks and chrispheby


 Description  « Hide

Define a compound multi-valued exchange rate that consists of several exchange rates:

  • of the same provider, but with different target currencies
  • of different providers, but with the same target currency
  • a mix of the above.

A compound value has the following properties:

  • it is immutable.
  • it does not offer arithemtics
  • it provides access to all its containing{{ExchangeRate}} instances:
    • Map<String,ExchangeRate> getAll()
    • Enumeration<String> getKeys();
    • ExchangeRategetExchangeRate(String key)
    • boolean isExchangeRateDefined(String key)
  • It allows access to all different rates contained:
    • Enumeration<ExchangeRate> getContainedExchangeRates()
  • it provides a CompoundExchangeRateFactory for creating compound values.
  • Since a compound amount is defined to be immutable, it can only be extended/adapted as follows:
    • CompoundExchangeRate add(String key, ExchangeRate amount);
    • CompoundExchangeRate remove(String... key);
    • CompuntExchangeRateBuilder toBuilder() // and using the builder to create a new instance


chrispheby added a comment - 05/Feb/13 03:43 PM

I guess this would be part of an extension module.


atsticks added a comment - 06/Feb/13 09:17 PM

Basically they are currently here, because I was thinking about using them in some API/SPI here for multi provider access of exchange rates (until now I did not have the time, to dive deeper on this topic). If finally (since it shows not to be useful, I am not able to make a useful proposal or whatever) they are not used by this module, of course, I totally agree, to move them to the extensions part. So just be a bit patient