Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.3
    • Fix Version/s: 0.4-EDR1
    • Component/s: API
    • Labels:
      None

      Description

      Provide an interface and a value type for a CurrencyUnit, which provides the following functionality:

      • the CurrencyUnit interface modelled does not define any methods for changing the internal state.
      • the value type must be final and immutable, and implement the CurrencyUnit interface.
      • CurrencyUnit may have different namespaces, e.g. 'ISO-4217' (default), but also arbitrary others are supported.
      • the namespace of a CurrencyUnit can be accessed by a corresponding method String getNamespace().
      • a CurrencyUnit must have a unique literal currency code unique within the namespace, accessible by a method String getCurrencyCode().
      • a CurrencyUnit provides the basic non localized methods similar to java.util.Currency for maximal backwards compatibility:
        • int getNumericCode() Gets a numeric currency code. Hereby -1 is returned if no numeric code is available for an instance.
        • int getDefaultFractionDigits(), Gets the number of fractional digits typically used by a currency. -1 is returned if no such value is available for an instance
      • a CurrencyUnit has a time period defined, when it is valid. This is modelled by Long getValidFrom(); and Long getValidUntil();.
        • If no feasible values can be returned, or the currency unit is still valid in the current context, null is returned for the time period methods.
        • the implementation of CurrencyUnit by java.util.Currency should always return null for both methods as a default.
        • SPI implementation may create additional instances of CurrencyUnit also for the ISO-4217 namespace, that reflect the currency duration as defined also by ISO.
      • A CurrencyUnit has a boolean flag if it has a legal tender.
      • Finally a CurrencyUnit can be a real or a virtual currency, modelled by the boolean isVirtual() method.
      • a Currencynit extends AttributeProvider, which allows to provide additional arbitrary attributes. This is required since complex use cases, such as not clearly defined ISO codes and legal tenders may require passing additional information, that can not be fully covered by this JSR.
      • The implementations of CurrencyUnit must implement Comparable<CurrencyUnit>, whereas the interface does not define this requirements due to decoupling aspects.

      Access
      Instances of CurrencyUnit can be obtained

      • by using the CurrencyProvider available on the Monetary singleton. This allows to support more complex use cases, e.g. classification based access, historic currencies and alternate namespaces.
      • by using the static factory method on java.util.Currency instance (the JDK class must, of course, implement CurrencyUnit.

        Activity

        atsticks created issue -
        atsticks made changes -
        Field Original Value New Value
        Summary Interfaces for currency and money suitable for all target applications Define a flexible abstraction for currency
        Assignee atsticks [ atsticks ]
        Fix Version/s 0.2.0 [ 16317 ]
        Description Provide interfaces for currencies and monetary amounts. Provide an interface and a value type for a {{CurrencyUnit}}, which provides the following functionality:
        * the {{CurrencyUnit}} interface modelled does not define any methods for changing the internal state.
        * the value type must be final and immutable, and implement the {{CurrencyUnit}} interface.
        * {{CurrencyUnit}}may have different namespaces, e.g. 'ISO-4217' (default), but also arbitrary others are supported.
        * the namespace of a {{CurrencyUnit}} can be accessed by a corresponding getter method.
        * a {{CurrencyUnit}} must have a unique literal currency code unique within the namespace.
        * a {{CurrencyUnit}} provides the basic non localized methods similar to {{java.util.Currency}} for maximal backwards compatibility.
        * a {{CurrencyUnit}} has a time period defined, when it is valid. This is modelled by {{Long getValidFrom();}} and {{Long getValidUntil();}}.
        ** If no feasible values can be returned, or the currency unit is still valid in the current context, {{null}} is returned for the time period methods.
        ** the implementation of {{CurrencyUnit}} by {{java.util.Currency}} should always return {{null}} for both methods as a default.
        ** SPI implementation may create additional instances of {{CurrencyUnit}} also for the ISO-4217 namespace, that reflect the currency duration as defined also by ISO.
        Tags api Currency CurrencyUnit multi-curency time_handling
        atsticks made changes -
        Description Provide an interface and a value type for a {{CurrencyUnit}}, which provides the following functionality:
        * the {{CurrencyUnit}} interface modelled does not define any methods for changing the internal state.
        * the value type must be final and immutable, and implement the {{CurrencyUnit}} interface.
        * {{CurrencyUnit}}may have different namespaces, e.g. 'ISO-4217' (default), but also arbitrary others are supported.
        * the namespace of a {{CurrencyUnit}} can be accessed by a corresponding getter method.
        * a {{CurrencyUnit}} must have a unique literal currency code unique within the namespace.
        * a {{CurrencyUnit}} provides the basic non localized methods similar to {{java.util.Currency}} for maximal backwards compatibility.
        * a {{CurrencyUnit}} has a time period defined, when it is valid. This is modelled by {{Long getValidFrom();}} and {{Long getValidUntil();}}.
        ** If no feasible values can be returned, or the currency unit is still valid in the current context, {{null}} is returned for the time period methods.
        ** the implementation of {{CurrencyUnit}} by {{java.util.Currency}} should always return {{null}} for both methods as a default.
        ** SPI implementation may create additional instances of {{CurrencyUnit}} also for the ISO-4217 namespace, that reflect the currency duration as defined also by ISO.
        Provide an interface and a value type for a {{CurrencyUnit}}, which provides the following functionality:
        * the {{CurrencyUnit}} interface modelled does not define any methods for changing the internal state.
        * the value type must be final and immutable, and implement the {{CurrencyUnit}} interface.
        * {{CurrencyUnit}} may have different namespaces, e.g. 'ISO-4217' (default), but also arbitrary others are supported.
        * the namespace of a {{CurrencyUnit}} can be accessed by a corresponding method {{String getNamespace()}}.
        * a {{CurrencyUnit}} must have a unique literal currency code unique within the namespace, accessible by a method {{String getCurrencyCode()}}.
        * a {{CurrencyUnit}} provides the basic non localized methods similar to {{java.util.Currency}} for maximal backwards compatibility:
        ** {{int getNumericCode()}} Gets a numeric currency code. Hereby -1 is returned if no numeric code is available for an instance.
        ** {{int getDefaultFractionDigits()}}, Gets the number of fractional digits typically used by a currency. -1 is returned if no such value is available for an instance
        * a {{CurrencyUnit}} has a time period defined, when it is valid. This is modelled by {{Long getValidFrom();}} and {{Long getValidUntil();}}.
        ** If no feasible values can be returned, or the currency unit is still valid in the current context, {{null}} is returned for the time period methods.
        ** the implementation of {{CurrencyUnit}} by {{java.util.Currency}} should always return {{null}} for both methods as a default.
        ** SPI implementation may create additional instances of {{CurrencyUnit}} also for the ISO-4217 namespace, that reflect the currency duration as defined also by ISO.
        * Finally a {{CurrencyUnit}} can be a real or a virtual currency, modelled by the {{boolean isVirtual()}} method.
        * a {{Currencynit}} extends {{AttributeProvider}}, which allows to provide additional arbitrary attributes. This is required since complex use cases, such as not clearly defined ISO codes and legal tenders may require passing additional information, that can not be fully covered by this JSR.
        * The implementations of {{CurrencyUnit}} must implement {{Comparable<CurrencyUnit>}}, whereas the interface does not define this requirements due to decoupling aspects.
        atsticks made changes -
        Summary Define a flexible abstraction for currency Abstraction for Currencies
        atsticks made changes -
        Description Provide an interface and a value type for a {{CurrencyUnit}}, which provides the following functionality:
        * the {{CurrencyUnit}} interface modelled does not define any methods for changing the internal state.
        * the value type must be final and immutable, and implement the {{CurrencyUnit}} interface.
        * {{CurrencyUnit}} may have different namespaces, e.g. 'ISO-4217' (default), but also arbitrary others are supported.
        * the namespace of a {{CurrencyUnit}} can be accessed by a corresponding method {{String getNamespace()}}.
        * a {{CurrencyUnit}} must have a unique literal currency code unique within the namespace, accessible by a method {{String getCurrencyCode()}}.
        * a {{CurrencyUnit}} provides the basic non localized methods similar to {{java.util.Currency}} for maximal backwards compatibility:
        ** {{int getNumericCode()}} Gets a numeric currency code. Hereby -1 is returned if no numeric code is available for an instance.
        ** {{int getDefaultFractionDigits()}}, Gets the number of fractional digits typically used by a currency. -1 is returned if no such value is available for an instance
        * a {{CurrencyUnit}} has a time period defined, when it is valid. This is modelled by {{Long getValidFrom();}} and {{Long getValidUntil();}}.
        ** If no feasible values can be returned, or the currency unit is still valid in the current context, {{null}} is returned for the time period methods.
        ** the implementation of {{CurrencyUnit}} by {{java.util.Currency}} should always return {{null}} for both methods as a default.
        ** SPI implementation may create additional instances of {{CurrencyUnit}} also for the ISO-4217 namespace, that reflect the currency duration as defined also by ISO.
        * Finally a {{CurrencyUnit}} can be a real or a virtual currency, modelled by the {{boolean isVirtual()}} method.
        * a {{Currencynit}} extends {{AttributeProvider}}, which allows to provide additional arbitrary attributes. This is required since complex use cases, such as not clearly defined ISO codes and legal tenders may require passing additional information, that can not be fully covered by this JSR.
        * The implementations of {{CurrencyUnit}} must implement {{Comparable<CurrencyUnit>}}, whereas the interface does not define this requirements due to decoupling aspects.
        Provide an interface and a value type for a {{CurrencyUnit}}, which provides the following functionality:
        * the {{CurrencyUnit}} interface modelled does not define any methods for changing the internal state.
        * the value type must be final and immutable, and implement the {{CurrencyUnit}} interface.
        * {{CurrencyUnit}} may have different namespaces, e.g. 'ISO-4217' (default), but also arbitrary others are supported.
        * the namespace of a {{CurrencyUnit}} can be accessed by a corresponding method {{String getNamespace()}}.
        * a {{CurrencyUnit}} must have a unique literal currency code unique within the namespace, accessible by a method {{String getCurrencyCode()}}.
        * a {{CurrencyUnit}} provides the basic non localized methods similar to {{java.util.Currency}} for maximal backwards compatibility:
        ** {{int getNumericCode()}} Gets a numeric currency code. Hereby -1 is returned if no numeric code is available for an instance.
        ** {{int getDefaultFractionDigits()}}, Gets the number of fractional digits typically used by a currency. -1 is returned if no such value is available for an instance
        * a {{CurrencyUnit}} has a time period defined, when it is valid. This is modelled by {{Long getValidFrom();}} and {{Long getValidUntil();}}.
        ** If no feasible values can be returned, or the currency unit is still valid in the current context, {{null}} is returned for the time period methods.
        ** the implementation of {{CurrencyUnit}} by {{java.util.Currency}} should always return {{null}} for both methods as a default.
        ** SPI implementation may create additional instances of {{CurrencyUnit}} also for the ISO-4217 namespace, that reflect the currency duration as defined also by ISO.
        * A {{CurrencyUnit}} has a boolean flag if it has a legal tender.
        * Finally a {{CurrencyUnit}} can be a real or a virtual currency, modelled by the {{boolean isVirtual()}} method.
        * a {{Currencynit}} extends {{AttributeProvider}}, which allows to provide additional arbitrary attributes. This is required since complex use cases, such as not clearly defined ISO codes and legal tenders may require passing additional information, that can not be fully covered by this JSR.
        * The implementations of {{CurrencyUnit}} must implement {{Comparable<CurrencyUnit>}}, whereas the interface does not define this requirements due to decoupling aspects.
        atsticks made changes -
        Description Provide an interface and a value type for a {{CurrencyUnit}}, which provides the following functionality:
        * the {{CurrencyUnit}} interface modelled does not define any methods for changing the internal state.
        * the value type must be final and immutable, and implement the {{CurrencyUnit}} interface.
        * {{CurrencyUnit}} may have different namespaces, e.g. 'ISO-4217' (default), but also arbitrary others are supported.
        * the namespace of a {{CurrencyUnit}} can be accessed by a corresponding method {{String getNamespace()}}.
        * a {{CurrencyUnit}} must have a unique literal currency code unique within the namespace, accessible by a method {{String getCurrencyCode()}}.
        * a {{CurrencyUnit}} provides the basic non localized methods similar to {{java.util.Currency}} for maximal backwards compatibility:
        ** {{int getNumericCode()}} Gets a numeric currency code. Hereby -1 is returned if no numeric code is available for an instance.
        ** {{int getDefaultFractionDigits()}}, Gets the number of fractional digits typically used by a currency. -1 is returned if no such value is available for an instance
        * a {{CurrencyUnit}} has a time period defined, when it is valid. This is modelled by {{Long getValidFrom();}} and {{Long getValidUntil();}}.
        ** If no feasible values can be returned, or the currency unit is still valid in the current context, {{null}} is returned for the time period methods.
        ** the implementation of {{CurrencyUnit}} by {{java.util.Currency}} should always return {{null}} for both methods as a default.
        ** SPI implementation may create additional instances of {{CurrencyUnit}} also for the ISO-4217 namespace, that reflect the currency duration as defined also by ISO.
        * A {{CurrencyUnit}} has a boolean flag if it has a legal tender.
        * Finally a {{CurrencyUnit}} can be a real or a virtual currency, modelled by the {{boolean isVirtual()}} method.
        * a {{Currencynit}} extends {{AttributeProvider}}, which allows to provide additional arbitrary attributes. This is required since complex use cases, such as not clearly defined ISO codes and legal tenders may require passing additional information, that can not be fully covered by this JSR.
        * The implementations of {{CurrencyUnit}} must implement {{Comparable<CurrencyUnit>}}, whereas the interface does not define this requirements due to decoupling aspects.
        Provide an interface and a value type for a {{CurrencyUnit}}, which provides the following functionality:
        * the {{CurrencyUnit}} interface modelled does not define any methods for changing the internal state.
        * the value type must be final and immutable, and implement the {{CurrencyUnit}} interface.
        * {{CurrencyUnit}} may have different namespaces, e.g. 'ISO-4217' (default), but also arbitrary others are supported.
        * the namespace of a {{CurrencyUnit}} can be accessed by a corresponding method {{String getNamespace()}}.
        * a {{CurrencyUnit}} must have a unique literal currency code unique within the namespace, accessible by a method {{String getCurrencyCode()}}.
        * a {{CurrencyUnit}} provides the basic non localized methods similar to {{java.util.Currency}} for maximal backwards compatibility:
        ** {{int getNumericCode()}} Gets a numeric currency code. Hereby -1 is returned if no numeric code is available for an instance.
        ** {{int getDefaultFractionDigits()}}, Gets the number of fractional digits typically used by a currency. -1 is returned if no such value is available for an instance
        * a {{CurrencyUnit}} has a time period defined, when it is valid. This is modelled by {{Long getValidFrom();}} and {{Long getValidUntil();}}.
        ** If no feasible values can be returned, or the currency unit is still valid in the current context, {{null}} is returned for the time period methods.
        ** the implementation of {{CurrencyUnit}} by {{java.util.Currency}} should always return {{null}} for both methods as a default.
        ** SPI implementation may create additional instances of {{CurrencyUnit}} also for the ISO-4217 namespace, that reflect the currency duration as defined also by ISO.
        * A {{CurrencyUnit}} has a boolean flag if it has a legal tender.
        * Finally a {{CurrencyUnit}} can be a real or a virtual currency, modelled by the {{boolean isVirtual()}} method.
        * a {{Currencynit}} extends {{AttributeProvider}}, which allows to provide additional arbitrary attributes. This is required since complex use cases, such as not clearly defined ISO codes and legal tenders may require passing additional information, that can not be fully covered by this JSR.
        * The implementations of {{CurrencyUnit}} must implement {{Comparable<CurrencyUnit>}}, whereas the interface does not define this requirements due to decoupling aspects.

        *Access*
        Instances of {{CurrencyUnit}} can be obtained
        * by using the {{CurrencyProvider}} available on the {{Monetary}} singleton. This allows to support more complex use cases, e.g. classification based access, historic currencies and alternate namespaces.
        * by using the static factory method on {{java.util.Currency}} instance (the JDK class must, of course, implement {{CurrencyUnit}}.
        keilw made changes -
        Original Estimate 0 minutes [ 0 ]
        Remaining Estimate 0 minutes [ 0 ]
        Fix Version/s 0.2.0 [ 16317 ]
        keilw made changes -
        Affects Version/s 1.0-b01 [ 16318 ]
        atsticks made changes -
        Fix Version/s 0.3 [ 16322 ]
        keilw made changes -
        Fix Version/s 0.4-EDR1 [ 16318 ]
        Fix Version/s 0.3 [ 16322 ]
        Affects Version/s 0.3 [ 16322 ]
        Affects Version/s 0.4-EDR1 [ 16318 ]
        keilw made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        atsticks made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: