Class FormattingMetadataSourceImpl
java.lang.Object
com.google.i18n.phonenumbers.metadata.source.FormattingMetadataSourceImpl
- All Implemented Interfaces:
FormattingMetadataSource
Implementation of
FormattingMetadataSource
guarded by MetadataBootstrappingGuard
By default, a BlockingMetadataBootstrappingGuard
will be used, but any custom
implementation can be injected.
-
Constructor Summary
ConstructorDescriptionFormattingMetadataSourceImpl
(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataBootstrappingGuard<com.google.i18n.phonenumbers.metadata.source.MapBackedMetadataContainer<Integer>> bootstrappingGuard) FormattingMetadataSourceImpl
(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataLoader metadataLoader, MetadataParser metadataParser) -
Method Summary
Modifier and TypeMethodDescriptiongetFormattingMetadataForCountryCallingCode
(int countryCallingCode) Returns formatting phone metadata for provided country calling code.
-
Constructor Details
-
FormattingMetadataSourceImpl
public FormattingMetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataBootstrappingGuard<com.google.i18n.phonenumbers.metadata.source.MapBackedMetadataContainer<Integer>> bootstrappingGuard) -
FormattingMetadataSourceImpl
public FormattingMetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataLoader metadataLoader, MetadataParser metadataParser)
-
-
Method Details
-
getFormattingMetadataForCountryCallingCode
public Phonemetadata.PhoneMetadata getFormattingMetadataForCountryCallingCode(int countryCallingCode) Description copied from interface:FormattingMetadataSource
Returns formatting phone metadata for provided country calling code.This method is similar to the one in
NonGeographicalEntityMetadataSource.getMetadataForNonGeographicalRegion(int)
, except that it will not fail for geographical regions, it can be used for both geo- and non-geo entities.In case the provided
countryCallingCode
maps to several different regions, only one would contain formatting metadata.- Specified by:
getFormattingMetadataForCountryCallingCode
in interfaceFormattingMetadataSource
- Returns:
- the phone metadata for provided
countryCallingCode
, or null if there is none.
-