Record Class DomainResponse

java.lang.Object
java.lang.Record
com.maxmind.geoip2.model.DomainResponse
Record Components:
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".
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 DomainResponse(String domain, InetAddress ipAddress, Network network) extends Record implements JsonSerializable
This class provides the GeoIP2 Domain model.
  • Constructor Details

    • DomainResponse

      public DomainResponse(String domain, InetAddress ipAddress, Network network)
      Creates an instance of a DomainResponse record class.
      Parameters:
      domain - the value for the domain record component
      ipAddress - the value for the ipAddress record component
      network - the value for the network record component
  • Method Details

    • 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".
    • 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.
    • 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
    • network

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