diff options
Diffstat (limited to 'libphonenumber/src/com/google/i18n/phonenumbers/Phonemetadata.java')
-rw-r--r-- | libphonenumber/src/com/google/i18n/phonenumbers/Phonemetadata.java | 61 |
1 files changed, 28 insertions, 33 deletions
diff --git a/libphonenumber/src/com/google/i18n/phonenumbers/Phonemetadata.java b/libphonenumber/src/com/google/i18n/phonenumbers/Phonemetadata.java index ca5885cd..e2ef1227 100644 --- a/libphonenumber/src/com/google/i18n/phonenumbers/Phonemetadata.java +++ b/libphonenumber/src/com/google/i18n/phonenumbers/Phonemetadata.java @@ -65,7 +65,7 @@ public final class Phonemetadata { setDomesticCarrierCodeFormattingRule(other.getDomesticCarrierCodeFormattingRule()); } if (other.hasNationalPrefixOptionalWhenFormatting()) { - setNationalPrefixOptionalWhenFormatting(other.isNationalPrefixOptionalWhenFormatting()); + setNationalPrefixOptionalWhenFormatting(other.getNationalPrefixOptionalWhenFormatting()); } return this; } @@ -130,12 +130,12 @@ public final class Phonemetadata { return this; } - // optional bool national_prefix_optional_when_formatting = 6; + // optional bool national_prefix_optional_when_formatting = 6 [default = false]; private boolean hasNationalPrefixOptionalWhenFormatting; private boolean nationalPrefixOptionalWhenFormatting_ = false; public boolean hasNationalPrefixOptionalWhenFormatting() { return hasNationalPrefixOptionalWhenFormatting; } - public boolean isNationalPrefixOptionalWhenFormatting() { + public boolean getNationalPrefixOptionalWhenFormatting() { return nationalPrefixOptionalWhenFormatting_; } public NumberFormat setNationalPrefixOptionalWhenFormatting(boolean value) { hasNationalPrefixOptionalWhenFormatting = true; @@ -211,9 +211,6 @@ public final class Phonemetadata { if (other.hasNationalNumberPattern()) { setNationalNumberPattern(other.getNationalNumberPattern()); } - if (other.hasPossibleNumberPattern()) { - setPossibleNumberPattern(other.getPossibleNumberPattern()); - } for (int i = 0; i < other.getPossibleLengthCount(); i++) { addPossibleLength(other.getPossibleLength(i)); } @@ -247,22 +244,6 @@ public final class Phonemetadata { 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; - } - // repeated int32 possible_length = 9; private java.util.List<Integer> possibleLength_ = new java.util.ArrayList<Integer>(); public java.util.List<Integer> getPossibleLengthList() { @@ -317,7 +298,6 @@ public final class Phonemetadata { public boolean exactlySameAs(PhoneNumberDesc other) { return nationalNumberPattern_.equals(other.nationalNumberPattern_) && - possibleNumberPattern_.equals(other.possibleNumberPattern_) && possibleLength_.equals(other.possibleLength_) && possibleLengthLocalOnly_.equals(other.possibleLengthLocalOnly_) && exampleNumber_.equals(other.exampleNumber_); @@ -329,11 +309,6 @@ public final class Phonemetadata { objectOutput.writeUTF(nationalNumberPattern_); } - objectOutput.writeBoolean(hasPossibleNumberPattern); - if (hasPossibleNumberPattern) { - objectOutput.writeUTF(possibleNumberPattern_); - } - int possibleLengthSize = getPossibleLengthCount(); objectOutput.writeInt(possibleLengthSize); for (int i = 0; i < possibleLengthSize; i++) { @@ -357,10 +332,6 @@ public final class Phonemetadata { setNationalNumberPattern(objectInput.readUTF()); } - if (objectInput.readBoolean()) { - setPossibleNumberPattern(objectInput.readUTF()); - } - int possibleLengthSize = objectInput.readInt(); for (int i = 0; i < possibleLengthSize; i++) { possibleLength_.add(objectInput.readInt()); @@ -605,6 +576,20 @@ public final class Phonemetadata { return this; } + // optional PhoneNumberDesc sms_services = 33; + private boolean hasSmsServices; + private PhoneNumberDesc smsServices_ = null; + public boolean hasSmsServices() { return hasSmsServices; } + public PhoneNumberDesc getSmsServices() { return smsServices_; } + public PhoneMetadata setSmsServices(PhoneNumberDesc value) { + if (value == null) { + throw new NullPointerException(); + } + hasSmsServices = true; + smsServices_ = value; + return this; + } + // optional PhoneNumberDesc noInternationalDialling = 24; private boolean hasNoInternationalDialling; private PhoneNumberDesc noInternationalDialling_ = null; @@ -731,7 +716,7 @@ public final class Phonemetadata { private boolean hasSameMobileAndFixedLinePattern; private boolean sameMobileAndFixedLinePattern_ = false; public boolean hasSameMobileAndFixedLinePattern() { return hasSameMobileAndFixedLinePattern; } - public boolean isSameMobileAndFixedLinePattern() { return sameMobileAndFixedLinePattern_; } + public boolean getSameMobileAndFixedLinePattern() { return sameMobileAndFixedLinePattern_; } public PhoneMetadata setSameMobileAndFixedLinePattern(boolean value) { hasSameMobileAndFixedLinePattern = true; sameMobileAndFixedLinePattern_ = value; @@ -906,6 +891,10 @@ public final class Phonemetadata { if (hasCarrierSpecific) { carrierSpecific_.writeExternal(objectOutput); } + objectOutput.writeBoolean(hasSmsServices); + if (hasSmsServices) { + smsServices_.writeExternal(objectOutput); + } objectOutput.writeBoolean(hasNoInternationalDialling); if (hasNoInternationalDialling) { noInternationalDialling_.writeExternal(objectOutput); @@ -1061,6 +1050,12 @@ public final class Phonemetadata { if (hasDesc) { PhoneNumberDesc desc = new PhoneNumberDesc(); desc.readExternal(objectInput); + setSmsServices(desc); + } + hasDesc = objectInput.readBoolean(); + if (hasDesc) { + PhoneNumberDesc desc = new PhoneNumberDesc(); + desc.readExternal(objectInput); setNoInternationalDialling(desc); } |