popValue function
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;
case 'Nigeria':
return Country.NIGERIA;
default:
return Country.US;
}
}