Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any java Enum of european countries and languages?

Is there any java (>5) enum for listing european countries and languages somewhere? If there aren't any, I'll probably write them from this list : http://www.nationsonline.org/oneworld/european_languages.htm

But if I could avoid that burden, that would be great!

P.S.: Finally, I'm starting to use the geoNames webservice at geonames.org. For the countries I use this snippet in Groovy :

import org.geonames.*

ToponymSearchCriteria sc = new ToponymSearchCriteria()
sc.setContinentCode("eu")
sc.setFeatureCode("PCLI")
def res = WebService.search(sc)
def countries = res.getToponyms().collect{it.countryName}.sort()
like image 359
Philippe Avatar asked Aug 14 '10 21:08

Philippe


1 Answers

It is unlikely that professional framework designers will include such an Enum in their library, because the set of countries (and the set of politically-recognised official languages) changes all the time. You’d either have to break backwards-compatibility, making the Enum rather useless for software that is supposed to work for longer than a few years, or you’d have to keep old, no-longer-recognised countries and languages in the Enum.

like image 157
Timwi Avatar answered Sep 26 '22 20:09

Timwi