/** * Get a list of {@code LocaleCode} instances whose country matches the given one. * * @param country * {@code CountryCode} instance that represents a country. * * @return * List of {@code LocaleCode} instances. If there is no {@code LocaleCode} * instance whose country matches the given one, the size of the returned * list is zero. * * @since 1.3 */ public static List<LocaleCode> getByCountry(CountryCode country) { List<LocaleCode> list = new ArrayList<LocaleCode>(); if (country == null) { return list; } for (LocaleCode code : values()) { if (code.getCountry() == country) { list.add(code); } } return list; }
/** * Get a list of {@code LocaleCode} instances whose country matches the given one. * * @param country * {@code CountryCode} instance that represents a country. * * @return * List of {@code LocaleCode} instances. If there is no {@code LocaleCode} * instance whose country matches the given one, the size of the returned * list is zero. * * @since 1.3 */ public static List<LocaleCode> getByCountry(CountryCode country) { List<LocaleCode> list = new ArrayList<LocaleCode>(); if (country == null) { return list; } for (LocaleCode code : values()) { if (code.getCountry() == country) { list.add(code); } } return list; }