Package com.maxmind.geoip2.record
Class Country
- java.lang.Object
-
- com.maxmind.geoip2.record.AbstractRecord
-
- com.maxmind.geoip2.record.AbstractNamedRecord
-
- com.maxmind.geoip2.record.Country
-
- Direct Known Subclasses:
RepresentedCountry
public class Country extends AbstractNamedRecord
Contains data for the country record associated with an IP address.
This record is returned by all the end points.
Do not use any of the country names as a database or map key. Use the value returned by
AbstractNamedRecord.getGeoNameId()
orgetIsoCode()
instead.
-
-
Constructor Summary
Constructors Constructor Description Country()
Country(Country country, List<String> locales)
Country(List<String> locales, Integer confidence, Integer geoNameId, boolean isInEuropeanUnion, String isoCode, Map<String,String> names)
Country(List<String> locales, Integer confidence, Integer geoNameId, String isoCode, Map<String,String> names)
Country(List<String> locales, Integer confidence, Long geoNameId, Boolean isInEuropeanUnion, String isoCode, Map<String,String> names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getConfidence()
String
getIsoCode()
boolean
isInEuropeanUnion()
-
Methods inherited from class com.maxmind.geoip2.record.AbstractNamedRecord
getGeoNameId, getName, getNames
-
Methods inherited from class com.maxmind.geoip2.record.AbstractRecord
toJson, toString
-
-
-
-
Constructor Detail
-
Country
public Country()
-
Country
public Country(List<String> locales, Integer confidence, Integer geoNameId, String isoCode, Map<String,String> names)
-
Country
public Country(List<String> locales, Integer confidence, Integer geoNameId, boolean isInEuropeanUnion, String isoCode, Map<String,String> names)
-
Country
public Country(List<String> locales, Integer confidence, Long geoNameId, Boolean isInEuropeanUnion, String isoCode, Map<String,String> names)
-
-
Method Detail
-
getConfidence
public Integer getConfidence()
- Returns:
- A value from 0-100 indicating MaxMind's confidence that the country is correct. This attribute is only available from the Insights end point and the GeoIP2 Enterprise database.
-
isInEuropeanUnion
public boolean isInEuropeanUnion()
- Returns:
- This is true if the country is a member state of the European Union. This attribute is returned by all location services and databases.
-
getIsoCode
public String getIsoCode()
- Returns:
- The two-character ISO 3166-1 alpha code for the country. This attribute is returned by all end points.
-
-