Skip to main content

[JSR-354] Validations API and queries

  • From: Anatole Tresch <atsticks@...>
  • To: Jsr 354 JavaMoney Public Mailinglist <jcurrency_mail@...>
  • Subject: [JSR-354] Validations API and queries
  • Date: Sun, 25 Aug 2013 15:51:03 +0200

Dear colleagues

my last mail needs an additional update. I had to change/adapt the Java
artifacts I sent yesterday in some areas, but the basic proposal seems
quite interesting and still remains the same (and now also should be
working). As an example below, you see the query for currency validities:

All Currencies for Germany:
---------------------------

Validities.getValidityInfo(new RelatedValidityQuery(CurrencyUnit.class,
Region.class)
 .withRelatedToPredicate(
           InstancesPredicate.of(Regions.getRegion(Locale.GERMANY))
)));

Of for legal tenders:

Legal tender currencies for Germany:
------------------------------------

Validities.getValidityInfo(new RelatedValidityQuery(CurrencyUnit.class,
Region.class)
 .withRelatedToPredicate(
           InstancesPredicate.of(Regions.getRegion(Locale.GERMANY))
        .withValidityType(ValidityType.of("legal"))
)));

One of the changes is that I use predicats instead of fixed sets of items
for constraint the results returned by validity queries...
I have to continue working on it later.

Cheers
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/*
*Google: atsticks
Mobile  +41-76 344 62 79*


[JSR-354] Validations API and queries

Anatole Tresch 08/25/2013
 
 
Close
loading
Please Confirm
Close