Record Class GeoIp2Location

java.lang.Object
java.lang.Record
com.maxmind.minfraud.response.GeoIp2Location
Record Components:
accuracyRadius - The approximate accuracy radius in kilometers around the latitude and longitude for the geographical entity (country, subdivision, city or postal code) associated with the IP address.
averageIncome - The average income in US dollars associated with the requested IP address.
latitude - The approximate latitude of the location associated with the IP address.
localTime - The date and time of the transaction in the time zone associated with the IP address. The value is formatted according to RFC 3339. For instance, the local time in Boston might be returned as "2015-04-27T19:17:24-04:00".
longitude - The approximate longitude of the location associated with the IP address.
metroCode - The metro code of the location if the location is in the US.
populationDensity - The estimated population per square kilometer associated with the IP address.
timeZone - The time zone associated with location, as specified by the IANA Time Zone Database.
All Implemented Interfaces:
JsonSerializable

public record GeoIp2Location(Integer accuracyRadius, Integer averageIncome, Double latitude, String localTime, Double longitude, Integer metroCode, Integer populationDensity, String timeZone) extends Record implements JsonSerializable
This class contains minFraud response data related to the GeoIP2 Insights location.
  • Constructor Details

    • GeoIp2Location

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

      public GeoIp2Location(Integer accuracyRadius, Integer averageIncome, Double latitude, String localTime, Double longitude, Integer metroCode, Integer populationDensity, String timeZone)
      Creates an instance of a GeoIp2Location record class.
      Parameters:
      accuracyRadius - the value for the accuracyRadius record component
      averageIncome - the value for the averageIncome record component
      latitude - the value for the latitude record component
      localTime - the value for the localTime record component
      longitude - the value for the longitude record component
      metroCode - the value for the metroCode record component
      populationDensity - the value for the populationDensity record component
      timeZone - the value for the timeZone record component
  • Method Details

    • getAccuracyRadius

      @Deprecated(since="4.0.0", forRemoval=true) public Integer getAccuracyRadius()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use accuracyRadius() instead. This method will be removed in 5.0.0.
      Returns:
      The approximate accuracy radius in kilometers around the latitude and longitude for the geographical entity (country, subdivision, city or postal code) associated with the IP address.
    • getAverageIncome

      @Deprecated(since="4.0.0", forRemoval=true) public Integer getAverageIncome()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use averageIncome() instead. This method will be removed in 5.0.0.
      Returns:
      The average income in US dollars associated with the requested IP address.
    • getLatitude

      @Deprecated(since="4.0.0", forRemoval=true) public Double getLatitude()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use latitude() instead. This method will be removed in 5.0.0.
      Returns:
      The approximate latitude of the location associated with the IP address.
    • getLongitude

      @Deprecated(since="4.0.0", forRemoval=true) public Double getLongitude()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use longitude() instead. This method will be removed in 5.0.0.
      Returns:
      The approximate longitude of the location associated with the IP address.
    • getMetroCode

      @Deprecated(since="4.0.0", forRemoval=true) public Integer getMetroCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use metroCode() instead. This method will be removed in 5.0.0.
      Returns:
      The metro code of the location if the location is in the US.
    • getPopulationDensity

      @Deprecated(since="4.0.0", forRemoval=true) public Integer getPopulationDensity()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use populationDensity() instead. This method will be removed in 5.0.0.
      Returns:
      The estimated population per square kilometer associated with the IP address.
    • getTimeZone

      @Deprecated(since="4.0.0", forRemoval=true) public String getTimeZone()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use timeZone() instead. This method will be removed in 5.0.0.
      Returns:
      The time zone associated with location, as specified by the IANA Time Zone Database.
    • getLocalTime

      @Deprecated(since="4.0.0", forRemoval=true) public String getLocalTime()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use localTime() instead. This method will be removed in 5.0.0.
      Returns:
      The date and time of the transaction in the time zone associated with the IP address. The value is formatted according to RFC 3339. For instance, the local time in Boston might be returned as "2015-04-27T19:17:24-04:00".
    • getLocalDateTime

      public ZonedDateTime getLocalDateTime()
      Returns:
      The date and time of the transaction in the time zone associated with the IP address as a ZonedDateTime.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • accuracyRadius

      public Integer accuracyRadius()
      Returns the value of the accuracyRadius record component.
      Returns:
      the value of the accuracyRadius record component
    • averageIncome

      public Integer averageIncome()
      Returns the value of the averageIncome record component.
      Returns:
      the value of the averageIncome record component
    • latitude

      public Double latitude()
      Returns the value of the latitude record component.
      Returns:
      the value of the latitude record component
    • localTime

      public String localTime()
      Returns the value of the localTime record component.
      Returns:
      the value of the localTime record component
    • longitude

      public Double longitude()
      Returns the value of the longitude record component.
      Returns:
      the value of the longitude record component
    • metroCode

      public Integer metroCode()
      Returns the value of the metroCode record component.
      Returns:
      the value of the metroCode record component
    • populationDensity

      public Integer populationDensity()
      Returns the value of the populationDensity record component.
      Returns:
      the value of the populationDensity record component
    • timeZone

      public String timeZone()
      Returns the value of the timeZone record component.
      Returns:
      the value of the timeZone record component