popValue function

Country popValue(
  1. String name
)

Returns the corresponding Country enum value based on the provided country name. If the provided name does not match any known country, the default Country value (United States) is returned.

@param name The name of the country to retrieve the enum value for. @return The corresponding Country enum value for the given country name.

Implementation

Country popValue(String name) {
  switch (name) {
    case 'Kenya':
      return Country.kenya;
    case 'Uganda':
      return Country.uganda;
    case 'Tanzania':
      return Country.tanzania;
    case 'Belgium':
      return Country.belgium;
    case 'United Kingdom':
      return Country.uk;
    default:
      return Country.us;
  }
}