Skip to content

Commit

Permalink
Add @LastVerification to document the last verification date of a list (
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwrobel committed Jul 20, 2022
1 parent 07d2c9a commit a836c15
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Enable experimental alerts for CodeQL (#145).
- Set up Maven dependencies caching (#143).
- Add a [`CODEOWNERS`](/CODEOWNERS) (#142).
- Add `@LastVerification` to document the last verification date of a list (#152).

### Thanks
29 changes: 6 additions & 23 deletions src/main/java/fr/marcwrobel/jbanking/Agreement.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static fr.marcwrobel.jbanking.IsoCountry.*;
import static java.util.Collections.unmodifiableSet;

import fr.marcwrobel.jbanking.internal.LastVerification;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.Set;
Expand All @@ -20,18 +21,13 @@ public enum Agreement {
* agreement which enables the extension of the European Union's single market to member states of the European Free Trade
* Association.
*
* <p>
* This enum was last updated on 2022-07-20 based on information given on
* <a href=
* "https://ec.europa.eu/eurostat/statistics-explained/index.php/Glossary%3AEuropean_Economic_Area_%28EEA%29">europa.eu -
* European Economic Area (EEA)</a>.
*
* @see <a href=
* "https://ec.europa.eu/eurostat/statistics-explained/index.php/Glossary%3AEuropean_Economic_Area_%28EEA%29">europa.eu -
* European Economic Area (EEA)</a>
* @see <a href="https://wikipedia.org/wiki/European_Economic_Area">Wikipedia - European Economic Area</a>
* @since 2.1.0
*/
@LastVerification("2022-07-20")
EUROPEAN_ECONOMIC_AREA(AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LI, LT, LU, MT, NL, NO,
PL, PT, RO, SK, SI, ES, SE, CH),

Expand All @@ -40,14 +36,11 @@ public enum Agreement {
* in parallel with the European Union (EU), and all member states participate in the European Single Market and are part of
* the Schengen Area. They are not, however, party to the European Union Customs Union.
*
* <p>
* This enum was last updated on 2022-07-20 based on information given on
* <a href="https://www.efta.int/about-efta/the-efta-states">efta.int - The EFTA States</a>.
*
* @see <a href="https://www.efta.int/about-efta/the-efta-states">efta.int - The EFTA States</a>
* @see <a href="https://wikipedia.org/wiki/European_Free_Trade_Association">Wikipedia - European Free Trade Association</a>
* @since 2.1.0
*/
@LastVerification("2022-07-20")
EUROPEAN_FREE_TRADE_ASSOCIATION(IS, LI, NO, CH),

/**
Expand All @@ -59,16 +52,13 @@ public enum Agreement {
* <a href="https://wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union">Special member state
* territories</a> are not listed in this enum.
*
* <p>
* This enum was last updated on 2022-07-20 based on information given on
* <a href="https://europa.eu/european-union/about-eu/countries_en">europa.eu - Countries</a>.
*
* @see <a href="https://europa.eu/european-union/about-eu/countries_en">europa.eu - Countries</a>
* @see <a href="https://wikipedia.org/wiki/European_Union">Wikipedia - European Union</a>
* @see <a href="https://wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union">Wikipedia - Special
* member state territories and the European Union</a>
* @since 2.1.0
*/
@LastVerification("2022-07-20")
EUROPEAN_UNION(AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI,
ES, SE),

Expand All @@ -78,32 +68,25 @@ public enum Agreement {
* outside the SEPA zone, namely French Polynesia, New Caledonia, Wallis and Futuna, the CFONB has defined a solution called
* SEPA COM PACIFIQUE.
*
* <p>
* This enum was last updated on 2022-07-20 based on information given in the CFONB article
* <a href="https://www.cfonb.org/sepa/leuro-et-les-territoires-du-pacifique">Le SEPA et les territoires du Pacifique</a>.
*
* @see <a href="https://www.cfonb.org/sepa/leuro-et-les-territoires-du-pacifique">Le SEPA et les territoires du Pacifique</a>
* @see <a href="https://wikipedia.org/wiki/Single_Euro_Payments_Area">Wikipedia</a>
* @since 2.1.0
*/
@LastVerification("2022-07-20")
SEPA_COM_PACIFIQUE(PF, NC, WF),

/**
* The Single Euro Payments Area (SEPA) is a payment-integration initiative of the European Union for simplification of bank
* transfers denominated in euro. The aim of SEPA is to improve the efficiency of cross-border payments and turn the
* previously fragmented national markets for euro payments into a single domestic one.
*
* <p>
* This enum was last updated on 2022-07-20 based on information given in
* <a href="https://www.europeanpaymentscouncil.eu/document-library/other/epc-list-sepa-scheme-countries">EPC409-09 - EPC List
* of SEPA Countries v2.6</a>.
*
* @see <a href="https://www.europeanpaymentscouncil.eu/document-library/other/epc-list-sepa-scheme-countries">EPC409-09 EPC
* List of SEPA Countries v4.0 - February 2021</a>
* @see <a href="https://www.iso13616.org/">IBAN registry</a>
* @see <a href="https://wikipedia.org/wiki/Single_Euro_Payments_Area">Wikipedia</a>
* @since 2.1.0
*/
@LastVerification("2022-07-20")
SINGLE_EURO_PAYMENTS_AREA(
// EU countries
AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE,
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/fr/marcwrobel/jbanking/IsoCountry.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static java.util.Objects.requireNonNull;

import fr.marcwrobel.jbanking.internal.LastVerification;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -11,7 +12,8 @@
/**
* The countries, dependent territories, and special areas of geographical interest having an
* <a href="https://wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements">Officially assigned</a> ISO 3166-1
* code.
* code, <a href="https://www.iso.org/iso-3166-country-codes.html">as defined by International Organization for
* Standardization</a>.
*
* <p>
* One exception has been made for Kosovo. Kosovo has a user-assigned code, XK, that is being used temporarily by the European
Expand All @@ -26,10 +28,7 @@
* <li>make this enum easier to serialize (to JSON, in database...),
* <li>prevent accidental duplicates.
* </ul>
*
* <p>
* This enum was last updated on 2022-07-20 based on information given in
* <a href="https://www.iso.org/iso-3166-country-codes.html">International Organization for Standardization</a> website.
* .
*
* <p>
* Usage:
Expand All @@ -46,6 +45,7 @@
* @see <a href="https://www.iso.org/iso-3166-country-codes.html">ISO 3166 Country Codes</a>
* @since 1.0
*/
@LastVerification("2022-07-20")
public enum IsoCountry {
/**
* Afghanistan (aka the Islamic Republic of Afghanistan).
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/fr/marcwrobel/jbanking/IsoCurrency.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
import static java.util.Collections.unmodifiableSet;
import static java.util.Objects.requireNonNull;

import fr.marcwrobel.jbanking.internal.LastVerification;
import java.util.*;

/**
* The currencies having an ISO 4217 code.
*
* <p>
* Please be advised that this list is current as of 2013/05/26. Up-to-date list can be found for free on the
* <a href="https://www.currency-iso.org/en/home/tables/table-a1.html"> currency-iso.org</a>.
*
* <p>
* Note that enum entries are named after the ISO 4217 alphabetic code. This choice has been made in version 3.0.0 of jbanking
* in order to :
*
Expand All @@ -36,9 +33,11 @@
* Assertion.assertTrue(currency.getCountries().contains(FR));
* </pre>
*
* @see <a href="https://www.currency-iso.org/en/home/tables/table-a1.html">currency-iso.org</a>
* @see <a href="https://www.currency-iso.org/en/home/tables/table-a1.html">ISO 4217 - Currency Code Maintenance - Current
* Currency &amp; Funds - List One</a>
* @since 1.0
*/
@LastVerification("2022-04-20")
public enum IsoCurrency {
/**
* ADB (African Development Bank) Unit of Account.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package fr.marcwrobel.jbanking.internal;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.*;

/**
* Document the last verification date of a list (of countries, of currencies...).
*
* <p>
* This enum is for jbanking internal use only : do not use it in your code !
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(value = { CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE })
public @interface LastVerification {

/**
* Returns the last verification date of the annotated element.
* @return a non null date formatted as {@code yyyy-MM-dd} (e.g. 2022-07-20).
*/
String value();
}
5 changes: 1 addition & 4 deletions src/test/java/fr/marcwrobel/jbanking/IsoCurrencyTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package fr.marcwrobel.jbanking;

import static fr.marcwrobel.jbanking.IsoCurrency.*;
import static fr.marcwrobel.jbanking.IsoCurrency.Category.FUND;
import static fr.marcwrobel.jbanking.IsoCurrency.Category.METAL;
import static fr.marcwrobel.jbanking.IsoCurrency.Category.NATIONAL;
import static fr.marcwrobel.jbanking.IsoCurrency.EUR;
import static fr.marcwrobel.jbanking.IsoCurrency.USS;
import static fr.marcwrobel.jbanking.IsoCurrency.XAU;
import static fr.marcwrobel.jbanking.IsoCurrency.fromAlphabeticCode;
import static java.util.Arrays.stream;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand Down

0 comments on commit a836c15

Please sign in to comment.