Class MappingFileProvider
java.lang.Object
com.google.i18n.phonenumbers.prefixmapper.MappingFileProvider
- All Implemented Interfaces:
Externalizable
,Serializable
A utility which knows the data files that are available for the phone prefix mappers to use.
The data files contain mappings from phone number prefixes to text descriptions, and are
organized by country calling code and language that the text descriptions are in.
- Author:
- Shaopeng Jia
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
readExternal
(ObjectInput objectInput) Supports Java Serialization.void
readFileConfigs
(SortedMap<Integer, Set<String>> availableDataFiles) Initializes anMappingFileProvider
withavailableDataFiles
.toString()
Returns a string representing the data in this class.void
writeExternal
(ObjectOutput objectOutput) Supports Java Serialization.
-
Constructor Details
-
MappingFileProvider
public MappingFileProvider()Creates an emptyMappingFileProvider
. The default constructor is necessary for implementingExternalizable
. The empty provider could later be populated byreadFileConfigs(java.util.SortedMap)
orreadExternal(java.io.ObjectInput)
.
-
-
Method Details
-
readFileConfigs
Initializes anMappingFileProvider
withavailableDataFiles
.- Parameters:
availableDataFiles
- a map from country calling codes to sets of languages in which data files are available for the specific country calling code. The map is sorted in ascending order of the country calling codes as integers.
-
readExternal
Supports Java Serialization.- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-
writeExternal
Supports Java Serialization.- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
toString
Returns a string representing the data in this class. The string contains one line for each country calling code. The country calling code is followed by a '|' and then a list of comma-separated languages sorted in ascending order.
-