javamoney
  1. javamoney
  2. JAVAMONEY-31

Adding two get methods to CurrencyUnitProvider to make the String namespace parameter as default to 'ISO-4217'

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.3
    • Component/s: API
    • Labels:
      None
    • Environment:

      javax.money. interface CurrencyUnitProvider

      Description

      Currently CurrencyUnitProvider provides two get method with parameter (String namespace, String code) and (String namespace, String code, long timestamp). Both these method mostly user need to specify a namespace and code. If we provide a get method without namespace, we can minimize the entry of namespace. The provider can give a default namespace to the API.

      So we can provide two get method as
      public CurrencyUnit get(String code);
      public CurrencyUnit get(String code, long timestamp);

      for the current RI we can can make the namespace to "ISO-4217" as default value.

        Activity

        Hide
        atsticks added a comment - - edited

        That's a good point, convenience also is important. Additionally I would add a method:

        String getDefaultNamespace();
        

        Also not that timestamp currently is modelled as Long not long for enabling passing null as undefined value.

        Additionally default namespace can be changed by setting a system property: -Djavax.money.defaultCurrencyNamespace=whateverNS.

        Show
        atsticks added a comment - - edited That's a good point, convenience also is important. Additionally I would add a method: String getDefaultNamespace(); Also not that timestamp currently is modelled as Long not long for enabling passing null as undefined value. Additionally default namespace can be changed by setting a system property: -Djavax.money.defaultCurrencyNamespace=whateverNS .
        Hide
        atsticks added a comment -

        Methods were added on interfaces and test/RI implementations.

        Show
        atsticks added a comment - Methods were added on interfaces and test/RI implementations.
        Hide
        Rajmahendra Hegde added a comment -

        @atsticks I just saw this now.. sorry..

        What about if we do the same way to isAvailable method also?

        We have one method

         
        public boolean isNamespaceAvailable(String namespace);   //this is meaningful
        

        but for other isAvailable method, we can give methods without the namespace parameter

        Show
        Rajmahendra Hegde added a comment - @atsticks I just saw this now.. sorry.. What about if we do the same way to isAvailable method also? We have one method public boolean isNamespaceAvailable( String namespace); // this is meaningful but for other isAvailable method, we can give methods without the namespace parameter
        Hide
        atsticks added a comment -

        This may be similarly useful, yes.

        Show
        atsticks added a comment - This may be similarly useful, yes.
        Hide
        Rajmahendra Hegde added a comment -

        Cool then I will update the description to incorporate this changes also.

        Show
        Rajmahendra Hegde added a comment - Cool then I will update the description to incorporate this changes also.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: