Is there a Java enum in European countries and languages?
•
Java
Are there any Java (> 5) enumerations for listing European countries and languages somewhere?
But if I can avoid this burden, it would be great!
P. S.: finally, I started at GeoNames GeoNames webservice.org For countries where 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()
Solution
Professional frame designers are unlikely to include such enums in their libraries because this group of countries (and politically recognized official language collections) has been changing You must either break backward compatibility and make enum useless for software that should have been working for more than a few years, or you must keep old, no longer recognized countries and languages in enum
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码