Record Class Traits

java.lang.Object
java.lang.Record
com.maxmind.geoip2.record.Traits
Record Components:
autonomousSystemNumber - The autonomous system number associated with the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
autonomousSystemOrganization - The organization associated with the registered autonomous system number for the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
connectionType - The connection type of the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
domain - The second level domain associated with the IP address. This will be something like "example.com" or "example.co.uk", not "foo.example.com". This is only available from the City Plus and Insights web services and the Enterprise database.
ipAddress - The IP address that the data in the model is for. If you performed a "me" lookup against the web service, this will be the externally routable IP address for the system the code is running on. If the system is behind a NAT, this may differ from the IP address locally assigned to it.
isAnonymous - This is true if the IP address belongs to any sort of anonymous network. This field is deprecated. Please use the anonymizer object from the Insights response.
isAnonymousVpn - This is true if the IP address belongs to an anonymous VPN system. This field is deprecated. Please use the anonymizer object from the Insights response.
isAnycast - This is true if the IP address is an anycast address.
isHostingProvider - This is true if the IP address belongs to a hosting provider. This field is deprecated. Please use the anonymizer object from the Insights response.
isLegitimateProxy - This is true if the IP address belongs to a legitimate proxy.
isPublicProxy - This is true if the IP address belongs to a public proxy. This field is deprecated. Please use the anonymizer object from the Insights response.
isResidentialProxy - This is true if the IP address is on a suspected anonymizing network and belongs to a residential ISP. This field is deprecated. Please use the anonymizer object from the Insights response.
isTorExitNode - This is true if the IP address is a Tor exit node. This field is deprecated. Please use the anonymizer object from the Insights response.
ipRiskSnapshot - The risk associated with the IP address. The value ranges from 0.01 to 99, with a higher score indicating a higher risk. The IP risk score provided in GeoIP products and services is more static than the IP risk score provided in minFraud and is not responsive to traffic on your network. If you need realtime IP risk scoring based on behavioral signals on your own network, please use minFraud. This is only available from the Insights web service.
isp - The name of the ISP associated with the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
mobileCountryCode - The mobile country code (MCC) associated with the IP address and ISP. This is available from the City Plus and Insights web services and the Enterprise database.
mobileNetworkCode - The mobile network code (MNC) associated with the IP address and ISP. This is available from the City Plus and Insights web services and the Enterprise database.
network - The network associated with the record. In particular, this is the largest network where all the fields besides IP address have the same value.
organization - The name of the organization associated with the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
userType - The user type associated with the IP address. This can be one of the following values: business, cafe, cellular, college, consumer_privacy_network, content_delivery_network, dialup, government, hosting, library, military, residential, router, school, search_engine_spider, traveler. This is only available from the Insights web service and the Enterprise database.
userCount - The estimated number of users sharing the IP address/network during the past 24 hours. For IPv4, the count is for the individual IP address. For IPv6, the count is for the /64 network. This is only available from the Insights web service.
staticIpScore - The static IP score of the IP address. This is an indicator of how static or dynamic an IP address is. This is only available from the Insights web service.
All Implemented Interfaces:
JsonSerializable

public record Traits(Long autonomousSystemNumber, String autonomousSystemOrganization, ConnectionTypeResponse.ConnectionType connectionType, String domain, InetAddress ipAddress, boolean isAnonymous, boolean isAnonymousVpn, boolean isAnycast, boolean isHostingProvider, boolean isLegitimateProxy, boolean isPublicProxy, boolean isResidentialProxy, boolean isTorExitNode, Double ipRiskSnapshot, String isp, String mobileCountryCode, String mobileNetworkCode, Network network, String organization, String userType, Integer userCount, Double staticIpScore) extends Record implements JsonSerializable
Contains data for the traits record associated with an IP address.
  • Constructor Details

  • Method Details

    • getAutonomousSystemNumber

      @Deprecated(since="5.0.0", forRemoval=true) public Long getAutonomousSystemNumber()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use autonomousSystemNumber() instead. This method will be removed in 6.0.0.
      Returns:
      The autonomous system number associated with the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
    • getAutonomousSystemOrganization

      @Deprecated(since="5.0.0", forRemoval=true) public String getAutonomousSystemOrganization()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use autonomousSystemOrganization() instead. This method will be removed in 6.0.0.
      Returns:
      The organization associated with the registered autonomous system number for the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
    • getConnectionType

      @Deprecated(since="5.0.0", forRemoval=true) public ConnectionTypeResponse.ConnectionType getConnectionType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use connectionType() instead. This method will be removed in 6.0.0.
      Returns:
      The connection type of the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
    • getStaticIpScore

      @Deprecated(since="5.0.0", forRemoval=true) public Double getStaticIpScore()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use staticIpScore() instead. This method will be removed in 6.0.0.
      Returns:
      The static IP score of the IP address. This is an indicator of how static or dynamic an IP address is. This is only available from the Insights web service.
    • getUserCount

      @Deprecated(since="5.0.0", forRemoval=true) public Integer getUserCount()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use userCount() instead. This method will be removed in 6.0.0.
      Returns:
      The estimated number of users sharing the IP address/network during the past 24 hours. For IPv4, the count is for the individual IP address. For IPv6, the count is for the /64 network. This is only available from the Insights web service.
    • getDomain

      @Deprecated(since="5.0.0", forRemoval=true) public String getDomain()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use domain() instead. This method will be removed in 6.0.0.
      Returns:
      The second level domain associated with the IP address. This will be something like "example.com" or "example.co.uk", not "foo.example.com". This is only available from the City Plus and Insights web services and the Enterprise database.
    • getIpAddress

      @Deprecated(since="5.0.0", forRemoval=true) public String getIpAddress()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use ipAddress() instead. This method will be removed in 6.0.0.
      Returns:
      The IP address that the data in the model is for. If you performed a "me" lookup against the web service, this will be the externally routable IP address for the system the code is running on. If the system is behind a NAT, this may differ from the IP address locally assigned to it.
    • getIsp

      @Deprecated(since="5.0.0", forRemoval=true) public String getIsp()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use isp() instead. This method will be removed in 6.0.0.
      Returns:
      The name of the ISP associated with the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
    • getMobileCountryCode

      @Deprecated(since="5.0.0", forRemoval=true) public String getMobileCountryCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use mobileCountryCode() instead. This method will be removed in 6.0.0.
      Returns:
      The mobile country code (MCC) associated with the IP address and ISP. This is available from the City Plus and Insights web services and the Enterprise database.
    • getMobileNetworkCode

      @Deprecated(since="5.0.0", forRemoval=true) public String getMobileNetworkCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use mobileNetworkCode() instead. This method will be removed in 6.0.0.
      Returns:
      The mobile network code (MNC) associated with the IP address and ISP. This is available from the City Plus and Insights web services and the Enterprise database.
    • getNetwork

      @Deprecated(since="5.0.0", forRemoval=true) public Network getNetwork()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use network() instead. This method will be removed in 6.0.0.
      Returns:
      The network associated with the record. In particular, this is the largest network where all the fields besides IP address have the same value.
    • getOrganization

      @Deprecated(since="5.0.0", forRemoval=true) public String getOrganization()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use organization() instead. This method will be removed in 6.0.0.
      Returns:
      The name of the organization associated with the IP address. This is only available from the City Plus and Insights web services and the Enterprise database.
    • getUserType

      @Deprecated(since="5.0.0", forRemoval=true) public String getUserType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use userType() instead. This method will be removed in 6.0.0.
      Returns:

      The user type associated with the IP address. This can be one of the following values:

      • business
      • cafe
      • cellular
      • college
      • consumer_privacy_network
      • content_delivery_network
      • dialup
      • government
      • hosting
      • library
      • military
      • residential
      • router
      • school
      • search_engine_spider
      • traveler

      This is only available from the Insights web service and the Enterprise database.

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • autonomousSystemNumber

      public Long autonomousSystemNumber()
      Returns the value of the autonomousSystemNumber record component.
      Returns:
      the value of the autonomousSystemNumber record component
    • autonomousSystemOrganization

      public String autonomousSystemOrganization()
      Returns the value of the autonomousSystemOrganization record component.
      Returns:
      the value of the autonomousSystemOrganization record component
    • connectionType

      public ConnectionTypeResponse.ConnectionType connectionType()
      Returns the value of the connectionType record component.
      Returns:
      the value of the connectionType record component
    • domain

      public String domain()
      Returns the value of the domain record component.
      Returns:
      the value of the domain record component
    • ipAddress

      public InetAddress ipAddress()
      Returns the value of the ipAddress record component.
      Returns:
      the value of the ipAddress record component
    • isAnonymous

      @Deprecated(since="5.0.0", forRemoval=true) public boolean isAnonymous()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the isAnonymous record component.
      Returns:
      the value of the isAnonymous record component
    • isAnonymousVpn

      @Deprecated(since="5.0.0", forRemoval=true) public boolean isAnonymousVpn()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the isAnonymousVpn record component.
      Returns:
      the value of the isAnonymousVpn record component
    • isAnycast

      public boolean isAnycast()
      Returns the value of the isAnycast record component.
      Returns:
      the value of the isAnycast record component
    • isHostingProvider

      @Deprecated(since="5.0.0", forRemoval=true) public boolean isHostingProvider()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the isHostingProvider record component.
      Returns:
      the value of the isHostingProvider record component
    • isLegitimateProxy

      public boolean isLegitimateProxy()
      Returns the value of the isLegitimateProxy record component.
      Returns:
      the value of the isLegitimateProxy record component
    • isPublicProxy

      @Deprecated(since="5.0.0", forRemoval=true) public boolean isPublicProxy()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the isPublicProxy record component.
      Returns:
      the value of the isPublicProxy record component
    • isResidentialProxy

      @Deprecated(since="5.0.0", forRemoval=true) public boolean isResidentialProxy()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the isResidentialProxy record component.
      Returns:
      the value of the isResidentialProxy record component
    • isTorExitNode

      @Deprecated(since="5.0.0", forRemoval=true) public boolean isTorExitNode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the isTorExitNode record component.
      Returns:
      the value of the isTorExitNode record component
    • ipRiskSnapshot

      public Double ipRiskSnapshot()
      Returns the value of the ipRiskSnapshot record component.
      Returns:
      the value of the ipRiskSnapshot record component
    • isp

      public String isp()
      Returns the value of the isp record component.
      Returns:
      the value of the isp record component
    • mobileCountryCode

      public String mobileCountryCode()
      Returns the value of the mobileCountryCode record component.
      Returns:
      the value of the mobileCountryCode record component
    • mobileNetworkCode

      public String mobileNetworkCode()
      Returns the value of the mobileNetworkCode record component.
      Returns:
      the value of the mobileNetworkCode record component
    • network

      public Network network()
      Returns the value of the network record component.
      Returns:
      the value of the network record component
    • organization

      public String organization()
      Returns the value of the organization record component.
      Returns:
      the value of the organization record component
    • userType

      public String userType()
      Returns the value of the userType record component.
      Returns:
      the value of the userType record component
    • userCount

      public Integer userCount()
      Returns the value of the userCount record component.
      Returns:
      the value of the userCount record component
    • staticIpScore

      public Double staticIpScore()
      Returns the value of the staticIpScore record component.
      Returns:
      the value of the staticIpScore record component