Class Country

Direct Known Subclasses:
RepresentedCountry

public class Country extends AbstractNamedRecord

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 Details

    • Country

      public Country()
      Constructs an instance of Country with no data.
    • Country

      public Country(List<String> locales, Integer confidence, Long geoNameId, Boolean isInEuropeanUnion, String isoCode, Map<String,String> names)
      Constructs an instance of Country.
      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

      public Country(Country country, List<String> locales)
      Constructs an instance of Country.
      Parameters:
      country - The Country object to copy.
      locales - The locales to use.
  • Method Details

    • 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 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

      public String getIsoCode()
      Returns:
      The two-character ISO 3166-1 alpha code for the country.