Record Class Location
java.lang.Object
java.lang.Record
com.maxmind.geoip2.record.Location
- Record Components:
accuracyRadius- The approximate accuracy radius in kilometers around the latitude and longitude for the IP address. This is the radius where we have a 67% confidence that the device using the IP address resides within the circle centered at the latitude and longitude with the provided radius.averageIncome- The average income in US dollars associated with the requested IP address. This attribute is only available from the Insights web service.latitude- The approximate latitude of the location associated with the IP address. This value is not precise and should not be used to identify a particular address or household.longitude- The approximate longitude of the location associated with the IP address. This value is not precise and should not be used to identify a particular address or household.populationDensity- The estimated population per square kilometer associated with the IP address. This attribute is only available from the Insights web service.timeZone- The time zone associated with location, as specified by the IANA Time Zone Database, e.g., "America/New_York".
- All Implemented Interfaces:
JsonSerializable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccuracyRadiusrecord component.Returns the value of theaverageIncomerecord component.final booleanIndicates whether some other object is "equal to" this one.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.UseaverageIncome()instead.Deprecated, for removal: This API element is subject to removal in a future version.Uselatitude()instead.Deprecated, for removal: This API element is subject to removal in a future version.Uselongitude()instead.Deprecated, for removal: This API element is subject to removal in a future version.UsepopulationDensity()instead.Deprecated, for removal: This API element is subject to removal in a future version.UsetimeZone()instead.final inthashCode()Returns a hash code value for this object.latitude()Returns the value of thelatituderecord component.Returns the value of thelongituderecord component.Returns the value of thepopulationDensityrecord component.timeZone()Returns the value of thetimeZonerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface JsonSerializable
toJson
-
Constructor Details
-
Location
public Location()Constructs aLocationrecord withnullvalues for all the fields. -
Location
public Location(Integer accuracyRadius, Integer averageIncome, Double latitude, Double longitude, Integer populationDensity, String timeZone) Creates an instance of aLocationrecord class.- Parameters:
accuracyRadius- the value for theaccuracyRadiusrecord componentaverageIncome- the value for theaverageIncomerecord componentlatitude- the value for thelatituderecord componentlongitude- the value for thelongituderecord componentpopulationDensity- the value for thepopulationDensityrecord componenttimeZone- the value for thetimeZonerecord component
-
-
Method Details
-
getAverageIncome
Deprecated, for removal: This API element is subject to removal in a future version.UseaverageIncome()instead. This method will be removed in 6.0.0.- Returns:
- The average income in US dollars associated with the requested IP address. This attribute is only available from the Insights web service.
-
getPopulationDensity
Deprecated, for removal: This API element is subject to removal in a future version.UsepopulationDensity()instead. This method will be removed in 6.0.0.- Returns:
- The estimated population per square kilometer associated with the IP address. This attribute is only available from the Insights web service.
-
getTimeZone
Deprecated, for removal: This API element is subject to removal in a future version.UsetimeZone()instead. This method will be removed in 6.0.0.- Returns:
- The time zone associated with location, as specified by the IANA Time Zone Database, e.g., "America/New_York".
-
getAccuracyRadius
Deprecated, for removal: This API element is subject to removal in a future version.UseaccuracyRadius()instead. This method will be removed in 6.0.0.- Returns:
- The approximate accuracy radius in kilometers around the latitude and longitude for the IP address. This is the radius where we have a 67% confidence that the device using the IP address resides within the circle centered at the latitude and longitude with the provided radius.
-
getLatitude
Deprecated, for removal: This API element is subject to removal in a future version.Uselatitude()instead. This method will be removed in 6.0.0.- Returns:
- The approximate latitude of the location associated with the IP address. This value is not precise and should not be used to identify a particular address or household.
-
getLongitude
Deprecated, for removal: This API element is subject to removal in a future version.Uselongitude()instead. This method will be removed in 6.0.0.- Returns:
- The approximate longitude of the location associated with the IP address. This value is not precise and should not be used to identify a particular address or household.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
accuracyRadius
Returns the value of theaccuracyRadiusrecord component.- Returns:
- the value of the
accuracyRadiusrecord component
-
averageIncome
Returns the value of theaverageIncomerecord component.- Returns:
- the value of the
averageIncomerecord component
-
latitude
-
longitude
-
populationDensity
Returns the value of thepopulationDensityrecord component.- Returns:
- the value of the
populationDensityrecord component
-
timeZone
-
accuracyRadius()instead.