Class MetadataSourceImpl
- java.lang.Object
-
- com.google.i18n.phonenumbers.metadata.source.MetadataSourceImpl
-
- All Implemented Interfaces:
MetadataSource
,NonGeographicalEntityMetadataSource
,RegionMetadataSource
public final class MetadataSourceImpl extends java.lang.Object implements MetadataSource
Implementation ofMetadataSource
guarded byMetadataBootstrappingGuard
.By default, a
BlockingMetadataBootstrappingGuard
will be used, but any custom implementation can be injected.
-
-
Constructor Summary
Constructors Constructor Description MetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataBootstrappingGuard<com.google.i18n.phonenumbers.metadata.source.CompositeMetadataContainer> bootstrappingGuard)
MetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataLoader metadataLoader, MetadataParser metadataParser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Phonemetadata.PhoneMetadata
getMetadataForNonGeographicalRegion(int countryCallingCode)
Gets phone metadata for a non-geographical entity.Phonemetadata.PhoneMetadata
getMetadataForRegion(java.lang.String regionCode)
Returns phone metadata for provided geographical region.
-
-
-
Constructor Detail
-
MetadataSourceImpl
public MetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataBootstrappingGuard<com.google.i18n.phonenumbers.metadata.source.CompositeMetadataContainer> bootstrappingGuard)
-
MetadataSourceImpl
public MetadataSourceImpl(PhoneMetadataFileNameProvider phoneMetadataFileNameProvider, MetadataLoader metadataLoader, MetadataParser metadataParser)
-
-
Method Detail
-
getMetadataForNonGeographicalRegion
public Phonemetadata.PhoneMetadata getMetadataForNonGeographicalRegion(int countryCallingCode)
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
public Phonemetadata.PhoneMetadata getMetadataForRegion(java.lang.String regionCode)
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.
-
-