parse static method

IsoCountry parse(
  1. String source
)

Parses source as Alpha-2, alpha-3 or numeric country code The source must be either 2-3 ASCII uppercase letters of alpha code, or 2-3 digits of numeric code Throws FormatException if the code is not valid country code

Implementation

static IsoCountry parse(String source) {
  final country = tryParse(source);
  if (country == null)
    throw FormatException("Invalid or non-assigned code", source);

  return country;
}