Skip to main content

[JSR-354] Re: Getting a name method into CurrencyUnit

  • From: Stephen Colebourne <scolebourne@...>
  • To: jcurrency_mail@...
  • Subject: [JSR-354] Re: Getting a name method into CurrencyUnit
  • Date: Wed, 17 Apr 2013 13:03:41 +0100

There is no real need for a getName() in CurrencyUnit. getName() in 310 provides a human readable version of enum constants for error messages. I don't think the same applies for currency.

Localization should be via getDisplayName().
Identification should be via one of more getters, such as getCurrencyCode().

Stephen


On 17 April 2013 12:47, Werner Keil <werner.keil@...> wrote:
Hi,

I saw, Anatole just removed LocalizableCurrencyUnit. Good stuff, but for the usefulness of CurrencyUnit itself, it must also provide some sort of name.
Whether we rather strictly follow the pattern of JSR 310 TemporalUnit here and call it getName()
(note, the TemporalUnit interface has even a convenience method toString() exposing every concrete class' toString() to the interface as well, normally that and getName() might be the same, but toString() may of course add other information if necessary

or keep only the no-op getDisplayName() from java.util.Currency, I don't really mind either option. Btw. the Chronology base class of 310 did follow a recommendation I made in the 310 tracker http://download.java.net/jdk8/docs/api/java/time/chrono/Chronology.html and renamed a somewhat inconsistent getText(Locale) into getDisplayName(DisplayStyle, Locale). There is no "default" method here, but the "model" or "value" type Chronology contains UI and i18n related methods like getDisplayName, too in 310, so we might as well have either the default one or both in CurrencyUnit. 

Unless a breach with java.util.Currency is preferred, in which case I'd suggest we add getName().

Cheers,
Werner



[JSR-354] Getting a name method into CurrencyUnit

Werner Keil 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Stephen Colebourne 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Anatole Tresch 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Simon Martinelli 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Simon Martinelli 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013
 
 
Close
loading
Please Confirm
Close