Commits

Anonymous committed 15affcb

Decouple Phonemetadata.java from protocol buffer.

Comments (0)

Files changed (8)

java/lib/protobuf-lite.jar

Binary file removed.

java/resources/com/google/i18n/phonenumbers/src/generated_files/PhoneNumberMetadataProto

Binary file modified.

java/resources/com/google/i18n/phonenumbers/test/generated_files/PhoneNumberMetadataProtoForTesting

Binary file modified.

java/src/com/google/i18n/phonenumbers/BuildMetadataProtoFromXml.java

 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.ObjectOutputStream;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.regex.Pattern;
       document.getDocumentElement().normalize();
       Element rootElement = document.getDocumentElement();
       NodeList territory = rootElement.getElementsByTagName("territory");
-      PhoneMetadataCollection.Builder metadataCollection = PhoneMetadataCollection.newBuilder();
+      PhoneMetadataCollection metadataCollection = new PhoneMetadataCollection();
       int numOfTerritories = territory.getLength();
       for (int i = 0; i < numOfTerritories; i++) {
         Element territoryElement = (Element) territory.item(i);
         PhoneMetadata metadata = loadCountryMetadata(regionCode, territoryElement);
         metadataCollection.addMetadata(metadata);
       }
-      metadataCollection.build().writeTo(output);
+      ObjectOutputStream out = new ObjectOutputStream(output);
+      out.writeObject(metadataCollection);
+      out.close();
     } catch (IOException e) {
       LOGGER.log(Level.SEVERE, e.toString());
     } catch (SAXException e) {
   }
 
   private static PhoneMetadata loadCountryMetadata(String regionCode, Element element) {
-    PhoneMetadata.Builder metadata = PhoneMetadata.newBuilder();
+    PhoneMetadata metadata = new PhoneMetadata();
     metadata.setId(regionCode);
     metadata.setCountryCode(Integer.parseInt(element.getAttribute("countryCode")));
     metadata.setInternationalPrefix(validateRE(element.getAttribute("internationalPrefix")));
     if (numOfFormatElements > 0) {
       for (int i = 0; i < numOfFormatElements; i++) {
         Element numberFormatElement = (Element) numberFormatElements.item(i);
-        NumberFormat.Builder format = NumberFormat.newBuilder();
+        NumberFormat format = new NumberFormat();
         if (numberFormatElement.hasAttribute("nationalPrefixFormattingRule")) {
           format.setNationalPrefixFormattingRule(validateRE(
               getNationalPrefixFormattingRuleFromElement(numberFormatElement, nationalPrefix)));
         }
         format.setPattern(validateRE(numberFormatElement.getAttribute("pattern")));
         format.setFormat(validateRE(numberFormatElement.getFirstChild().getNodeValue()));
-        metadata.addNumberFormat(format.build());
+        metadata.addNumberFormat(format);
       }
     }
 
     if (numOfIntlFormatElements > 0) {
       for (int i = 0; i < numOfIntlFormatElements; i++) {
         Element numberFormatElement = (Element) intlNumberFormatElements.item(i);
-        NumberFormat.Builder format = NumberFormat.newBuilder();
+        NumberFormat format = new NumberFormat();
         if (numberFormatElement.hasAttribute("leadingDigits")) {
           format.setLeadingDigits(validateRE(numberFormatElement.getAttribute("leadingDigits")));
         }
         format.setPattern(validateRE(numberFormatElement.getAttribute("pattern")));
         format.setFormat(validateRE(numberFormatElement.getFirstChild().getNodeValue()));
-        metadata.addIntlNumberFormat(format.build());
+        metadata.addIntlNumberFormat(format);
       }
     }
 
     PhoneNumberDesc generalDesc =
-        processPhoneNumberDescElement(PhoneNumberDesc.newBuilder().build(),
-                                      element, "generalDesc");
+        processPhoneNumberDescElement(new PhoneNumberDesc(), element, "generalDesc");
     metadata.setGeneralDesc(generalDesc);
     metadata.setFixedLine(processPhoneNumberDescElement(generalDesc, element, "fixedLine"));
     metadata.setMobile(processPhoneNumberDescElement(generalDesc, element, "mobile"));
         metadata.getFixedLine().getNationalNumberPattern())) {
       metadata.setSameMobileAndFixedLinePattern(true);
     }
-    return metadata.build();
+    return metadata;
   }
 
   private static String getNationalPrefixFormattingRuleFromElement(Element element,
                                                                Element countryElement,
                                                                String numberType) {
     NodeList phoneNumberDescList = countryElement.getElementsByTagName(numberType);
-    PhoneNumberDesc.Builder numberDesc = PhoneNumberDesc.newBuilder();
+    PhoneNumberDesc numberDesc = new PhoneNumberDesc();
     if (phoneNumberDescList.getLength() == 0 &&
         (!numberType.equals("fixedLine") && !numberType.equals("mobile") &&
          !numberType.equals("generalDesc"))) {
       numberDesc.setNationalNumberPattern("NA");
       numberDesc.setPossibleNumberPattern("NA");
-      return numberDesc.build();
+      return numberDesc;
     }
     numberDesc.mergeFrom(generalDesc);
     if (phoneNumberDescList.getLength() > 0) {
         }
       }
     }
-    return numberDesc.build();
+    return numberDesc;
   }
 }

java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java

 import com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc;
 import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
 import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber.CountryCodeSource;
-import com.google.protobuf.MessageLite;
 
-import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.IOException;
-import java.io.OutputStream;
+import java.io.ObjectInputStream;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
   private void init(InputStream source) {
     // Read in metadata for each country.
     try {
-      PhoneMetadataCollection metadataCollection = PhoneMetadataCollection.parseFrom(source);
+      ObjectInputStream in = new ObjectInputStream(source);
+      PhoneMetadataCollection metadataCollection = (PhoneMetadataCollection) in.readObject();
       for (PhoneMetadata metadata : metadataCollection.getMetadataList()) {
         String regionCode = metadata.getId();
         countryToMetadataMap.put(regionCode, metadata);
       countryCodeToRegionCodeMap.put(FRENCH_INDIAN_OCEAN_COUNTRY_CODE, "RE");
     } catch (IOException e) {
       LOGGER.log(Level.WARNING, e.toString());
+    } catch (ClassNotFoundException e) {
+      LOGGER.log(Level.WARNING, e.toString());
     }
   }
 
             NP_PATTERN.matcher(nationalPrefixFormattingRule).replaceFirst(nationalPrefix);
         nationalPrefixFormattingRule =
             FG_PATTERN.matcher(nationalPrefixFormattingRule).replaceFirst("\\$1");
-        userDefinedFormats.set(i, NumberFormat.newBuilder(numFormat)
-            .setNationalPrefixFormattingRule(nationalPrefixFormattingRule).build());
+        numFormat.setNationalPrefixFormattingRule(nationalPrefixFormattingRule);
       }
     }
 
     parseHelper(numberToParse, defaultCountry, true, phoneNumber);
   }
 
-  /**
-   * As no equals method is implemented for MessageLite, we implement our own equals method here
-   * to compare the serialized data.
-   */
-  static Boolean areSameMessages(MessageLite message1, MessageLite message2) {
-    if (message1 == null && message2 == null) {
-      return true;
-    }
-    if (message1 == null || message2 == null) {
-      return false;
-    }
-    OutputStream output1 = new ByteArrayOutputStream();
-    OutputStream output2 = new ByteArrayOutputStream();
-    try {
-      message1.writeTo(output1);
-      message2.writeTo(output2);
-    } catch (IOException e) {
-      LOGGER.log(Level.WARNING, e.toString());
-    }
 
-    return output1.toString().equals(output2.toString());
-  }
 
 
   /**

java/src/com/google/i18n/phonenumbers/Phonemetadata.java

-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: phonemetadata.proto
+/*
+ * Copyright (C) 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Definition of the class representing metadata for international telephone numbers. This class is
+ * hand created based on the class file compiled from phonenumber.proto. Please refer to that file
+ * for detailed descriptions of the meaning of each field.
+ */
 
 package com.google.i18n.phonenumbers;
 
+import java.io.Serializable;
+
 public final class Phonemetadata {
   private Phonemetadata() {}
-  public static void registerAllExtensions(
-      com.google.protobuf.ExtensionRegistryLite registry) {
-  }
-  public static final class NumberFormat extends
-      com.google.protobuf.GeneratedMessageLite {
-    // Use NumberFormat.newBuilder() to construct.
-    private NumberFormat() {
-      initFields();
+  public static final class NumberFormat implements Serializable {
+    private static final long serialVersionUID = 1;
+    public NumberFormat() {}
+
+    // required string pattern = 1;
+    private boolean hasPattern;
+    private String pattern_ = "";
+    public boolean hasPattern() { return hasPattern; }
+    public String getPattern() { return pattern_; }
+    public NumberFormat setPattern(String value) {
+      hasPattern = true;
+      pattern_ = value;
+      return this;
     }
-    private NumberFormat(boolean noInit) {}
-    
-    private static final NumberFormat defaultInstance;
-    public static NumberFormat getDefaultInstance() {
-      return defaultInstance;
+    public NumberFormat clearPattern() {
+      hasPattern = false;
+      pattern_ = "";
+      return this;
     }
-    
-    public NumberFormat getDefaultInstanceForType() {
-      return defaultInstance;
+
+    // required string format = 2;
+    private boolean hasFormat;
+    private String format_ = "";
+    public boolean hasFormat() { return hasFormat; }
+    public String getFormat() { return format_; }
+    public NumberFormat setFormat(String value) {
+      hasFormat = true;
+      format_ = value;
+      return this;
     }
-    
-    // required string pattern = 1;
-    public static final int PATTERN_FIELD_NUMBER = 1;
-    private boolean hasPattern;
-    private java.lang.String pattern_ = "";
-    public boolean hasPattern() { return hasPattern; }
-    public java.lang.String getPattern() { return pattern_; }
-    
-    // required string format = 2;
-    public static final int FORMAT_FIELD_NUMBER = 2;
-    private boolean hasFormat;
-    private java.lang.String format_ = "";
-    public boolean hasFormat() { return hasFormat; }
-    public java.lang.String getFormat() { return format_; }
-    
+    public NumberFormat clearFormat() {
+      hasFormat = false;
+      format_ = "";
+      return this;
+    }
+
     // optional string leading_digits = 3;
-    public static final int LEADING_DIGITS_FIELD_NUMBER = 3;
     private boolean hasLeadingDigits;
-    private java.lang.String leadingDigits_ = "";
+    private String leadingDigits_ = "";
     public boolean hasLeadingDigits() { return hasLeadingDigits; }
-    public java.lang.String getLeadingDigits() { return leadingDigits_; }
-    
+    public String getLeadingDigits() { return leadingDigits_; }
+    public NumberFormat setLeadingDigits(String value) {
+      hasLeadingDigits = true;
+      leadingDigits_ = value;
+      return this;
+    }
+    public NumberFormat clearLeadingDigits() {
+      hasLeadingDigits = false;
+      leadingDigits_ = "";
+      return this;
+    }
+
     // optional string national_prefix_formatting_rule = 4;
-    public static final int NATIONAL_PREFIX_FORMATTING_RULE_FIELD_NUMBER = 4;
     private boolean hasNationalPrefixFormattingRule;
-    private java.lang.String nationalPrefixFormattingRule_ = "";
+    private String nationalPrefixFormattingRule_ = "";
     public boolean hasNationalPrefixFormattingRule() { return hasNationalPrefixFormattingRule; }
-    public java.lang.String getNationalPrefixFormattingRule() { return nationalPrefixFormattingRule_; }
-    
-    private void initFields() {
+    public String getNationalPrefixFormattingRule() { return nationalPrefixFormattingRule_; }
+    public NumberFormat setNationalPrefixFormattingRule(String value) {
+      hasNationalPrefixFormattingRule = true;
+      nationalPrefixFormattingRule_ = value;
+      return this;
     }
+    public NumberFormat clearNationalPrefixFormattingRule() {
+      hasNationalPrefixFormattingRule = false;
+      nationalPrefixFormattingRule_ = "";
+      return this;
+    }
+
+    public final NumberFormat clear() {
+      clearPattern();
+      clearFormat();
+      clearLeadingDigits();
+      clearNationalPrefixFormattingRule();
+      return this;
+    }
+
+    public NumberFormat mergeFrom(NumberFormat other) {
+      if (other.hasPattern()) {
+        setPattern(other.getPattern());
+      }
+      if (other.hasFormat()) {
+        setFormat(other.getFormat());
+      }
+      if (other.hasLeadingDigits()) {
+        setLeadingDigits(other.getLeadingDigits());
+      }
+      if (other.hasNationalPrefixFormattingRule()) {
+        setNationalPrefixFormattingRule(other.getNationalPrefixFormattingRule());
+      }
+      return this;
+    }
+
     public final boolean isInitialized() {
       if (!hasPattern) return false;
       if (!hasFormat) return false;
       return true;
     }
-    
-    public void writeTo(com.google.protobuf.CodedOutputStream output)
-                        throws java.io.IOException {
-      getSerializedSize();
-      if (hasPattern()) {
-        output.writeString(1, getPattern());
+  }
+
+  public static final class PhoneNumberDesc implements Serializable {
+    private static final long serialVersionUID = 1;
+    public PhoneNumberDesc() {}
+
+    // optional string national_number_pattern = 2;
+    private boolean hasNationalNumberPattern;
+    private String nationalNumberPattern_ = "";
+    public boolean hasNationalNumberPattern() { return hasNationalNumberPattern; }
+    public String getNationalNumberPattern() { return nationalNumberPattern_; }
+    public PhoneNumberDesc setNationalNumberPattern(String value) {
+      hasNationalNumberPattern = true;
+      nationalNumberPattern_ = value;
+      return this;
+    }
+    public PhoneNumberDesc clearNationalNumberPattern() {
+      hasNationalNumberPattern = false;
+      nationalNumberPattern_ = "";
+      return this;
+    }
+
+    // optional string possible_number_pattern = 3;
+    private boolean hasPossibleNumberPattern;
+    private String possibleNumberPattern_ = "";
+    public boolean hasPossibleNumberPattern() { return hasPossibleNumberPattern; }
+    public String getPossibleNumberPattern() { return possibleNumberPattern_; }
+    public PhoneNumberDesc setPossibleNumberPattern(String value) {
+      hasPossibleNumberPattern = true;
+      possibleNumberPattern_ = value;
+      return this;
+    }
+    public PhoneNumberDesc clearPossibleNumberPattern() {
+      hasPossibleNumberPattern = false;
+      possibleNumberPattern_ = "";
+      return this;
+    }
+
+    // optional string example_number = 6;
+    private boolean hasExampleNumber;
+    private String exampleNumber_ = "";
+    public boolean hasExampleNumber() { return hasExampleNumber; }
+    public String getExampleNumber() { return exampleNumber_; }
+    public PhoneNumberDesc setExampleNumber(String value) {
+      hasExampleNumber = true;
+      exampleNumber_ = value;
+      return this;
+    }
+    public PhoneNumberDesc clearExampleNumber() {
+      hasExampleNumber = false;
+      exampleNumber_ = "";
+      return this;
+    }
+
+    public final PhoneNumberDesc clear() {
+      clearNationalNumberPattern();
+      clearPossibleNumberPattern();
+      clearExampleNumber();
+      return this;
+    }
+
+    public PhoneNumberDesc mergeFrom(PhoneNumberDesc other) {
+      if (other.hasNationalNumberPattern()) {
+        setNationalNumberPattern(other.getNationalNumberPattern());
       }
-      if (hasFormat()) {
-        output.writeString(2, getFormat());
+      if (other.hasPossibleNumberPattern()) {
+        setPossibleNumberPattern(other.getPossibleNumberPattern());
       }
-      if (hasLeadingDigits()) {
-        output.writeString(3, getLeadingDigits());
+      if (other.hasExampleNumber()) {
+        setExampleNumber(other.getExampleNumber());
       }
-      if (hasNationalPrefixFormattingRule()) {
-        output.writeString(4, getNationalPrefixFormattingRule());
+      return this;
+    }
+
+    public boolean exactlySameAs(PhoneNumberDesc other) {
+      return nationalNumberPattern_.equals(other.nationalNumberPattern_) &&
+          possibleNumberPattern_.equals(other.possibleNumberPattern_) &&
+          exampleNumber_.equals(other.exampleNumber_);
+    }
+  }
+
+  public static final class PhoneMetadata implements Serializable {
+    private static final long serialVersionUID = 1;
+    public PhoneMetadata() {}
+
+    // required PhoneNumberDesc general_desc = 1;
+    private boolean hasGeneralDesc;
+    private PhoneNumberDesc generalDesc_ = null;
+    public boolean hasGeneralDesc() { return hasGeneralDesc; }
+    public PhoneNumberDesc getGeneralDesc() { return generalDesc_; }
+    public PhoneMetadata setGeneralDesc(PhoneNumberDesc value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
+      hasGeneralDesc = true;
+      generalDesc_ = value;
+      return this;
     }
-    
-    private int memoizedSerializedSize = -1;
-    public int getSerializedSize() {
-      int size = memoizedSerializedSize;
-      if (size != -1) return size;
-    
-      size = 0;
-      if (hasPattern()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(1, getPattern());
+    public PhoneMetadata clearGeneralDesc() {
+      hasGeneralDesc = false;
+      generalDesc_ = null;
+      return this;
+    }
+
+    // required PhoneNumberDesc fixed_line = 2;
+    private boolean hasFixedLine;
+    private PhoneNumberDesc fixedLine_ = null;
+    public boolean hasFixedLine() { return hasFixedLine; }
+    public PhoneNumberDesc getFixedLine() { return fixedLine_; }
+    public PhoneMetadata setFixedLine(PhoneNumberDesc value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
-      if (hasFormat()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(2, getFormat());
+      hasFixedLine = true;
+      fixedLine_ = value;
+      return this;
+    }
+    public PhoneMetadata clearFixedLine() {
+      hasFixedLine = false;
+      fixedLine_ = null;
+      return this;
+    }
+
+    // required PhoneNumberDesc mobile = 3;
+    private boolean hasMobile;
+    private PhoneNumberDesc mobile_ = null;
+    public boolean hasMobile() { return hasMobile; }
+    public PhoneNumberDesc getMobile() { return mobile_; }
+    public PhoneMetadata setMobile(PhoneNumberDesc value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
-      if (hasLeadingDigits()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(3, getLeadingDigits());
+      hasMobile = true;
+      mobile_ = value;
+      return this;
+    }
+    public PhoneMetadata clearMobile() {
+      hasMobile = false;
+      mobile_ = null;
+      return this;
+    }
+
+    // required PhoneNumberDesc toll_free = 4;
+    private boolean hasTollFree;
+    private PhoneNumberDesc tollFree_ = null;
+    public boolean hasTollFree() { return hasTollFree; }
+    public PhoneNumberDesc getTollFree() { return tollFree_; }
+    public PhoneMetadata setTollFree(PhoneNumberDesc value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
-      if (hasNationalPrefixFormattingRule()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(4, getNationalPrefixFormattingRule());
+      hasTollFree = true;
+      tollFree_ = value;
+      return this;
+    }
+    public PhoneMetadata clearTollFree() {
+      hasTollFree = false;
+      tollFree_ = null;
+      return this;
+    }
+
+    // required PhoneNumberDesc premium_rate = 5;
+    private boolean hasPremiumRate;
+    private PhoneNumberDesc premiumRate_ = null;
+    public boolean hasPremiumRate() { return hasPremiumRate; }
+    public PhoneNumberDesc getPremiumRate() { return premiumRate_; }
+    public PhoneMetadata setPremiumRate(PhoneNumberDesc value) {
+      if (value == null) {
+        throw new NullPointerException();
       }
-      memoizedSerializedSize = size;
-      return size;
+      hasPremiumRate = true;
+      premiumRate_ = value;
+      return this;
     }
-    
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseFrom(
-        com.google.protobuf.ByteString data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data).buildParsed();
+    public PhoneMetadata clearPremiumRate() {
+      hasPremiumRate = false;
+      premiumRate_ = null;
+      return this;
     }
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseFrom(
-        com.google.protobuf.ByteString data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data, extensionRegistry)
-               .buildParsed();
+
+    // required PhoneNumberDesc shared_cost = 6;
+    private boolean hasSharedCost;
+    private PhoneNumberDesc sharedCost_ = null;
+    public boolean hasSharedCost() { return hasSharedCost; }
+    public PhoneNumberDesc getSharedCost() { return sharedCost_; }
+    public PhoneMetadata setSharedCost(PhoneNumberDesc value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      hasSharedCost = true;
+      sharedCost_ = value;
+      return this;
     }
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseFrom(byte[] data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data).buildParsed();
+    public PhoneMetadata clearSharedCost() {
+      hasSharedCost = false;
+      sharedCost_ = null;
+      return this;
     }
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseFrom(
-        byte[] data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data, extensionRegistry)
-               .buildParsed();
+
+    // required PhoneNumberDesc personal_number = 7;
+    private boolean hasPersonalNumber;
+    private PhoneNumberDesc personalNumber_ = null;
+    public boolean hasPersonalNumber() { return hasPersonalNumber; }
+    public PhoneNumberDesc getPersonalNumber() { return personalNumber_; }
+    public PhoneMetadata setPersonalNumber(PhoneNumberDesc value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      hasPersonalNumber = true;
+      personalNumber_ = value;
+      return this;
     }
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input).buildParsed();
+    public PhoneMetadata clearPersonalNumber() {
+      hasPersonalNumber = false;
+      personalNumber_ = null;
+      return this;
     }
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseFrom(
-        java.io.InputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input, extensionRegistry)
-               .buildParsed();
+
+    // required PhoneNumberDesc voip = 8;
+    private boolean hasVoip;
+    private PhoneNumberDesc voip_ = null;
+    public boolean hasVoip() { return hasVoip; }
+    public PhoneNumberDesc getVoip() { return voip_; }
+    public PhoneMetadata setVoip(PhoneNumberDesc value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      hasVoip = true;
+      voip_ = value;
+      return this;
     }
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseDelimitedFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      Builder builder = newBuilder();
-      if (builder.mergeDelimitedFrom(input)) {
-        return builder.buildParsed();
-      } else {
-        return null;
-      }
+    public PhoneMetadata clearVoip() {
+      hasVoip = false;
+      voip_ = null;
+      return this;
     }
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseDelimitedFrom(
-        java.io.InputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      Builder builder = newBuilder();
-      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
-        return builder.buildParsed();
-      } else {
-        return null;
-      }
+
+    // required string id = 9;
+    private boolean hasId;
+    private String id_ = "";
+    public boolean hasId() { return hasId; }
+    public String getId() { return id_; }
+    public PhoneMetadata setId(String value) {
+      hasId = true;
+      id_ = value;
+      return this;
     }
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseFrom(
-        com.google.protobuf.CodedInputStream input)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input).buildParsed();
+    public PhoneMetadata clearId() {
+      hasId = false;
+      id_ = "";
+      return this;
     }
-    public static com.google.i18n.phonenumbers.Phonemetadata.NumberFormat parseFrom(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input, extensionRegistry)
-               .buildParsed();
-    }
-    
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
-    public static Builder newBuilder(com.google.i18n.phonenumbers.Phonemetadata.NumberFormat prototype) {
-      return newBuilder().mergeFrom(prototype);
-    }
-    public Builder toBuilder() { return newBuilder(this); }
-    
-    public static final class Builder extends
-        com.google.protobuf.GeneratedMessageLite.Builder<
-          com.google.i18n.phonenumbers.Phonemetadata.NumberFormat, Builder> {
-      private com.google.i18n.phonenumbers.Phonemetadata.NumberFormat result;
-      
-      // Construct using com.google.i18n.phonenumbers.Phonemetadata.NumberFormat.newBuilder()
-      private Builder() {}
-      
-      private static Builder create() {
-        Builder builder = new Builder();
-        builder.result = new com.google.i18n.phonenumbers.Phonemetadata.NumberFormat();
-        return builder;
-      }
-      
-      protected com.google.i18n.phonenumbers.Phonemetadata.NumberFormat internalGetResult() {
-        return result;
-      }
-      
-      public Builder clear() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "Cannot call clear() after build().");
-        }
-        result = new com.google.i18n.phonenumbers.Phonemetadata.NumberFormat();
-        return this;
-      }
-      
-      public Builder clone() {
-        return create().mergeFrom(result);
-      }
-      
-      public com.google.i18n.phonenumbers.Phonemetadata.NumberFormat getDefaultInstanceForType() {
-        return com.google.i18n.phonenumbers.Phonemetadata.NumberFormat.getDefaultInstance();
-      }
-      
-      public boolean isInitialized() {
-        return result.isInitialized();
-      }
-      public com.google.i18n.phonenumbers.Phonemetadata.NumberFormat build() {
-        if (result != null && !isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return buildPartial();
-      }
-      
-      private com.google.i18n.phonenumbers.Phonemetadata.NumberFormat buildParsed()
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        if (!isInitialized()) {
-          throw newUninitializedMessageException(
-            result).asInvalidProtocolBufferException();
-        }
-        return buildPartial();
-      }
-      
-      public com.google.i18n.phonenumbers.Phonemetadata.NumberFormat buildPartial() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "build() has already been called on this Builder.");
-        }
-        com.google.i18n.phonenumbers.Phonemetadata.NumberFormat returnMe = result;
-        result = null;
-        return returnMe;
-      }
-      
-      public Builder mergeFrom(com.google.i18n.phonenumbers.Phonemetadata.NumberFormat other) {
-        if (other == com.google.i18n.phonenumbers.Phonemetadata.NumberFormat.getDefaultInstance()) return this;
-        if (other.hasPattern()) {
-          setPattern(other.getPattern());
-        }
-        if (other.hasFormat()) {
-          setFormat(other.getFormat());
-        }
-        if (other.hasLeadingDigits()) {
-          setLeadingDigits(other.getLeadingDigits());
-        }
-        if (other.hasNationalPrefixFormattingRule()) {
-          setNationalPrefixFormattingRule(other.getNationalPrefixFormattingRule());
-        }
-        return this;
-      }
-      
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        while (true) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              return this;
-            default: {
-              if (!parseUnknownField(input, extensionRegistry, tag)) {
-                return this;
-              }
-              break;
-            }
-            case 10: {
-              setPattern(input.readString());
-              break;
-            }
-            case 18: {
-              setFormat(input.readString());
-              break;
-            }
-            case 26: {
-              setLeadingDigits(input.readString());
-              break;
-            }
-            case 34: {
-              setNationalPrefixFormattingRule(input.readString());
-              break;
-            }
-          }
-        }
-      }
-      
-      
-      // required string pattern = 1;
-      public boolean hasPattern() {
-        return result.hasPattern();
-      }
-      public java.lang.String getPattern() {
-        return result.getPattern();
-      }
-      public Builder setPattern(java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  result.hasPattern = true;
-        result.pattern_ = value;
-        return this;
-      }
-      public Builder clearPattern() {
-        result.hasPattern = false;
-        result.pattern_ = getDefaultInstance().getPattern();
-        return this;
-      }
-      
-      // required string format = 2;
-      public boolean hasFormat() {
-        return result.hasFormat();
-      }
-      public java.lang.String getFormat() {
-        return result.getFormat();
-      }
-      public Builder setFormat(java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  result.hasFormat = true;
-        result.format_ = value;
-        return this;
-      }
-      public Builder clearFormat() {
-        result.hasFormat = false;
-        result.format_ = getDefaultInstance().getFormat();
-        return this;
-      }
-      
-      // optional string leading_digits = 3;
-      public boolean hasLeadingDigits() {
-        return result.hasLeadingDigits();
-      }
-      public java.lang.String getLeadingDigits() {
-        return result.getLeadingDigits();
-      }
-      public Builder setLeadingDigits(java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  result.hasLeadingDigits = true;
-        result.leadingDigits_ = value;
-        return this;
-      }
-      public Builder clearLeadingDigits() {
-        result.hasLeadingDigits = false;
-        result.leadingDigits_ = getDefaultInstance().getLeadingDigits();
-        return this;
-      }
-      
-      // optional string national_prefix_formatting_rule = 4;
-      public boolean hasNationalPrefixFormattingRule() {
-        return result.hasNationalPrefixFormattingRule();
-      }
-      public java.lang.String getNationalPrefixFormattingRule() {
-        return result.getNationalPrefixFormattingRule();
-      }
-      public Builder setNationalPrefixFormattingRule(java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  result.hasNationalPrefixFormattingRule = true;
-        result.nationalPrefixFormattingRule_ = value;
-        return this;
-      }
-      public Builder clearNationalPrefixFormattingRule() {
-        result.hasNationalPrefixFormattingRule = false;
-        result.nationalPrefixFormattingRule_ = getDefaultInstance().getNationalPrefixFormattingRule();
-        return this;
-      }
-      
-      // @@protoc_insertion_point(builder_scope:i18n.phonenumbers.NumberFormat)
-    }
-    
-    static {
-      defaultInstance = new NumberFormat(true);
-      com.google.i18n.phonenumbers.Phonemetadata.internalForceInit();
-      defaultInstance.initFields();
-    }
-    
-    // @@protoc_insertion_point(class_scope:i18n.phonenumbers.NumberFormat)
-  }
-  
-  public static final class PhoneNumberDesc extends
-      com.google.protobuf.GeneratedMessageLite {
-    // Use PhoneNumberDesc.newBuilder() to construct.
-    private PhoneNumberDesc() {
-      initFields();
-    }
-    private PhoneNumberDesc(boolean noInit) {}
-    
-    private static final PhoneNumberDesc defaultInstance;
-    public static PhoneNumberDesc getDefaultInstance() {
-      return defaultInstance;
-    }
-    
-    public PhoneNumberDesc getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-    
-    // optional string national_number_pattern = 2;
-    public static final int NATIONAL_NUMBER_PATTERN_FIELD_NUMBER = 2;
-    private boolean hasNationalNumberPattern;
-    private java.lang.String nationalNumberPattern_ = "";
-    public boolean hasNationalNumberPattern() { return hasNationalNumberPattern; }
-    public java.lang.String getNationalNumberPattern() { return nationalNumberPattern_; }
-    
-    // optional string possible_number_pattern = 3;
-    public static final int POSSIBLE_NUMBER_PATTERN_FIELD_NUMBER = 3;
-    private boolean hasPossibleNumberPattern;
-    private java.lang.String possibleNumberPattern_ = "";
-    public boolean hasPossibleNumberPattern() { return hasPossibleNumberPattern; }
-    public java.lang.String getPossibleNumberPattern() { return possibleNumberPattern_; }
-    
-    // optional string example_number = 6;
-    public static final int EXAMPLE_NUMBER_FIELD_NUMBER = 6;
-    private boolean hasExampleNumber;
-    private java.lang.String exampleNumber_ = "";
-    public boolean hasExampleNumber() { return hasExampleNumber; }
-    public java.lang.String getExampleNumber() { return exampleNumber_; }
-    
-    private void initFields() {
-    }
-    public final boolean isInitialized() {
-      return true;
-    }
-    
-    public void writeTo(com.google.protobuf.CodedOutputStream output)
-                        throws java.io.IOException {
-      getSerializedSize();
-      if (hasNationalNumberPattern()) {
-        output.writeString(2, getNationalNumberPattern());
-      }
-      if (hasPossibleNumberPattern()) {
-        output.writeString(3, getPossibleNumberPattern());
-      }
-      if (hasExampleNumber()) {
-        output.writeString(6, getExampleNumber());
-      }
-    }
-    
-    private int memoizedSerializedSize = -1;
-    public int getSerializedSize() {
-      int size = memoizedSerializedSize;
-      if (size != -1) return size;
-    
-      size = 0;
-      if (hasNationalNumberPattern()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(2, getNationalNumberPattern());
-      }
-      if (hasPossibleNumberPattern()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(3, getPossibleNumberPattern());
-      }
-      if (hasExampleNumber()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(6, getExampleNumber());
-      }
-      memoizedSerializedSize = size;
-      return size;
-    }
-    
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseFrom(
-        com.google.protobuf.ByteString data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data).buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseFrom(
-        com.google.protobuf.ByteString data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data, extensionRegistry)
-               .buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseFrom(byte[] data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data).buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseFrom(
-        byte[] data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data, extensionRegistry)
-               .buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input).buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseFrom(
-        java.io.InputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input, extensionRegistry)
-               .buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseDelimitedFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      Builder builder = newBuilder();
-      if (builder.mergeDelimitedFrom(input)) {
-        return builder.buildParsed();
-      } else {
-        return null;
-      }
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseDelimitedFrom(
-        java.io.InputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      Builder builder = newBuilder();
-      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
-        return builder.buildParsed();
-      } else {
-        return null;
-      }
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseFrom(
-        com.google.protobuf.CodedInputStream input)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input).buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc parseFrom(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input, extensionRegistry)
-               .buildParsed();
-    }
-    
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
-    public static Builder newBuilder(com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc prototype) {
-      return newBuilder().mergeFrom(prototype);
-    }
-    public Builder toBuilder() { return newBuilder(this); }
-    
-    public static final class Builder extends
-        com.google.protobuf.GeneratedMessageLite.Builder<
-          com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc, Builder> {
-      private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc result;
-      
-      // Construct using com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.newBuilder()
-      private Builder() {}
-      
-      private static Builder create() {
-        Builder builder = new Builder();
-        builder.result = new com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc();
-        return builder;
-      }
-      
-      protected com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc internalGetResult() {
-        return result;
-      }
-      
-      public Builder clear() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "Cannot call clear() after build().");
-        }
-        result = new com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc();
-        return this;
-      }
-      
-      public Builder clone() {
-        return create().mergeFrom(result);
-      }
-      
-      public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc getDefaultInstanceForType() {
-        return com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance();
-      }
-      
-      public boolean isInitialized() {
-        return result.isInitialized();
-      }
-      public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc build() {
-        if (result != null && !isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return buildPartial();
-      }
-      
-      private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc buildParsed()
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        if (!isInitialized()) {
-          throw newUninitializedMessageException(
-            result).asInvalidProtocolBufferException();
-        }
-        return buildPartial();
-      }
-      
-      public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc buildPartial() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "build() has already been called on this Builder.");
-        }
-        com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc returnMe = result;
-        result = null;
-        return returnMe;
-      }
-      
-      public Builder mergeFrom(com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc other) {
-        if (other == com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance()) return this;
-        if (other.hasNationalNumberPattern()) {
-          setNationalNumberPattern(other.getNationalNumberPattern());
-        }
-        if (other.hasPossibleNumberPattern()) {
-          setPossibleNumberPattern(other.getPossibleNumberPattern());
-        }
-        if (other.hasExampleNumber()) {
-          setExampleNumber(other.getExampleNumber());
-        }
-        return this;
-      }
-      
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        while (true) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              return this;
-            default: {
-              if (!parseUnknownField(input, extensionRegistry, tag)) {
-                return this;
-              }
-              break;
-            }
-            case 18: {
-              setNationalNumberPattern(input.readString());
-              break;
-            }
-            case 26: {
-              setPossibleNumberPattern(input.readString());
-              break;
-            }
-            case 50: {
-              setExampleNumber(input.readString());
-              break;
-            }
-          }
-        }
-      }
-      
-      
-      // optional string national_number_pattern = 2;
-      public boolean hasNationalNumberPattern() {
-        return result.hasNationalNumberPattern();
-      }
-      public java.lang.String getNationalNumberPattern() {
-        return result.getNationalNumberPattern();
-      }
-      public Builder setNationalNumberPattern(java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  result.hasNationalNumberPattern = true;
-        result.nationalNumberPattern_ = value;
-        return this;
-      }
-      public Builder clearNationalNumberPattern() {
-        result.hasNationalNumberPattern = false;
-        result.nationalNumberPattern_ = getDefaultInstance().getNationalNumberPattern();
-        return this;
-      }
-      
-      // optional string possible_number_pattern = 3;
-      public boolean hasPossibleNumberPattern() {
-        return result.hasPossibleNumberPattern();
-      }
-      public java.lang.String getPossibleNumberPattern() {
-        return result.getPossibleNumberPattern();
-      }
-      public Builder setPossibleNumberPattern(java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  result.hasPossibleNumberPattern = true;
-        result.possibleNumberPattern_ = value;
-        return this;
-      }
-      public Builder clearPossibleNumberPattern() {
-        result.hasPossibleNumberPattern = false;
-        result.possibleNumberPattern_ = getDefaultInstance().getPossibleNumberPattern();
-        return this;
-      }
-      
-      // optional string example_number = 6;
-      public boolean hasExampleNumber() {
-        return result.hasExampleNumber();
-      }
-      public java.lang.String getExampleNumber() {
-        return result.getExampleNumber();
-      }
-      public Builder setExampleNumber(java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  result.hasExampleNumber = true;
-        result.exampleNumber_ = value;
-        return this;
-      }
-      public Builder clearExampleNumber() {
-        result.hasExampleNumber = false;
-        result.exampleNumber_ = getDefaultInstance().getExampleNumber();
-        return this;
-      }
-      
-      // @@protoc_insertion_point(builder_scope:i18n.phonenumbers.PhoneNumberDesc)
-    }
-    
-    static {
-      defaultInstance = new PhoneNumberDesc(true);
-      com.google.i18n.phonenumbers.Phonemetadata.internalForceInit();
-      defaultInstance.initFields();
-    }
-    
-    // @@protoc_insertion_point(class_scope:i18n.phonenumbers.PhoneNumberDesc)
-  }
-  
-  public static final class PhoneMetadata extends
-      com.google.protobuf.GeneratedMessageLite {
-    // Use PhoneMetadata.newBuilder() to construct.
-    private PhoneMetadata() {
-      initFields();
-    }
-    private PhoneMetadata(boolean noInit) {}
-    
-    private static final PhoneMetadata defaultInstance;
-    public static PhoneMetadata getDefaultInstance() {
-      return defaultInstance;
-    }
-    
-    public PhoneMetadata getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-    
-    // required .i18n.phonenumbers.PhoneNumberDesc general_desc = 1;
-    public static final int GENERAL_DESC_FIELD_NUMBER = 1;
-    private boolean hasGeneralDesc;
-    private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc generalDesc_;
-    public boolean hasGeneralDesc() { return hasGeneralDesc; }
-    public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc getGeneralDesc() { return generalDesc_; }
-    
-    // required .i18n.phonenumbers.PhoneNumberDesc fixed_line = 2;
-    public static final int FIXED_LINE_FIELD_NUMBER = 2;
-    private boolean hasFixedLine;
-    private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc fixedLine_;
-    public boolean hasFixedLine() { return hasFixedLine; }
-    public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc getFixedLine() { return fixedLine_; }
-    
-    // required .i18n.phonenumbers.PhoneNumberDesc mobile = 3;
-    public static final int MOBILE_FIELD_NUMBER = 3;
-    private boolean hasMobile;
-    private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc mobile_;
-    public boolean hasMobile() { return hasMobile; }
-    public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc getMobile() { return mobile_; }
-    
-    // required .i18n.phonenumbers.PhoneNumberDesc toll_free = 4;
-    public static final int TOLL_FREE_FIELD_NUMBER = 4;
-    private boolean hasTollFree;
-    private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc tollFree_;
-    public boolean hasTollFree() { return hasTollFree; }
-    public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc getTollFree() { return tollFree_; }
-    
-    // required .i18n.phonenumbers.PhoneNumberDesc premium_rate = 5;
-    public static final int PREMIUM_RATE_FIELD_NUMBER = 5;
-    private boolean hasPremiumRate;
-    private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc premiumRate_;
-    public boolean hasPremiumRate() { return hasPremiumRate; }
-    public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc getPremiumRate() { return premiumRate_; }
-    
-    // required .i18n.phonenumbers.PhoneNumberDesc shared_cost = 6;
-    public static final int SHARED_COST_FIELD_NUMBER = 6;
-    private boolean hasSharedCost;
-    private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc sharedCost_;
-    public boolean hasSharedCost() { return hasSharedCost; }
-    public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc getSharedCost() { return sharedCost_; }
-    
-    // required .i18n.phonenumbers.PhoneNumberDesc personal_number = 7;
-    public static final int PERSONAL_NUMBER_FIELD_NUMBER = 7;
-    private boolean hasPersonalNumber;
-    private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc personalNumber_;
-    public boolean hasPersonalNumber() { return hasPersonalNumber; }
-    public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc getPersonalNumber() { return personalNumber_; }
-    
-    // required .i18n.phonenumbers.PhoneNumberDesc voip = 8;
-    public static final int VOIP_FIELD_NUMBER = 8;
-    private boolean hasVoip;
-    private com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc voip_;
-    public boolean hasVoip() { return hasVoip; }
-    public com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc getVoip() { return voip_; }
-    
-    // required string id = 9;
-    public static final int ID_FIELD_NUMBER = 9;
-    private boolean hasId;
-    private java.lang.String id_ = "";
-    public boolean hasId() { return hasId; }
-    public java.lang.String getId() { return id_; }
-    
+
     // required int32 country_code = 10;
-    public static final int COUNTRY_CODE_FIELD_NUMBER = 10;
     private boolean hasCountryCode;
     private int countryCode_ = 0;
     public boolean hasCountryCode() { return hasCountryCode; }
     public int getCountryCode() { return countryCode_; }
-    
+    public PhoneMetadata setCountryCode(int value) {
+      hasCountryCode = true;
+      countryCode_ = value;
+      return this;
+    }
+    public PhoneMetadata clearCountryCode() {
+      hasCountryCode = false;
+      countryCode_ = 0;
+      return this;
+    }
+
     // required string international_prefix = 11;
-    public static final int INTERNATIONAL_PREFIX_FIELD_NUMBER = 11;
     private boolean hasInternationalPrefix;
-    private java.lang.String internationalPrefix_ = "";
+    private String internationalPrefix_ = "";
     public boolean hasInternationalPrefix() { return hasInternationalPrefix; }
-    public java.lang.String getInternationalPrefix() { return internationalPrefix_; }
-    
+    public String getInternationalPrefix() { return internationalPrefix_; }
+    public PhoneMetadata setInternationalPrefix(String value) {
+      hasInternationalPrefix = true;
+      internationalPrefix_ = value;
+      return this;
+    }
+    public PhoneMetadata clearInternationalPrefix() {
+      hasInternationalPrefix = false;
+      internationalPrefix_ = "";
+      return this;
+    }
+
     // optional string preferred_international_prefix = 17;
-    public static final int PREFERRED_INTERNATIONAL_PREFIX_FIELD_NUMBER = 17;
     private boolean hasPreferredInternationalPrefix;
-    private java.lang.String preferredInternationalPrefix_ = "";
+    private String preferredInternationalPrefix_ = "";
     public boolean hasPreferredInternationalPrefix() { return hasPreferredInternationalPrefix; }
-    public java.lang.String getPreferredInternationalPrefix() { return preferredInternationalPrefix_; }
-    
+    public String getPreferredInternationalPrefix() { return preferredInternationalPrefix_; }
+    public PhoneMetadata setPreferredInternationalPrefix(String value) {
+      hasPreferredInternationalPrefix = true;
+      preferredInternationalPrefix_ = value;
+      return this;
+    }
+    public PhoneMetadata clearPreferredInternationalPrefix() {
+      hasPreferredInternationalPrefix = false;
+      preferredInternationalPrefix_ = "";
+      return this;
+    }
+
     // optional string national_prefix = 12;
-    public static final int NATIONAL_PREFIX_FIELD_NUMBER = 12;
     private boolean hasNationalPrefix;
-    private java.lang.String nationalPrefix_ = "";
+    private String nationalPrefix_ = "";
     public boolean hasNationalPrefix() { return hasNationalPrefix; }
-    public java.lang.String getNationalPrefix() { return nationalPrefix_; }
-    
+    public String getNationalPrefix() { return nationalPrefix_; }
+    public PhoneMetadata setNationalPrefix(String value) {
+      hasNationalPrefix = true;
+      nationalPrefix_ = value;
+      return this;
+    }
+    public PhoneMetadata clearNationalPrefix() {
+      hasNationalPrefix = false;
+      nationalPrefix_ = "";
+      return this;
+    }
+
     // optional string preferred_extn_prefix = 13;
-    public static final int PREFERRED_EXTN_PREFIX_FIELD_NUMBER = 13;
     private boolean hasPreferredExtnPrefix;
-    private java.lang.String preferredExtnPrefix_ = "";
+    private String preferredExtnPrefix_ = "";
     public boolean hasPreferredExtnPrefix() { return hasPreferredExtnPrefix; }
-    public java.lang.String getPreferredExtnPrefix() { return preferredExtnPrefix_; }
-    
+    public String getPreferredExtnPrefix() { return preferredExtnPrefix_; }
+    public PhoneMetadata setPreferredExtnPrefix(String value) {
+      hasPreferredExtnPrefix = true;
+      preferredExtnPrefix_ = value;
+      return this;
+    }
+    public PhoneMetadata clearPreferredExtnPrefix() {
+      hasPreferredExtnPrefix = false;
+      preferredExtnPrefix_ = "";
+      return this;
+    }
+
     // optional string national_prefix_for_parsing = 15;
-    public static final int NATIONAL_PREFIX_FOR_PARSING_FIELD_NUMBER = 15;
     private boolean hasNationalPrefixForParsing;
-    private java.lang.String nationalPrefixForParsing_ = "";
+    private String nationalPrefixForParsing_ = "";
     public boolean hasNationalPrefixForParsing() { return hasNationalPrefixForParsing; }
-    public java.lang.String getNationalPrefixForParsing() { return nationalPrefixForParsing_; }
-    
+    public String getNationalPrefixForParsing() { return nationalPrefixForParsing_; }
+    public PhoneMetadata setNationalPrefixForParsing(String value) {
+      hasNationalPrefixForParsing = true;
+      nationalPrefixForParsing_ = value;
+      return this;
+    }
+    public PhoneMetadata clearNationalPrefixForParsing() {
+      hasNationalPrefixForParsing = false;
+      nationalPrefixForParsing_ = "";
+      return this;
+    }
+
     // optional string national_prefix_transform_rule = 16;
-    public static final int NATIONAL_PREFIX_TRANSFORM_RULE_FIELD_NUMBER = 16;
     private boolean hasNationalPrefixTransformRule;
-    private java.lang.String nationalPrefixTransformRule_ = "";
+    private String nationalPrefixTransformRule_ = "";
     public boolean hasNationalPrefixTransformRule() { return hasNationalPrefixTransformRule; }
-    public java.lang.String getNationalPrefixTransformRule() { return nationalPrefixTransformRule_; }
-    
+    public String getNationalPrefixTransformRule() { return nationalPrefixTransformRule_; }
+    public PhoneMetadata setNationalPrefixTransformRule(String value) {
+      hasNationalPrefixTransformRule = true;
+      nationalPrefixTransformRule_ = value;
+      return this;
+    }
+    public PhoneMetadata clearNationalPrefixTransformRule() {
+      hasNationalPrefixTransformRule = false;
+      nationalPrefixTransformRule_ = "";
+      return this;
+    }
+
     // optional bool same_mobile_and_fixed_line_pattern = 18 [default = false];
-    public static final int SAME_MOBILE_AND_FIXED_LINE_PATTERN_FIELD_NUMBER = 18;
     private boolean hasSameMobileAndFixedLinePattern;
     private boolean sameMobileAndFixedLinePattern_ = false;
     public boolean hasSameMobileAndFixedLinePattern() { return hasSameMobileAndFixedLinePattern; }
     public boolean getSameMobileAndFixedLinePattern() { return sameMobileAndFixedLinePattern_; }
-    
-    // repeated .i18n.phonenumbers.NumberFormat number_format = 19;
-    public static final int NUMBER_FORMAT_FIELD_NUMBER = 19;
-    private java.util.List<com.google.i18n.phonenumbers.Phonemetadata.NumberFormat> numberFormat_ =
+    public PhoneMetadata setSameMobileAndFixedLinePattern(boolean value) {
+      hasSameMobileAndFixedLinePattern = true;
+      sameMobileAndFixedLinePattern_ = value;
+      return this;
+    }
+    public PhoneMetadata clearSameMobileAndFixedLinePattern() {
+      hasSameMobileAndFixedLinePattern = false;
+      sameMobileAndFixedLinePattern_ = false;
+      return this;
+    }
+
+    // repeated NumberFormat number_format = 19;
+    private java.util.List<NumberFormat> numberFormat_ =
       java.util.Collections.emptyList();
-    public java.util.List<com.google.i18n.phonenumbers.Phonemetadata.NumberFormat> getNumberFormatList() {
+    public java.util.List<NumberFormat> getNumberFormatList() {
       return numberFormat_;
     }
     public int getNumberFormatCount() { return numberFormat_.size(); }
-    public com.google.i18n.phonenumbers.Phonemetadata.NumberFormat getNumberFormat(int index) {
+    public NumberFormat getNumberFormat(int index) {
       return numberFormat_.get(index);
     }
-    
-    // repeated .i18n.phonenumbers.NumberFormat intl_number_format = 20;
-    public static final int INTL_NUMBER_FORMAT_FIELD_NUMBER = 20;
-    private java.util.List<com.google.i18n.phonenumbers.Phonemetadata.NumberFormat> intlNumberFormat_ =
+    public PhoneMetadata setNumberFormat(int index, NumberFormat value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      numberFormat_.set(index, value);
+      return this;
+    }
+    public PhoneMetadata addNumberFormat(NumberFormat value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      if (numberFormat_.isEmpty()) {
+        numberFormat_ = new java.util.ArrayList<NumberFormat>();
+      }
+      numberFormat_.add(value);
+      return this;
+    }
+    public PhoneMetadata clearNumberFormat() {
+      numberFormat_ = java.util.Collections.emptyList();
+      return this;
+    }
+
+    // repeated NumberFormat intl_number_format = 20;
+    private java.util.List<NumberFormat> intlNumberFormat_ =
       java.util.Collections.emptyList();
-    public java.util.List<com.google.i18n.phonenumbers.Phonemetadata.NumberFormat> getIntlNumberFormatList() {
+    public java.util.List<NumberFormat> getIntlNumberFormatList() {
       return intlNumberFormat_;
     }
     public int getIntlNumberFormatCount() { return intlNumberFormat_.size(); }
-    public com.google.i18n.phonenumbers.Phonemetadata.NumberFormat getIntlNumberFormat(int index) {
+    public NumberFormat getIntlNumberFormat(int index) {
       return intlNumberFormat_.get(index);
     }
+    public PhoneMetadata setIntlNumberFormat(int index, NumberFormat value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      intlNumberFormat_.set(index, value);
+      return this;
+    }
+    public PhoneMetadata addIntlNumberFormat(NumberFormat value) {
+      if (value == null) {
+        throw new NullPointerException();
+      }
+      if (intlNumberFormat_.isEmpty()) {
+        intlNumberFormat_ = new java.util.ArrayList<NumberFormat>();
+      }
+      intlNumberFormat_.add(value);
+      return this;
+    }
+    public PhoneMetadata clearIntlNumberFormat() {
+      intlNumberFormat_ = java.util.Collections.emptyList();
+      return this;
+    }
+
+    // optional string national_prefix_formatting_rule = 21;
+    private boolean hasNationalPrefixFormattingRule;
+    private String nationalPrefixFormattingRule_ = "";
+    public boolean hasNationalPrefixFormattingRule() { return hasNationalPrefixFormattingRule; }
+    public String getNationalPrefixFormattingRule() { return nationalPrefixFormattingRule_; }
+    public PhoneMetadata setNationalPrefixFormattingRule(String value) {
+      hasNationalPrefixFormattingRule = true;
+      nationalPrefixFormattingRule_ = value;
+      return this;
+    }
+    public PhoneMetadata clearNationalPrefixFormattingRule() {
+      hasNationalPrefixFormattingRule = false;
+      nationalPrefixFormattingRule_ = "";
+      return this;
+    }
+
+    public final PhoneMetadata clear() {
+      clearGeneralDesc();
+      clearFixedLine();
+      clearMobile();
+      clearTollFree();
+      clearPremiumRate();
+      clearSharedCost();
+      clearPersonalNumber();
+      clearVoip();
+      clearId();
+      clearCountryCode();
+      clearInternationalPrefix();
+      clearPreferredInternationalPrefix();
+      clearNationalPrefix();
+      clearPreferredExtnPrefix();
+      clearNationalPrefixForParsing();
+      clearNationalPrefixTransformRule();
+      clearSameMobileAndFixedLinePattern();
+      clearNumberFormat();
+      clearIntlNumberFormat();
+      clearNationalPrefixFormattingRule();
+      return this;
+    }
+  }
+
+  public static final class PhoneMetadataCollection implements Serializable {
+    private static final long serialVersionUID = 1;
+    public PhoneMetadataCollection() {}
     
-    // optional string national_prefix_formatting_rule = 21;
-    public static final int NATIONAL_PREFIX_FORMATTING_RULE_FIELD_NUMBER = 21;
-    private boolean hasNationalPrefixFormattingRule;
-    private java.lang.String nationalPrefixFormattingRule_ = "";
-    public boolean hasNationalPrefixFormattingRule() { return hasNationalPrefixFormattingRule; }
-    public java.lang.String getNationalPrefixFormattingRule() { return nationalPrefixFormattingRule_; }
-    
-    private void initFields() {
-      generalDesc_ = com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance();
-      fixedLine_ = com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance();
-      mobile_ = com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance();
-      tollFree_ = com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance();
-      premiumRate_ = com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance();
-      sharedCost_ = com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance();
-      personalNumber_ = com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance();
-      voip_ = com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc.getDefaultInstance();
-    }
-    public final boolean isInitialized() {
-      if (!hasGeneralDesc) return false;
-      if (!hasFixedLine) return false;
-      if (!hasMobile) return false;
-      if (!hasTollFree) return false;
-      if (!hasPremiumRate) return false;
-      if (!hasSharedCost) return false;
-      if (!hasPersonalNumber) return false;
-      if (!hasVoip) return false;
-      if (!hasId) return false;
-      if (!hasCountryCode) return false;
-      if (!hasInternationalPrefix) return false;
-      for (com.google.i18n.phonenumbers.Phonemetadata.NumberFormat element : getNumberFormatList()) {
-        if (!element.isInitialized()) return false;
-      }
-      for (com.google.i18n.phonenumbers.Phonemetadata.NumberFormat element : getIntlNumberFormatList()) {
-        if (!element.isInitialized()) return false;
-      }
-      return true;
-    }
-    
-    public void writeTo(com.google.protobuf.CodedOutputStream output)
-                        throws java.io.IOException {
-      getSerializedSize();
-      if (hasGeneralDesc()) {
-        output.writeMessage(1, getGeneralDesc());
-      }
-      if (hasFixedLine()) {
-        output.writeMessage(2, getFixedLine());
-      }
-      if (hasMobile()) {
-        output.writeMessage(3, getMobile());
-      }
-      if (hasTollFree()) {
-        output.writeMessage(4, getTollFree());
-      }
-      if (hasPremiumRate()) {
-        output.writeMessage(5, getPremiumRate());
-      }
-      if (hasSharedCost()) {
-        output.writeMessage(6, getSharedCost());
-      }
-      if (hasPersonalNumber()) {
-        output.writeMessage(7, getPersonalNumber());
-      }
-      if (hasVoip()) {
-        output.writeMessage(8, getVoip());
-      }
-      if (hasId()) {
-        output.writeString(9, getId());
-      }
-      if (hasCountryCode()) {
-        output.writeInt32(10, getCountryCode());
-      }
-      if (hasInternationalPrefix()) {
-        output.writeString(11, getInternationalPrefix());
-      }
-      if (hasNationalPrefix()) {
-        output.writeString(12, getNationalPrefix());
-      }
-      if (hasPreferredExtnPrefix()) {
-        output.writeString(13, getPreferredExtnPrefix());
-      }
-      if (hasNationalPrefixForParsing()) {
-        output.writeString(15, getNationalPrefixForParsing());
-      }
-      if (hasNationalPrefixTransformRule()) {
-        output.writeString(16, getNationalPrefixTransformRule());
-      }
-      if (hasPreferredInternationalPrefix()) {
-        output.writeString(17, getPreferredInternationalPrefix());
-      }
-      if (hasSameMobileAndFixedLinePattern()) {
-        output.writeBool(18, getSameMobileAndFixedLinePattern());
-      }
-      for (com.google.i18n.phonenumbers.Phonemetadata.NumberFormat element : getNumberFormatList()) {
-        output.writeMessage(19, element);
-      }
-      for (com.google.i18n.phonenumbers.Phonemetadata.NumberFormat element : getIntlNumberFormatList()) {
-        output.writeMessage(20, element);
-      }
-      if (hasNationalPrefixFormattingRule()) {
-        output.writeString(21, getNationalPrefixFormattingRule());
-      }
-    }
-    
-    private int memoizedSerializedSize = -1;
-    public int getSerializedSize() {
-      int size = memoizedSerializedSize;
-      if (size != -1) return size;
-    
-      size = 0;
-      if (hasGeneralDesc()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(1, getGeneralDesc());
-      }
-      if (hasFixedLine()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(2, getFixedLine());
-      }
-      if (hasMobile()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(3, getMobile());
-      }
-      if (hasTollFree()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(4, getTollFree());
-      }
-      if (hasPremiumRate()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(5, getPremiumRate());
-      }
-      if (hasSharedCost()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(6, getSharedCost());
-      }
-      if (hasPersonalNumber()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(7, getPersonalNumber());
-      }
-      if (hasVoip()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(8, getVoip());
-      }
-      if (hasId()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(9, getId());
-      }
-      if (hasCountryCode()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeInt32Size(10, getCountryCode());
-      }
-      if (hasInternationalPrefix()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(11, getInternationalPrefix());
-      }
-      if (hasNationalPrefix()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(12, getNationalPrefix());
-      }
-      if (hasPreferredExtnPrefix()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(13, getPreferredExtnPrefix());
-      }
-      if (hasNationalPrefixForParsing()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(15, getNationalPrefixForParsing());
-      }
-      if (hasNationalPrefixTransformRule()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(16, getNationalPrefixTransformRule());
-      }
-      if (hasPreferredInternationalPrefix()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(17, getPreferredInternationalPrefix());
-      }
-      if (hasSameMobileAndFixedLinePattern()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeBoolSize(18, getSameMobileAndFixedLinePattern());
-      }
-      for (com.google.i18n.phonenumbers.Phonemetadata.NumberFormat element : getNumberFormatList()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(19, element);
-      }
-      for (com.google.i18n.phonenumbers.Phonemetadata.NumberFormat element : getIntlNumberFormatList()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(20, element);
-      }
-      if (hasNationalPrefixFormattingRule()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeStringSize(21, getNationalPrefixFormattingRule());
-      }
-      memoizedSerializedSize = size;
-      return size;
-    }
-    
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata parseFrom(
-        com.google.protobuf.ByteString data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data).buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata parseFrom(
-        com.google.protobuf.ByteString data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data, extensionRegistry)
-               .buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata parseFrom(byte[] data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data).buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata parseFrom(
-        byte[] data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return newBuilder().mergeFrom(data, extensionRegistry)
-               .buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata parseFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input).buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata parseFrom(
-        java.io.InputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return newBuilder().mergeFrom(input, extensionRegistry)
-               .buildParsed();
-    }
-    public static com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata parseDelimitedFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      Builder builder = newBuilder();
-      if (builder.mergeDelimitedFrom(input)) {
-        return builder.buildParsed();
-      } else {
-        return null;