[JAVAMONEY-31] Adding two get methods to CurrencyUnitProvider to make the String namespace parameter as default to 'ISO-4217' Created: 11/Feb/13  Updated: 08/Aug/13  Resolved: 12/Feb/13

Status: Closed
Project: javamoney
Component/s: API
Affects Version/s: None
Fix Version/s: 0.3

Type: New Feature Priority: Minor
Reporter: Rajmahendra Hegde Assignee: atsticks
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

javax.money. interface CurrencyUnitProvider

Tags: adoptajsr, jugchennai


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.

Comment by atsticks [ 11/Feb/13 ]

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.

Comment by atsticks [ 12/Feb/13 ]

Methods were added on interfaces and test/RI implementations.

Comment by Rajmahendra Hegde [ 12/Feb/13 ]

@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

Comment by atsticks [ 12/Feb/13 ]

This may be similarly useful, yes.

Comment by Rajmahendra Hegde [ 12/Feb/13 ]

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

Generated at Mon Jan 16 20:35:16 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.