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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreadExternal(ObjectInput objectInput) Supports Java Serialization.voidreadFileConfigs(SortedMap<Integer, Set<String>> availableDataFiles) Initializes anMappingFileProviderwithavailableDataFiles.toString()Returns a string representing the data in this class.voidwriteExternal(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 anMappingFileProviderwithavailableDataFiles.- 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:
readExternalin interfaceExternalizable- Throws:
IOException
-
writeExternal
Supports Java Serialization.- Specified by:
writeExternalin 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.
-