java.lang.Object
com.maxmind.geoip2.record.AbstractRecord
com.maxmind.geoip2.record.AbstractNamedRecord
com.maxmind.geoip2.record.City
City-level data associated with an IP address.
Do not use any of the city names as a database or map key. Use the value
returned by AbstractNamedRecord.getGeoNameId()
instead.
-
Constructor Summary
-
Method Summary
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
-
City
public City()Constructs an instance ofCity
with no data. -
City
Constructs an instance ofCity
with the specified parameters.- Parameters:
locales
- The locales to use.confidence
- A value from 0-100 indicating MaxMind's confidence that the city is correct. .geoNameId
- The GeoName ID for the city.names
- A map from locale codes to the city name in that locale.
-
City
Constructs an instance ofCity
.- Parameters:
city
- TheCity
object to copy.locales
- The locales to use.
-
-
Method Details
-
getConfidence
- Returns:
- A value from 0-100 indicating MaxMind's confidence that the city is correct. This attribute is only available from the Insights web service and the GeoIP2 Enterprise database.
-