Class MetadataSourceImpl
java.lang.Object
com.google.i18n.phonenumbers.metadata.source.MetadataSourceImpl
- All Implemented Interfaces:
MetadataSource
,NonGeographicalEntityMetadataSource
,RegionMetadataSource
Implementation of
MetadataSource
guarded by MetadataBootstrappingGuard
.
By default, a BlockingMetadataBootstrappingGuard
will be used, but any custom
implementation can be injected.
-
Constructor Summary
ConstructorDescriptionMetadataSourceImpl
(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataBootstrappingGuard<com.google.i18n.phonenumbers.metadata.source.CompositeMetadataContainer> bootstrappingGuard) MetadataSourceImpl
(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataLoader metadataLoader, MetadataParser metadataParser) -
Method Summary
Modifier and TypeMethodDescriptiongetMetadataForNonGeographicalRegion
(int countryCallingCode) Gets phone metadata for a non-geographical entity.getMetadataForRegion
(String regionCode) Returns phone metadata for provided geographical region.
-
Constructor Details
-
MetadataSourceImpl
public MetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataBootstrappingGuard<com.google.i18n.phonenumbers.metadata.source.CompositeMetadataContainer> bootstrappingGuard) -
MetadataSourceImpl
public MetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataLoader metadataLoader, MetadataParser metadataParser)
-
-
Method Details
-
getMetadataForNonGeographicalRegion
Description copied from interface:NonGeographicalEntityMetadataSource
Gets phone metadata for a non-geographical entity.- Specified by:
getMetadataForNonGeographicalRegion
in interfaceNonGeographicalEntityMetadataSource
- Parameters:
countryCallingCode
- the country calling code.- Returns:
- the phone metadata for that entity, or null if there is none.
-
getMetadataForRegion
Description copied from interface:RegionMetadataSource
Returns phone metadata for provided geographical region.The
regionCode
must be different fromGeoEntityUtility.REGION_CODE_FOR_NON_GEO_ENTITIES
, which has a special meaning and is used to mark non-geographical regions (seeNonGeographicalEntityMetadataSource
for more information).- Specified by:
getMetadataForRegion
in interfaceRegionMetadataSource
- Returns:
- the phone metadata for provided
regionCode
, or null if there is none.
-