javamoney
  1. javamoney
  2. JAVAMONEY-25

Multi MonetaryAmount and CurrencyUnit Values

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Impl: RI
    • Labels:
      None

      Description

      Define a compound multi-valued monetary amount that consists of several amounts:

      • of the same currency, but with different semantics, e.g. for use cases in insurance calculations
      • of different currencies, e.g. for easily switching between currencies supported in web shop
      • 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{{MonetaryAmount}} instances:
        • Map<String,MonetaryAmount> getAll()
        • Enumeration<String> getKeys();
        • MonetaryAmount getMonetaryAmount(String key)
        • boolean isMonetaryAmountDefined(String key)
      • It allows access to all different currencies contained:
        • Enumeration<CurrencyUnit> getContainedCurrencies()
      • it provides a CompoundMonetaryAmountFactory for creating compound values.
      • Since a compound amount is defined to be immutable, it can only be extended/adapted as follows:
        • CompoundMonetaryAmount add(String key, MonetaryAmount amount);
        • CompoundMonetaryAmount remove(String... key);
        • CompoundMonetaryAmountBuilder toBuilder() // and using the builder to create a new instance

        Activity

          People

          • Assignee:
            atsticks
            Reporter:
            atsticks
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: