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 8841af8
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 27 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
28 changes: 13 additions & 15 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 @@ -21,17 +22,15 @@ public enum Agreement {
* 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>.
* Last verification date of this list can be seen in the {@code @LastVerification} value.
*
* @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 @@ -41,13 +40,13 @@ public enum Agreement {
* 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>.
* Last verification date of this list can be seen in the {@code @LastVerification} value.
*
* @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 @@ -56,19 +55,19 @@ public enum Agreement {
* and only those matters, where members have agreed to act as one.
*
* <p>
* <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.
* Last verification date of this list can be seen in the {@code @LastVerification} value.
*
* <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>.
* <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.
*
* @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 @@ -79,13 +78,13 @@ public enum Agreement {
* 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>.
* Last verification date of this list can be seen in the {@code @LastVerification} value.
*
* @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),

/**
Expand All @@ -94,16 +93,15 @@ public enum Agreement {
* 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>.
* Last verification date of this list can be seen in the {@code @LastVerification} value.
*
* @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
8 changes: 5 additions & 3 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 @@ -28,8 +30,7 @@
* </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.
* Last verification date of this list can be seen in the {@code @LastVerification} value.
*
* <p>
* Usage:
Expand All @@ -46,6 +47,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
12 changes: 7 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 @@ -25,6 +22,9 @@
* </ul>
*
* <p>
* Last verification date of this list can be seen in the {@code @LastVerification} value.
*
* <p>
* Usage:
*
* <pre>
Expand All @@ -36,9 +36,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,25 @@
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 8841af8

Please sign in to comment.