Record Class IpResponse

java.lang.Object
java.lang.Record
net.flectone.pulse.module.command.geolocate.model.IpResponse
Record Components:
status - whether the lookup succeeded
country - the country
region - the region name
city - the city
timezone - the time zone
offset - the utc offset in seconds
mobile - whether the address belongs to a mobile network
proxy - whether it looks like a proxy or vpn
hosting - whether it belongs to a hosting provider
query - the address that was looked up

public record IpResponse(String status, String country, String region, String city, String timezone, Integer offset, Boolean mobile, Boolean proxy, Boolean hosting, String query) extends Record
The answer returned by the geolocation service.
  • Constructor Details

    • IpResponse

      public IpResponse(String status, String country, String region, String city, String timezone, Integer offset, Boolean mobile, Boolean proxy, Boolean hosting, String query)
      Creates an instance of a IpResponse record class.
      Parameters:
      status - the value for the status record component
      country - the value for the country record component
      region - the value for the region record component
      city - the value for the city record component
      timezone - the value for the timezone record component
      offset - the value for the offset record component
      mobile - the value for the mobile record component
      proxy - the value for the proxy record component
      hosting - the value for the hosting record component
      query - the value for the query record component
  • Method Details

    • isSuccess

      public boolean isSuccess()
      Whether the lookup returned usable data.
      Returns:
      true if the service reported success
    • 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.
    • status

      public String status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • country

      public String country()
      Returns the value of the country record component.
      Returns:
      the value of the country record component
    • region

      public String region()
      Returns the value of the region record component.
      Returns:
      the value of the region record component
    • city

      public String city()
      Returns the value of the city record component.
      Returns:
      the value of the city record component
    • timezone

      public String timezone()
      Returns the value of the timezone record component.
      Returns:
      the value of the timezone record component
    • offset

      public Integer offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • mobile

      public Boolean mobile()
      Returns the value of the mobile record component.
      Returns:
      the value of the mobile record component
    • proxy

      public Boolean proxy()
      Returns the value of the proxy record component.
      Returns:
      the value of the proxy record component
    • hosting

      public Boolean hosting()
      Returns the value of the hosting record component.
      Returns:
      the value of the hosting record component
    • query

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