Skip to main content

[JSR-354] Conversion API

  • From: Anatole Tresch <atsticks@...>
  • To: Jsr 354 JavaMoney Public Mailinglist <jcurrency_mail@...>
  • Subject: [JSR-354] Conversion API
  • Date: Sun, 26 Jan 2014 04:01:36 +0100

Hi all

I added a (simplified) version of our Conversion API, that would match easy
into our API, e.g.

MonetaryAmount amtCHF = ...;
MonetaryAmount amtUSD = amt.with(MonetaryConversions.getConversion("USD"));

Nevertheless more complex cases can be modelled by passing a
ConversionContext, which allow to restrict/pass additional conversion
requirements:

ConversionContext ctx = *new *
ConversionContext.Builder("IMF").setAttribute(amt).create();
MonetaryAmount amtUSD = amt.with(MonetaryConversions.getConversion("USD",
ctx));

Have a look at it in GitHub. I plan to adapt the existing implementations
later.

Regards,
Anatole

-- 
*Anatole Tresch*
Java Lead Engineer, JSR Spec Lead
Gl√§rnischweg 10
CH - 8620 Wetzikon

*Switzerland, Europe Zurich, GMT+1*
*Twitter:  @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*

*Google: atsticksMobile  +41-76 344 62 79*


[JSR-354] Conversion API

Anatole Tresch 01/26/2014

[JSR-354] Re: Conversion API

Werner Keil 01/27/2014
 
 
Close
loading
Please Confirm
Close