Class 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
    • 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 the particular country. Some locations may have multiple subdivisions. The order is from the least specific to most specific division.
        Since:
        15.24
    • Constructor Detail

      • Location

        public Location()