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 Summary
ConstructorsConstructorDescriptionCountryResponse(CountryResponse response, List<String> locales) Constructs an instance ofCountryResponsewith the specified parameters.CountryResponse(Continent continent, Country country, MaxMind maxmind, Country registeredCountry, RepresentedCountry representedCountry, Traits traits) Compact canonical constructor that sets defaults for null values. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontinentrecord component.country()Returns the value of thecountryrecord component.final booleanIndicates whether some other object is "equal to" this one.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Usecountry()instead.Deprecated, for removal: This API element is subject to removal in a future version.Usemaxmind()instead.Deprecated, for removal: This API element is subject to removal in a future version.UseregisteredCountry()instead.Deprecated, for removal: This API element is subject to removal in a future version.UserepresentedCountry()instead.Deprecated, for removal: This API element is subject to removal in a future version.Usetraits()instead.final inthashCode()Returns a hash code value for this object.maxmind()Returns the value of themaxmindrecord component.Returns the value of theregisteredCountryrecord component.Returns the value of therepresentedCountryrecord component.final StringtoString()Returns a string representation of this record class.traits()Returns the value of thetraitsrecord component.Methods inherited from interface JsonSerializable
toJson
-
Constructor Details
-
CountryResponse
-
CountryResponse
Constructs an instance ofCountryResponsewith the specified parameters.- Parameters:
response- the responselocales- the locales
-
-
Method Details
-
getMaxMind
Deprecated, for removal: This API element is subject to removal in a future version.Usemaxmind()instead. This method will be removed in 6.0.0.- Returns:
- MaxMind record containing data related to your account.
-
getRegisteredCountry
Deprecated, for removal: This API element is subject to removal in a future version.UseregisteredCountry()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, for removal: This API element is subject to removal in a future version.Usecontinent()instead. This method will be removed in 6.0.0.- Returns:
- Continent record for the requested IP address.
-
getCountry
Deprecated, for removal: This API element is subject to removal in a future version.Usecountry()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, for removal: This API element is subject to removal in a future version.UserepresentedCountry()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, for removal: This API element is subject to removal in a future version.Usetraits()instead. This method will be removed in 6.0.0.- Returns:
- Record for the traits of the requested IP address.
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
continent
-
country
-
maxmind
-
registeredCountry
Returns the value of theregisteredCountryrecord component.- Returns:
- the value of the
registeredCountryrecord component
-
representedCountry
Returns the value of therepresentedCountryrecord component.- Returns:
- the value of the
representedCountryrecord component
-
traits
-
continent()instead.