Class CountryCodeValidator


  • public class CountryCodeValidator
    extends Object
    Validates ISO 3166-1 alpha-2 country codes.
    • Method Detail

      • validate

        public static List<String> validate​(List<String> countryCodes)
        Validates the list of country codes and returns a normalized copy.
        Parameters:
        countryCodes - input list
        Returns:
        normalized copy of the input list converted to upper case and without duplicates
        Throws:
        NullPointerException - if the list is null or if any of its elements is null
        IllegalArgumentException - if any of the elements is not an ISO 3166-1 alpha-2 country code