Record Class Continent
java.lang.Object
java.lang.Record
com.maxmind.geoip2.record.Continent
- Record Components:
locales- The locales to use for retrieving localized names.code- A two character continent code like "NA" (North America) or "OC" (Oceania).geonameId- The GeoName ID for the continent.names- AMapfrom locale codes to the name in that locale.
- All Implemented Interfaces:
JsonSerializable, NamedRecord
public record Continent(List<String> locales, String code, Long geonameId, Map<String,String> names)
extends Record
implements NamedRecord
Contains data for the continent record associated with an IP address.
Do not use any of the continent names as a database or map key. Use the
value returned by geonameId() or code() instead.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an instance ofContinentwith no data.Constructs an instance ofContinent.Compact canonical constructor that ensures immutability and handles null values. -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the value of thecoderecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegeonameIdrecord component.getCode()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.UsegeonameId()instead.getName()Deprecated, for removal: This API element is subject to removal in a future version.UseNamedRecord.name()instead.getNames()Deprecated, for removal: This API element is subject to removal in a future version.Usenames()instead.final inthashCode()Returns a hash code value for this object.locales()Returns the value of thelocalesrecord component.names()Returns the value of thenamesrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface JsonSerializable
toJsonMethods inherited from interface NamedRecord
name
-
Constructor Details
-
Continent
-
Continent
public Continent()Constructs an instance ofContinentwith no data. -
Continent
-
-
Method Details
-
getCode
Deprecated, for removal: This API element is subject to removal in a future version.Usecode()instead. This method will be removed in 6.0.0.- Returns:
- A two character continent code like "NA" (North America) or "OC" (Oceania).
-
getGeoNameId
Deprecated, for removal: This API element is subject to removal in a future version.UsegeonameId()instead. This method will be removed in 6.0.0.- Returns:
- The GeoName ID for the continent.
-
getName
Deprecated, for removal: This API element is subject to removal in a future version.UseNamedRecord.name()instead. This method will be removed in 6.0.0.- Returns:
- The name of the continent based on the locales list.
-
getNames
-
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). -
locales
-
code
-
geonameId
Returns the value of thegeonameIdrecord component.- Specified by:
geonameIdin interfaceNamedRecord- Returns:
- the value of the
geonameIdrecord component
-
names
-
code()instead.