Record Class AsnResponse

java.lang.Object
java.lang.Record
com.maxmind.geoip2.model.AsnResponse
Record Components:
autonomousSystemNumber - The autonomous system number associated with the IP address.
autonomousSystemOrganization - The organization associated with the registered autonomous system number for the IP address.
ipAddress - The IP address that the data in the model is for.
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.
All Implemented Interfaces:
JsonSerializable

public record AsnResponse(Long autonomousSystemNumber, String autonomousSystemOrganization, InetAddress ipAddress, Network network) extends Record implements JsonSerializable
This class provides the GeoLite2 ASN model.
  • Constructor Details

    • AsnResponse

      public AsnResponse(Long autonomousSystemNumber, String autonomousSystemOrganization, InetAddress ipAddress, Network network)
      Creates an instance of a AsnResponse record class.
      Parameters:
      autonomousSystemNumber - the value for the autonomousSystemNumber record component
      autonomousSystemOrganization - the value for the autonomousSystemOrganization record component
      ipAddress - the value for the ipAddress record component
      network - the value for the network record component
  • 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.
    • 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
    • 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.
    • 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.
    • 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.
    • 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
    • ipAddress

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

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