Record Class CountryResponse

java.lang.Object
java.lang.Record
com.maxmind.geoip2.model.CountryResponse
Record Components:
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.
maxmind - MaxMind record containing data related to your account.
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.
traits - Record for the traits of the requested IP address.
All Implemented Interfaces:
JsonSerializable

public record CountryResponse(Continent continent, Country country, MaxMind maxmind, Country registeredCountry, RepresentedCountry representedCountry, Traits traits) extends Record implements JsonSerializable
This class provides a model for the data returned by the Country web service and the Country database.
See Also:
  • Constructor Details

    • CountryResponse

      public CountryResponse(Continent continent, Country country, MaxMind maxmind, Country registeredCountry, RepresentedCountry representedCountry, Traits traits)
      Compact canonical constructor that sets defaults for null values.
    • CountryResponse

      public CountryResponse(CountryResponse response, List<String> locales)
      Constructs an instance of CountryResponse with the specified parameters.
      Parameters:
      response - the response
      locales - the locales
  • Method Details

    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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
    • maxmind

      public MaxMind maxmind()
      Returns the value of the maxmind record component.
      Returns:
      the value of the maxmind 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
    • traits

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