Class GeoEntityUtility


  • public final class GeoEntityUtility
    extends java.lang.Object
    Utility class for checking whether identifiers region code and country calling code belong to geographical entities. For more information about geo vs. non-geo entities see RegionMetadataSource and NonGeographicalEntityMetadataSource
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String REGION_CODE_FOR_NON_GEO_ENTITIES
      Region code with a special meaning, used to mark non-geographical entities
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isGeoEntity​(int countryCallingCode)
      Determines whether countryCallingCode belongs to a geographical entity.
      static boolean isGeoEntity​(java.lang.String regionCode)
      Determines whether regionCode belongs to a geographical entity.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • REGION_CODE_FOR_NON_GEO_ENTITIES

        public static final java.lang.String REGION_CODE_FOR_NON_GEO_ENTITIES
        Region code with a special meaning, used to mark non-geographical entities
        See Also:
        Constant Field Values
    • Method Detail

      • isGeoEntity

        public static boolean isGeoEntity​(java.lang.String regionCode)
        Determines whether regionCode belongs to a geographical entity.
      • isGeoEntity

        public static boolean isGeoEntity​(int countryCallingCode)
        Determines whether countryCallingCode belongs to a geographical entity.

        A single country calling code could map to several different regions. It is considered that countryCallingCode belongs to a geo entity if all of these regions are geo entities

        Note that this method will not throw an exception even when the underlying mapping for the countryCallingCode does not exist, instead it will return false