Class Location
- java.lang.Object
-
- com.funnelback.publicui.search.model.geolocation.Location
-
public class Location extends Object
This class represents a location along with a range of 'names' which apply to it, such as countries, cities, postalCodes etc.
The available fields are based closely on the MaxMind2 data.
- Since:
- 13.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Location.LocationBuilder
static class
Location.Subdivision
-
Field Summary
Fields Modifier and Type Field Description private String
city
The city name of the represented location if it can be determined, otherwise null.private String
countryCode
The two letter country code (ISO 3166-1 alpha code) of the represented location if it can be determined, otherwise null.private Integer
countryGeoNameId
The GeoName ID of the country.private String
countryName
The full country name of the represented location if it can be determined, otherwise null.private Double
latitude
The latitude of the represented location.private Double
longitude
The longitude of the represented location.private Integer
metroCode
The metro code of the represented location if it can be determined, otherwise zero.private String
postalCode
The postal code of the represented location if it can be determined, otherwise null.private List<Location.Subdivision>
subdivisions
The subdivisions of the location.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Location.LocationBuilder
builder()
protected boolean
canEqual(Object other)
boolean
equals(Object o)
String
getCity()
The city name of the represented location if it can be determined, otherwise null.String
getCountryCode()
The two letter country code (ISO 3166-1 alpha code) of the represented location if it can be determined, otherwise null.Integer
getCountryGeoNameId()
The GeoName ID of the country.String
getCountryName()
The full country name of the represented location if it can be determined, otherwise null.Double
getLatitude()
The latitude of the represented location.Double
getLongitude()
The longitude of the represented location.Integer
getMetroCode()
The metro code of the represented location if it can be determined, otherwise zero.String
getPostalCode()
The postal code of the represented location if it can be determined, otherwise null.List<Location.Subdivision>
getSubdivisions()
The subdivisions of the location.int
hashCode()
String
toString()
-
-
-
Field Detail
-
city
private final String city
The city name of the represented location if it can be determined, otherwise null.- Since:
- 13.0
-
countryCode
private final String countryCode
The two letter country code (ISO 3166-1 alpha code) of the represented location if it can be determined, otherwise null.- Since:
- 13.0
-
countryName
private final String countryName
The full country name of the represented location if it can be determined, otherwise null.- Since:
- 13.0
-
countryGeoNameId
private final Integer countryGeoNameId
The GeoName ID of the country.- Since:
- 15.24
-
latitude
private final Double latitude
The latitude of the represented location.
Defaults to zero if it cannot be determined even though that represents a legitimate location.
- Since:
- 13.0
-
longitude
private final Double longitude
The longitude of the represented location.
Defaults to zero if it cannot be determined even though that represents a legitimate location.
- Since:
- 13.0
-
metroCode
private final Integer metroCode
The metro code of the represented location if it can be determined, otherwise zero.- Since:
- 13.0
-
postalCode
private final String postalCode
The postal code of the represented location if it can be determined, otherwise null.- Since:
- 13.0
-
subdivisions
private final List<Location.Subdivision> subdivisions
The subdivisions of the location. This will generally hold the sate or province the location is in, however it depends on on the particular country. Some locations may have multiple subdivisions. The order is from the least specific to most specific division.- Since:
- 15.24
-
-
Method Detail
-
builder
public static Location.LocationBuilder builder()
-
getCity
public String getCity()
The city name of the represented location if it can be determined, otherwise null.- Since:
- 13.0
-
getCountryCode
public String getCountryCode()
The two letter country code (ISO 3166-1 alpha code) of the represented location if it can be determined, otherwise null.- Since:
- 13.0
-
getCountryName
public String getCountryName()
The full country name of the represented location if it can be determined, otherwise null.- Since:
- 13.0
-
getCountryGeoNameId
public Integer getCountryGeoNameId()
The GeoName ID of the country.- Since:
- 15.24
-
getLatitude
public Double getLatitude()
The latitude of the represented location.
Defaults to zero if it cannot be determined even though that represents a legitimate location.
- Since:
- 13.0
-
getLongitude
public Double getLongitude()
The longitude of the represented location.
Defaults to zero if it cannot be determined even though that represents a legitimate location.
- Since:
- 13.0
-
getMetroCode
public Integer getMetroCode()
The metro code of the represented location if it can be determined, otherwise zero.- Since:
- 13.0
-
getPostalCode
public String getPostalCode()
The postal code of the represented location if it can be determined, otherwise null.- Since:
- 13.0
-
getSubdivisions
public List<Location.Subdivision> getSubdivisions()
The subdivisions of the location. This will generally hold the sate or province the location is in, however it depends on on the particular country. Some locations may have multiple subdivisions. The order is from the least specific to most specific division.- Since:
- 15.24
-
canEqual
protected boolean canEqual(Object other)
-
-