java.lang.Object
com.maxmind.geoip2.record.AbstractRecord
com.maxmind.geoip2.record.AbstractNamedRecord
com.maxmind.geoip2.record.Country
- Direct Known Subclasses:
RepresentedCountry
Contains data for the country record associated with an IP address.
Do not use any of the country names as a database or map key. Use the value
returned by AbstractNamedRecord.getGeoNameId()
or getIsoCode()
instead.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Methods inherited from class com.maxmind.geoip2.record.AbstractNamedRecord
getGeoNameId, getName, getNames
Methods inherited from class com.maxmind.geoip2.record.AbstractRecord
toJson, toString
-
Constructor Details
-
Country
public Country()Constructs an instance ofCountry
with no data. -
Country
public Country(List<String> locales, Integer confidence, Long geoNameId, Boolean isInEuropeanUnion, String isoCode, Map<String, String> names) Constructs an instance ofCountry
.- Parameters:
locales
- The locales to use.confidence
- This is a value from 0-100 indicating MaxMind's confidence that the country is correct.geoNameId
- This is a GeoName ID for the country.isInEuropeanUnion
- This is true if the country is a member state of the European Union.isoCode
- This is a string up to three characters long contain the country code.names
- This is a map from locale codes to the names for the country in that locale.
-
Country
Constructs an instance ofCountry
.- Parameters:
country
- TheCountry
object to copy.locales
- The locales to use.
-
-
Method Details
-
getConfidence
- Returns:
- A value from 0-100 indicating MaxMind's confidence that the country is correct. This attribute is only available from the Insights web service and the GeoIP2 Enterprise database.
-
isInEuropeanUnion
public boolean isInEuropeanUnion()- Returns:
- This is true if the country is a member state of the European Union.
-
getIsoCode
- Returns:
- The two-character ISO 3166-1 alpha code for the country.
-