Class FormattingMetadataSourceImpl
- java.lang.Object
-
- com.google.i18n.phonenumbers.metadata.source.FormattingMetadataSourceImpl
-
- All Implemented Interfaces:
FormattingMetadataSource
public final class FormattingMetadataSourceImpl extends java.lang.Object implements FormattingMetadataSource
Implementation ofFormattingMetadataSource
guarded byMetadataBootstrappingGuard
By default, a
BlockingMetadataBootstrappingGuard
will be used, but any custom implementation can be injected.
-
-
Constructor Summary
Constructors Constructor Description FormattingMetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataBootstrappingGuard<com.google.i18n.phonenumbers.metadata.source.MapBackedMetadataContainer<java.lang.Integer>> bootstrappingGuard)
FormattingMetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataLoader metadataLoader, MetadataParser metadataParser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Phonemetadata.PhoneMetadata
getFormattingMetadataForCountryCallingCode(int countryCallingCode)
Returns formatting phone metadata for provided country calling code.
-
-
-
Constructor Detail
-
FormattingMetadataSourceImpl
public FormattingMetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataBootstrappingGuard<com.google.i18n.phonenumbers.metadata.source.MapBackedMetadataContainer<java.lang.Integer>> bootstrappingGuard)
-
FormattingMetadataSourceImpl
public FormattingMetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataLoader metadataLoader, MetadataParser metadataParser)
-
-
Method Detail
-
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.
-
-