Record Class EnterpriseResponse

java.lang.Object
java.lang.Record
com.maxmind.geoip2.model.EnterpriseResponse
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. This object represents the country where MaxMind believes the end user is located.
location - Location record for the requested IP address.
maxmind - MaxMind record containing data related to your account.
postal - Postal record for the requested IP address.
registeredCountry - Registered country record for the requested IP address. This record represents the country where the ISP has registered a given IP block and may differ from the user's country.
representedCountry - Represented country record for the requested IP address. The represented country is used for things like military bases. It is only present when the represented country differs from the country.
subdivisions - An List of Subdivision objects representing the country subdivisions for the requested IP address. The number and type of subdivisions varies by country, but a subdivision is typically a state, province, county, etc. Subdivisions are ordered from most general (largest) to most specific (smallest). If the response did not contain any subdivisions, this is an empty list.
traits - Record for the traits of the requested IP address.
All Implemented Interfaces:
JsonSerializable

public record EnterpriseResponse(City city, Continent continent, Country country, Location location, MaxMind maxmind, Postal postal, Country registeredCountry, RepresentedCountry representedCountry, List<Subdivision> subdivisions, Traits traits) extends Record implements JsonSerializable

This class provides a model for the data returned by the GeoIP2 Enterprise database

  • Constructor Details

  • Method Details

    • getCity

      @Deprecated(since="5.0.0", forRemoval=true) public 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 6.0.0.
      Returns:
      City record for the requested IP address.
    • getContinent

      @Deprecated(since="5.0.0", forRemoval=true) public 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 6.0.0.
      Returns:
      Continent record for the requested IP address.
    • getCountry

      @Deprecated(since="5.0.0", forRemoval=true) public 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 6.0.0.
      Returns:
      Country record for the requested IP address. This object represents the country where MaxMind believes the end user is located.
    • getLocation

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

      @Deprecated(since="5.0.0", forRemoval=true) public MaxMind getMaxMind()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use maxmind() instead. This method will be removed in 6.0.0.
      Returns:
      MaxMind record containing data related to your account.
    • getPostal

      @Deprecated(since="5.0.0", forRemoval=true) public 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 6.0.0.
      Returns:
      the postal
    • getRegisteredCountry

      @Deprecated(since="5.0.0", forRemoval=true) public 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 6.0.0.
      Returns:
      Registered country record for the requested IP address. This record represents the country where the ISP has registered a given IP block and may differ from the user's country.
    • getRepresentedCountry

      @Deprecated(since="5.0.0", forRemoval=true) public 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 6.0.0.
      Returns:
      Represented country record for the requested IP address. The represented country is used for things like military bases. It is only present when the represented country differs from the country.
    • getSubdivisions

      @Deprecated(since="5.0.0", forRemoval=true) public List<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 6.0.0.
      Returns:
      An List of Subdivision objects representing the country subdivisions for the requested IP address. The number and type of subdivisions varies by country, but a subdivision is typically a state, province, county, etc. Subdivisions are ordered from most general (largest) to most specific (smallest). If the response did not contain any subdivisions, this method returns an empty array.
    • getTraits

      @Deprecated(since="5.0.0", forRemoval=true) public 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 6.0.0.
      Returns:
      Record for the traits of the requested IP address.
    • mostSpecificSubdivision

      public Subdivision mostSpecificSubdivision()
      Returns:
      An object representing the most specific subdivision returned. If the response did not contain any subdivisions, this method returns an empty Subdivision object.
    • getMostSpecificSubdivision

      @Deprecated(since="5.0.0", forRemoval=true) public Subdivision getMostSpecificSubdivision()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use mostSpecificSubdivision() instead. This method will be removed in 6.0.0.
      Returns:
      An object representing the most specific subdivision returned. If the response did not contain any subdivisions, this method returns an empty Subdivision object.
    • leastSpecificSubdivision

      public Subdivision leastSpecificSubdivision()
      Returns:
      An object representing the least specific subdivision returned. If the response did not contain any subdivisions, this method returns an empty Subdivision object.
    • getLeastSpecificSubdivision

      @Deprecated(since="5.0.0", forRemoval=true) public Subdivision getLeastSpecificSubdivision()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use leastSpecificSubdivision() instead. This method will be removed in 6.0.0.
      Returns:
      An object representing the least specific subdivision returned. If the response did not contain any subdivisions, this method returns an empty Subdivision object.
    • 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 City city()
      Returns the value of the city record component.
      Returns:
      the value of the city record component
    • continent

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

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

      public Location location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component
    • maxmind

      public MaxMind maxmind()
      Returns the value of the maxmind record component.
      Returns:
      the value of the maxmind record component
    • postal

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

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

      public RepresentedCountry representedCountry()
      Returns the value of the representedCountry record component.
      Returns:
      the value of the representedCountry record component
    • subdivisions

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

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