Record Class IpAddress

java.lang.Object
java.lang.Record
com.maxmind.minfraud.response.IpAddress
Record Components:
city - City record for the requested IP address.
continent - Continent record for the requested IP address.
country - Country record for the requested IP address.
location - Location record for the requested IP address.
postal - Postal record for the requested IP address.
registeredCountry - Registered country record for the requested IP address.
representedCountry - Represented country record for the requested IP address.
risk - The risk associated with the IP address.
riskReasons - An unmodifiable list containing risk reason objects that identify the reasons why the IP address received the associated risk. This will be an empty list if there are no reasons.
subdivisions - List of subdivision records for the requested IP address.
traits - Traits record for the requested IP address.
All Implemented Interfaces:
JsonSerializable, IpAddressInterface

public record IpAddress(com.maxmind.geoip2.record.City city, com.maxmind.geoip2.record.Continent continent, com.maxmind.geoip2.record.Country country, GeoIp2Location location, com.maxmind.geoip2.record.Postal postal, com.maxmind.geoip2.record.Country registeredCountry, com.maxmind.geoip2.record.RepresentedCountry representedCountry, Double risk, List<IpRiskReason> riskReasons, List<com.maxmind.geoip2.record.Subdivision> subdivisions, com.maxmind.geoip2.record.Traits traits) extends Record implements IpAddressInterface, JsonSerializable
This class contains minFraud response data related to the IP location.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an instance of IpAddress with no data.
    IpAddress(com.maxmind.geoip2.record.City city, com.maxmind.geoip2.record.Continent continent, com.maxmind.geoip2.record.Country country, GeoIp2Location location, com.maxmind.geoip2.record.Postal postal, com.maxmind.geoip2.record.Country registeredCountry, com.maxmind.geoip2.record.RepresentedCountry representedCountry, Double risk, List<IpRiskReason> riskReasons, List<com.maxmind.geoip2.record.Subdivision> subdivisions, com.maxmind.geoip2.record.Traits traits)
    Compact canonical constructor that sets defaults for null values.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.maxmind.geoip2.record.City
    Returns the value of the city record component.
    com.maxmind.geoip2.record.Continent
    Returns the value of the continent record component.
    com.maxmind.geoip2.record.Country
    Returns the value of the country record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    com.maxmind.geoip2.record.City
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use city() instead.
    com.maxmind.geoip2.record.Continent
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use continent() instead.
    com.maxmind.geoip2.record.Country
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use country() instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use location() instead.
    com.maxmind.geoip2.record.Postal
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use postal() instead.
    com.maxmind.geoip2.record.Country
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use registeredCountry() instead.
    com.maxmind.geoip2.record.RepresentedCountry
    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.
    Use risk() instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use riskReasons() instead.
    List<com.maxmind.geoip2.record.Subdivision>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use subdivisions() instead.
    com.maxmind.geoip2.record.Traits
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use traits() instead.
    final int
    Returns a hash code value for this object.
    Returns the value of the location record component.
    com.maxmind.geoip2.record.Postal
    Returns the value of the postal record component.
    com.maxmind.geoip2.record.Country
    Returns the value of the registeredCountry record component.
    com.maxmind.geoip2.record.RepresentedCountry
    Returns the value of the representedCountry record component.
    Returns the value of the risk record component.
    Returns the value of the riskReasons record component.
    List<com.maxmind.geoip2.record.Subdivision>
    Returns the value of the subdivisions record component.
    final String
    Returns a string representation of this record class.
    com.maxmind.geoip2.record.Traits
    Returns the value of the traits record component.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface JsonSerializable

    toJson
  • Constructor Details

    • IpAddress

      public IpAddress(com.maxmind.geoip2.record.City city, com.maxmind.geoip2.record.Continent continent, com.maxmind.geoip2.record.Country country, GeoIp2Location location, com.maxmind.geoip2.record.Postal postal, com.maxmind.geoip2.record.Country registeredCountry, com.maxmind.geoip2.record.RepresentedCountry representedCountry, Double risk, List<IpRiskReason> riskReasons, List<com.maxmind.geoip2.record.Subdivision> subdivisions, com.maxmind.geoip2.record.Traits traits)
      Compact canonical constructor that sets defaults for null values.
    • IpAddress

      public IpAddress()
      Constructs an instance of IpAddress with no data.
  • Method Details

    • getLocation

      @Deprecated(since="4.0.0", forRemoval=true) public GeoIp2Location getLocation()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use location() instead. This method will be removed in 5.0.0.
      Returns:
      Location record for the requested IP address.
    • getCity

      @Deprecated(since="4.0.0", forRemoval=true) public com.maxmind.geoip2.record.City getCity()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use city() instead. This method will be removed in 5.0.0.
      Returns:
      City record for the requested IP address.
    • getContinent

      @Deprecated(since="4.0.0", forRemoval=true) public com.maxmind.geoip2.record.Continent getContinent()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use continent() instead. This method will be removed in 5.0.0.
      Returns:
      Continent record for the requested IP address.
    • getCountry

      @Deprecated(since="4.0.0", forRemoval=true) public com.maxmind.geoip2.record.Country getCountry()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use country() instead. This method will be removed in 5.0.0.
      Returns:
      Country record for the requested IP address.
    • getPostal

      @Deprecated(since="4.0.0", forRemoval=true) public com.maxmind.geoip2.record.Postal getPostal()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use postal() instead. This method will be removed in 5.0.0.
      Returns:
      Postal record for the requested IP address.
    • getRegisteredCountry

      @Deprecated(since="4.0.0", forRemoval=true) public com.maxmind.geoip2.record.Country getRegisteredCountry()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use registeredCountry() instead. This method will be removed in 5.0.0.
      Returns:
      Registered country record for the requested IP address.
    • getRepresentedCountry

      @Deprecated(since="4.0.0", forRemoval=true) public com.maxmind.geoip2.record.RepresentedCountry getRepresentedCountry()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use representedCountry() instead. This method will be removed in 5.0.0.
      Returns:
      Represented country record for the requested IP address.
    • getSubdivisions

      @Deprecated(since="4.0.0", forRemoval=true) public List<com.maxmind.geoip2.record.Subdivision> getSubdivisions()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use subdivisions() instead. This method will be removed in 5.0.0.
      Returns:
      List of subdivision records for the requested IP address.
    • getTraits

      @Deprecated(since="4.0.0", forRemoval=true) public com.maxmind.geoip2.record.Traits getTraits()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use traits() instead. This method will be removed in 5.0.0.
      Returns:
      Traits record for the requested IP address.
    • getRisk

      @Deprecated(since="4.0.0", forRemoval=true) public Double getRisk()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use risk() instead. This method will be removed in 5.0.0.
      Specified by:
      getRisk in interface IpAddressInterface
      Returns:
      The risk associated with the IP address.
    • getRiskReasons

      @Deprecated(since="4.0.0", forRemoval=true) public List<IpRiskReason> getRiskReasons()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use riskReasons() instead. This method will be removed in 5.0.0.
      Returns:
      An unmodifiable list containing risk reason objects that identify the reasons why the IP address received the associated risk. This will be an empty list if there are no reasons.
    • 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.
    • city

      public com.maxmind.geoip2.record.City city()
      Returns the value of the city record component.
      Returns:
      the value of the city record component
    • continent

      public com.maxmind.geoip2.record.Continent continent()
      Returns the value of the continent record component.
      Returns:
      the value of the continent record component
    • country

      public com.maxmind.geoip2.record.Country country()
      Returns the value of the country record component.
      Returns:
      the value of the country record component
    • location

      public GeoIp2Location location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component
    • postal

      public com.maxmind.geoip2.record.Postal postal()
      Returns the value of the postal record component.
      Returns:
      the value of the postal record component
    • registeredCountry

      public com.maxmind.geoip2.record.Country registeredCountry()
      Returns the value of the registeredCountry record component.
      Returns:
      the value of the registeredCountry record component
    • representedCountry

      public com.maxmind.geoip2.record.RepresentedCountry representedCountry()
      Returns the value of the representedCountry record component.
      Returns:
      the value of the representedCountry record component
    • risk

      public Double risk()
      Returns the value of the risk record component.
      Specified by:
      risk in interface IpAddressInterface
      Returns:
      the value of the risk record component
    • riskReasons

      public List<IpRiskReason> riskReasons()
      Returns the value of the riskReasons record component.
      Returns:
      the value of the riskReasons record component
    • subdivisions

      public List<com.maxmind.geoip2.record.Subdivision> subdivisions()
      Returns the value of the subdivisions record component.
      Returns:
      the value of the subdivisions record component
    • traits

      public com.maxmind.geoip2.record.Traits traits()
      Returns the value of the traits record component.
      Returns:
      the value of the traits record component