Issue Details (XML | Word | Printable)

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

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

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

Created: 11/Feb/13 11:54 AM   Updated: 08/Aug/13 06:04 AM   Resolved: 12/Feb/13 12:55 AM
Component/s: API
Affects Version/s: None
Fix Version/s: 0.3

Time Tracking:
Not Specified

Environment:

javax.money. interface CurrencyUnitProvider


Tags: adoptajsr jugchennai
Participants: atsticks and Rajmahendra Hegde


 Description  « Hide

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.



atsticks added a comment - 11/Feb/13 12:29 PM - 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.


atsticks added a comment - 12/Feb/13 12:54 AM

Methods were added on interfaces and test/RI implementations.


Rajmahendra Hegde added a comment - 12/Feb/13 09:32 AM

@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


atsticks added a comment - 12/Feb/13 09:58 AM

This may be similarly useful, yes.


Rajmahendra Hegde added a comment - 12/Feb/13 10:28 AM

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