
com.maxmind.geoip2.record.City Maven / Gradle / Ivy
package com.maxmind.geoip2.record;
import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;
/**
*
* City-level data associated with an IP address.
*
*
* This record is returned by all the end points except the Country end point.
*
*
* Do not use any of the city names as a database or map key. Use the value
* returned by {@link #getGeoNameId} instead.
*
*/
public final class City extends AbstractNamedRecord {
private final Integer confidence;
public City() {
this(null, null, null, null);
}
public City(
@JacksonInject("locales") List locales,
@JsonProperty("confidence") Integer confidence,
@JsonProperty("geoname_id") Integer geoNameId,
@JsonProperty("names") Map names
) {
super(locales, geoNameId, names);
this.confidence = confidence;
}
/**
* @return A value from 0-100 indicating MaxMind's confidence that the city
* is correct. This attribute is only available from the Insights
* end point and the GeoIP2 Enterprise database.
*/
public Integer getConfidence() {
return this.confidence;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy