Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2020 Google LLC
*
* 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
*
* https://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.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/type/phone_number.proto
package org.apache.rocketmq.shaded.com.google.type;
/**
*
*
*
* An object representing a phone number, suitable as an API wire format.
* This representation:
* - should not be used for locale-specific formatting of a phone number, such
* as "+1 (650) 253-0000 ext. 123"
* - is not designed for efficient storage
* - may not be suitable for dialing - specialized libraries (see references)
* should be used to parse the number for that purpose
* To do something meaningful with this number, such as format it for various
* use-cases, convert it to an `i18n.phonenumbers.PhoneNumber` object first.
* For instance, in Java this would be:
* org.apache.rocketmq.shaded.com.google.type.PhoneNumber wireProto =
* org.apache.rocketmq.shaded.com.google.type.PhoneNumber.newBuilder().build();
* org.apache.rocketmq.shaded.com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber =
* PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ");
* if (!wireProto.getExtension().isEmpty()) {
* phoneNumber.setExtension(wireProto.getExtension());
* }
* Reference(s):
* - https://github.org.apache.rocketmq.shaded.com.google/libphonenumber
*
*
* Protobuf type {@code google.type.PhoneNumber}
*/
public final class PhoneNumber extends org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.type.PhoneNumber)
PhoneNumberOrBuilder {
private static final long serialVersionUID = 0L;
// Use PhoneNumber.newBuilder() to construct.
private PhoneNumber(org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private PhoneNumber() {
extension_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new PhoneNumber();
}
@java.lang.Override
public final org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private PhoneNumber(
org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet.Builder unknownFields =
org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
java.lang.String s = input.readStringRequireUtf8();
kindCase_ = 1;
kind_ = s;
break;
}
case 18:
{
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.Builder subBuilder = null;
if (kindCase_ == 2) {
subBuilder = ((org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode) kind_).toBuilder();
}
kind_ =
input.readMessage(
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode) kind_);
kind_ = subBuilder.buildPartial();
}
kindCase_ = 2;
break;
}
case 26:
{
java.lang.String s = input.readStringRequireUtf8();
extension_ = s;
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (org.apache.rocketmq.shaded.com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto.internal_static_google_type_PhoneNumber_descriptor;
}
@java.lang.Override
protected org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto
.internal_static_google_type_PhoneNumber_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.class, org.apache.rocketmq.shaded.com.google.type.PhoneNumber.Builder.class);
}
public interface ShortCodeOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.type.PhoneNumber.ShortCode)
org.apache.rocketmq.shaded.com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* Required. The BCP-47 region code of the location where calls to this
* short code can be made, such as "US" and "BB".
* Reference(s):
* - http://www.unicode.org/reports/tr35/#unicode_region_subtag
*
* Required. The BCP-47 region code of the location where calls to this
* short code can be made, such as "US" and "BB".
* Reference(s):
* - http://www.unicode.org/reports/tr35/#unicode_region_subtag
*
*
* string region_code = 1;
*
* @return The bytes for regionCode.
*/
org.apache.rocketmq.shaded.com.google.protobuf.ByteString getRegionCodeBytes();
/**
*
*
*
* Required. The short code digits, without a leading plus ('+') or country
* calling code, e.g. "611".
*
*
* string number = 2;
*
* @return The number.
*/
java.lang.String getNumber();
/**
*
*
*
* Required. The short code digits, without a leading plus ('+') or country
* calling code, e.g. "611".
*
*
* string number = 2;
*
* @return The bytes for number.
*/
org.apache.rocketmq.shaded.com.google.protobuf.ByteString getNumberBytes();
}
/**
*
*
*
* An object representing a short code, which is a phone number that is
* typically much shorter than regular phone numbers and can be used to
* address messages in MMS and SMS systems, as well as for abbreviated dialing
* (e.g. "Text 611 to see how many minutes you have remaining on your plan.").
* Short codes are restricted to a region and are not internationally
* dialable, which means the same short code can exist in different regions,
* with different usage and pricing, even if those regions share the same
* country calling code (e.g. US and CA).
*
*
* Protobuf type {@code google.type.PhoneNumber.ShortCode}
*/
public static final class ShortCode extends org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.type.PhoneNumber.ShortCode)
ShortCodeOrBuilder {
private static final long serialVersionUID = 0L;
// Use ShortCode.newBuilder() to construct.
private ShortCode(org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private ShortCode() {
regionCode_ = "";
number_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new ShortCode();
}
@java.lang.Override
public final org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private ShortCode(
org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet.Builder unknownFields =
org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
java.lang.String s = input.readStringRequireUtf8();
regionCode_ = s;
break;
}
case 18:
{
java.lang.String s = input.readStringRequireUtf8();
number_ = s;
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (org.apache.rocketmq.shaded.com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto
.internal_static_google_type_PhoneNumber_ShortCode_descriptor;
}
@java.lang.Override
protected org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto
.internal_static_google_type_PhoneNumber_ShortCode_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.class,
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.Builder.class);
}
public static final int REGION_CODE_FIELD_NUMBER = 1;
private volatile java.lang.Object regionCode_;
/**
*
*
*
* Required. The BCP-47 region code of the location where calls to this
* short code can be made, such as "US" and "BB".
* Reference(s):
* - http://www.unicode.org/reports/tr35/#unicode_region_subtag
*
* Required. The BCP-47 region code of the location where calls to this
* short code can be made, such as "US" and "BB".
* Reference(s):
* - http://www.unicode.org/reports/tr35/#unicode_region_subtag
*
*
* string region_code = 1;
*
* @return The bytes for regionCode.
*/
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.protobuf.ByteString getRegionCodeBytes() {
java.lang.Object ref = regionCode_;
if (ref instanceof java.lang.String) {
org.apache.rocketmq.shaded.com.google.protobuf.ByteString b =
org.apache.rocketmq.shaded.com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
regionCode_ = b;
return b;
} else {
return (org.apache.rocketmq.shaded.com.google.protobuf.ByteString) ref;
}
}
public static final int NUMBER_FIELD_NUMBER = 2;
private volatile java.lang.Object number_;
/**
*
*
*
* Required. The short code digits, without a leading plus ('+') or country
* calling code, e.g. "611".
*
* Required. The short code digits, without a leading plus ('+') or country
* calling code, e.g. "611".
*
*
* string number = 2;
*
* @return The bytes for number.
*/
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.protobuf.ByteString getNumberBytes() {
java.lang.Object ref = number_;
if (ref instanceof java.lang.String) {
org.apache.rocketmq.shaded.com.google.protobuf.ByteString b =
org.apache.rocketmq.shaded.com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
number_ = b;
return b;
} else {
return (org.apache.rocketmq.shaded.com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(org.apache.rocketmq.shaded.com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) {
org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.writeString(output, 1, regionCode_);
}
if (!org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.isStringEmpty(number_)) {
org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.writeString(output, 2, number_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) {
size += org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.computeStringSize(1, regionCode_);
}
if (!org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.isStringEmpty(number_)) {
size += org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.computeStringSize(2, number_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode)) {
return super.equals(obj);
}
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode other = (org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode) obj;
if (!getRegionCode().equals(other.getRegionCode())) return false;
if (!getNumber().equals(other.getNumber())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + REGION_CODE_FIELD_NUMBER;
hash = (53 * hash) + getRegionCode().hashCode();
hash = (37 * hash) + NUMBER_FIELD_NUMBER;
hash = (53 * hash) + getNumber().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(java.nio.ByteBuffer data)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(
java.nio.ByteBuffer data, org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(
org.apache.rocketmq.shaded.com.google.protobuf.ByteString data)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(
org.apache.rocketmq.shaded.com.google.protobuf.ByteString data,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(byte[] data)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(
byte[] data, org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(java.io.InputStream input)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(
java.io.InputStream input, org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseDelimitedFrom(
java.io.InputStream input, org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(
org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parseFrom(
org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* An object representing a short code, which is a phone number that is
* typically much shorter than regular phone numbers and can be used to
* address messages in MMS and SMS systems, as well as for abbreviated dialing
* (e.g. "Text 611 to see how many minutes you have remaining on your plan.").
* Short codes are restricted to a region and are not internationally
* dialable, which means the same short code can exist in different regions,
* with different usage and pricing, even if those regions share the same
* country calling code (e.g. US and CA).
*
*
* Protobuf type {@code google.type.PhoneNumber.ShortCode}
*/
public static final class Builder
extends org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.type.PhoneNumber.ShortCode)
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCodeOrBuilder {
public static final org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto
.internal_static_google_type_PhoneNumber_ShortCode_descriptor;
}
@java.lang.Override
protected org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto
.internal_static_google_type_PhoneNumber_ShortCode_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.class,
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.Builder.class);
}
// Construct using org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
regionCode_ = "";
number_ = "";
return this;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto
.internal_static_google_type_PhoneNumber_ShortCode_descriptor;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode getDefaultInstanceForType() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.getDefaultInstance();
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode build() {
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode buildPartial() {
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode result =
new org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode(this);
result.regionCode_ = regionCode_;
result.number_ = number_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(org.apache.rocketmq.shaded.com.google.protobuf.Message other) {
if (other instanceof org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode) {
return mergeFrom((org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode other) {
if (other == org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.getDefaultInstance()) return this;
if (!other.getRegionCode().isEmpty()) {
regionCode_ = other.regionCode_;
onChanged();
}
if (!other.getNumber().isEmpty()) {
number_ = other.number_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object regionCode_ = "";
/**
*
*
*
* Required. The BCP-47 region code of the location where calls to this
* short code can be made, such as "US" and "BB".
* Reference(s):
* - http://www.unicode.org/reports/tr35/#unicode_region_subtag
*
* Required. The BCP-47 region code of the location where calls to this
* short code can be made, such as "US" and "BB".
* Reference(s):
* - http://www.unicode.org/reports/tr35/#unicode_region_subtag
*
*
* string region_code = 1;
*
* @return The bytes for regionCode.
*/
public org.apache.rocketmq.shaded.com.google.protobuf.ByteString getRegionCodeBytes() {
java.lang.Object ref = regionCode_;
if (ref instanceof String) {
org.apache.rocketmq.shaded.com.google.protobuf.ByteString b =
org.apache.rocketmq.shaded.com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
regionCode_ = b;
return b;
} else {
return (org.apache.rocketmq.shaded.com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The BCP-47 region code of the location where calls to this
* short code can be made, such as "US" and "BB".
* Reference(s):
* - http://www.unicode.org/reports/tr35/#unicode_region_subtag
*
*
* string region_code = 1;
*
* @param value The regionCode to set.
* @return This builder for chaining.
*/
public Builder setRegionCode(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
regionCode_ = value;
onChanged();
return this;
}
/**
*
*
*
* Required. The BCP-47 region code of the location where calls to this
* short code can be made, such as "US" and "BB".
* Reference(s):
* - http://www.unicode.org/reports/tr35/#unicode_region_subtag
*
*
* string region_code = 1;
*
* @return This builder for chaining.
*/
public Builder clearRegionCode() {
regionCode_ = getDefaultInstance().getRegionCode();
onChanged();
return this;
}
/**
*
*
*
* Required. The BCP-47 region code of the location where calls to this
* short code can be made, such as "US" and "BB".
* Reference(s):
* - http://www.unicode.org/reports/tr35/#unicode_region_subtag
*
*
* string region_code = 1;
*
* @param value The bytes for regionCode to set.
* @return This builder for chaining.
*/
public Builder setRegionCodeBytes(org.apache.rocketmq.shaded.com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
regionCode_ = value;
onChanged();
return this;
}
private java.lang.Object number_ = "";
/**
*
*
*
* Required. The short code digits, without a leading plus ('+') or country
* calling code, e.g. "611".
*
* Required. The short code digits, without a leading plus ('+') or country
* calling code, e.g. "611".
*
*
* string number = 2;
*
* @return The bytes for number.
*/
public org.apache.rocketmq.shaded.com.google.protobuf.ByteString getNumberBytes() {
java.lang.Object ref = number_;
if (ref instanceof String) {
org.apache.rocketmq.shaded.com.google.protobuf.ByteString b =
org.apache.rocketmq.shaded.com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
number_ = b;
return b;
} else {
return (org.apache.rocketmq.shaded.com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The short code digits, without a leading plus ('+') or country
* calling code, e.g. "611".
*
*
* string number = 2;
*
* @param value The number to set.
* @return This builder for chaining.
*/
public Builder setNumber(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
number_ = value;
onChanged();
return this;
}
/**
*
*
*
* Required. The short code digits, without a leading plus ('+') or country
* calling code, e.g. "611".
*
*
* string number = 2;
*
* @return This builder for chaining.
*/
public Builder clearNumber() {
number_ = getDefaultInstance().getNumber();
onChanged();
return this;
}
/**
*
*
*
* Required. The short code digits, without a leading plus ('+') or country
* calling code, e.g. "611".
*
*
* string number = 2;
*
* @param value The bytes for number to set.
* @return This builder for chaining.
*/
public Builder setNumberBytes(org.apache.rocketmq.shaded.com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
number_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.type.PhoneNumber.ShortCode)
}
// @@protoc_insertion_point(class_scope:google.type.PhoneNumber.ShortCode)
private static final org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode();
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final org.apache.rocketmq.shaded.com.google.protobuf.Parser PARSER =
new org.apache.rocketmq.shaded.com.google.protobuf.AbstractParser() {
@java.lang.Override
public ShortCode parsePartialFrom(
org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return new ShortCode(input, extensionRegistry);
}
};
public static org.apache.rocketmq.shaded.com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int kindCase_ = 0;
private java.lang.Object kind_;
public enum KindCase
implements
org.apache.rocketmq.shaded.com.google.protobuf.Internal.EnumLite,
org.apache.rocketmq.shaded.com.google.protobuf.AbstractMessage.InternalOneOfEnum {
E164_NUMBER(1),
SHORT_CODE(2),
KIND_NOT_SET(0);
private final int value;
private KindCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static KindCase valueOf(int value) {
return forNumber(value);
}
public static KindCase forNumber(int value) {
switch (value) {
case 1:
return E164_NUMBER;
case 2:
return SHORT_CODE;
case 0:
return KIND_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public KindCase getKindCase() {
return KindCase.forNumber(kindCase_);
}
public static final int E164_NUMBER_FIELD_NUMBER = 1;
/**
*
*
*
* The phone number, represented as a leading plus sign ('+'), followed by a
* phone number that uses a relaxed ITU E.164 format consisting of the
* country calling code (1 to 3 digits) and the subscriber number, with no
* additional spaces or formatting, e.g.:
* - correct: "+15552220123"
* - incorrect: "+1 (555) 222-01234 x123".
* The ITU E.164 format limits the latter to 12 digits, but in practice not
* all countries respect that, so we relax that restriction here.
* National-only numbers are not allowed.
* References:
* - https://www.itu.int/rec/T-REC-E.164-201011-I
* - https://en.wikipedia.org/wiki/E.164.
* - https://en.wikipedia.org/wiki/List_of_country_calling_codes
*
*
* string e164_number = 1;
*
* @return Whether the e164Number field is set.
*/
public boolean hasE164Number() {
return kindCase_ == 1;
}
/**
*
*
*
* The phone number, represented as a leading plus sign ('+'), followed by a
* phone number that uses a relaxed ITU E.164 format consisting of the
* country calling code (1 to 3 digits) and the subscriber number, with no
* additional spaces or formatting, e.g.:
* - correct: "+15552220123"
* - incorrect: "+1 (555) 222-01234 x123".
* The ITU E.164 format limits the latter to 12 digits, but in practice not
* all countries respect that, so we relax that restriction here.
* National-only numbers are not allowed.
* References:
* - https://www.itu.int/rec/T-REC-E.164-201011-I
* - https://en.wikipedia.org/wiki/E.164.
* - https://en.wikipedia.org/wiki/List_of_country_calling_codes
*
* The phone number, represented as a leading plus sign ('+'), followed by a
* phone number that uses a relaxed ITU E.164 format consisting of the
* country calling code (1 to 3 digits) and the subscriber number, with no
* additional spaces or formatting, e.g.:
* - correct: "+15552220123"
* - incorrect: "+1 (555) 222-01234 x123".
* The ITU E.164 format limits the latter to 12 digits, but in practice not
* all countries respect that, so we relax that restriction here.
* National-only numbers are not allowed.
* References:
* - https://www.itu.int/rec/T-REC-E.164-201011-I
* - https://en.wikipedia.org/wiki/E.164.
* - https://en.wikipedia.org/wiki/List_of_country_calling_codes
*
*
* string e164_number = 1;
*
* @return The bytes for e164Number.
*/
public org.apache.rocketmq.shaded.com.google.protobuf.ByteString getE164NumberBytes() {
java.lang.Object ref = "";
if (kindCase_ == 1) {
ref = kind_;
}
if (ref instanceof java.lang.String) {
org.apache.rocketmq.shaded.com.google.protobuf.ByteString b =
org.apache.rocketmq.shaded.com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (kindCase_ == 1) {
kind_ = b;
}
return b;
} else {
return (org.apache.rocketmq.shaded.com.google.protobuf.ByteString) ref;
}
}
public static final int SHORT_CODE_FIELD_NUMBER = 2;
/**
*
*
*
* A short code.
* Reference(s):
* - https://en.wikipedia.org/wiki/Short_code
*
*
* .google.type.PhoneNumber.ShortCode short_code = 2;
*
* @return Whether the shortCode field is set.
*/
@java.lang.Override
public boolean hasShortCode() {
return kindCase_ == 2;
}
/**
*
*
*
* A short code.
* Reference(s):
* - https://en.wikipedia.org/wiki/Short_code
*
* A short code.
* Reference(s):
* - https://en.wikipedia.org/wiki/Short_code
*
*
* .google.type.PhoneNumber.ShortCode short_code = 2;
*/
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCodeOrBuilder getShortCodeOrBuilder() {
if (kindCase_ == 2) {
return (org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode) kind_;
}
return org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.getDefaultInstance();
}
public static final int EXTENSION_FIELD_NUMBER = 3;
private volatile java.lang.Object extension_;
/**
*
*
*
* The phone number's extension. The extension is not standardized in ITU
* recommendations, except for being defined as a series of numbers with a
* maximum length of 40 digits. Other than digits, some other dialing
* characters such as ',' (indicating a wait) or '#' may be stored here.
* Note that no regions currently use extensions with short codes, so this
* field is normally only set in conjunction with an E.164 number. It is held
* separately from the E.164 number to allow for short code extensions in the
* future.
*
* The phone number's extension. The extension is not standardized in ITU
* recommendations, except for being defined as a series of numbers with a
* maximum length of 40 digits. Other than digits, some other dialing
* characters such as ',' (indicating a wait) or '#' may be stored here.
* Note that no regions currently use extensions with short codes, so this
* field is normally only set in conjunction with an E.164 number. It is held
* separately from the E.164 number to allow for short code extensions in the
* future.
*
*
* string extension = 3;
*
* @return The bytes for extension.
*/
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.protobuf.ByteString getExtensionBytes() {
java.lang.Object ref = extension_;
if (ref instanceof java.lang.String) {
org.apache.rocketmq.shaded.com.google.protobuf.ByteString b =
org.apache.rocketmq.shaded.com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
extension_ = b;
return b;
} else {
return (org.apache.rocketmq.shaded.com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(org.apache.rocketmq.shaded.com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (kindCase_ == 1) {
org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kind_);
}
if (kindCase_ == 2) {
output.writeMessage(2, (org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode) kind_);
}
if (!org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.isStringEmpty(extension_)) {
org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.writeString(output, 3, extension_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (kindCase_ == 1) {
size += org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kind_);
}
if (kindCase_ == 2) {
size +=
org.apache.rocketmq.shaded.com.google.protobuf.CodedOutputStream.computeMessageSize(
2, (org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode) kind_);
}
if (!org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.isStringEmpty(extension_)) {
size += org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.computeStringSize(3, extension_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.apache.rocketmq.shaded.com.google.type.PhoneNumber)) {
return super.equals(obj);
}
org.apache.rocketmq.shaded.com.google.type.PhoneNumber other = (org.apache.rocketmq.shaded.com.google.type.PhoneNumber) obj;
if (!getExtension().equals(other.getExtension())) return false;
if (!getKindCase().equals(other.getKindCase())) return false;
switch (kindCase_) {
case 1:
if (!getE164Number().equals(other.getE164Number())) return false;
break;
case 2:
if (!getShortCode().equals(other.getShortCode())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + EXTENSION_FIELD_NUMBER;
hash = (53 * hash) + getExtension().hashCode();
switch (kindCase_) {
case 1:
hash = (37 * hash) + E164_NUMBER_FIELD_NUMBER;
hash = (53 * hash) + getE164Number().hashCode();
break;
case 2:
hash = (37 * hash) + SHORT_CODE_FIELD_NUMBER;
hash = (53 * hash) + getShortCode().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(java.nio.ByteBuffer data)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(
java.nio.ByteBuffer data, org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(org.apache.rocketmq.shaded.com.google.protobuf.ByteString data)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(
org.apache.rocketmq.shaded.com.google.protobuf.ByteString data,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(byte[] data)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(
byte[] data, org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(java.io.InputStream input)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(
java.io.InputStream input, org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseDelimitedFrom(
java.io.InputStream input, org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber parseFrom(
org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(org.apache.rocketmq.shaded.com.google.type.PhoneNumber prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* An object representing a phone number, suitable as an API wire format.
* This representation:
* - should not be used for locale-specific formatting of a phone number, such
* as "+1 (650) 253-0000 ext. 123"
* - is not designed for efficient storage
* - may not be suitable for dialing - specialized libraries (see references)
* should be used to parse the number for that purpose
* To do something meaningful with this number, such as format it for various
* use-cases, convert it to an `i18n.phonenumbers.PhoneNumber` object first.
* For instance, in Java this would be:
* org.apache.rocketmq.shaded.com.google.type.PhoneNumber wireProto =
* org.apache.rocketmq.shaded.com.google.type.PhoneNumber.newBuilder().build();
* org.apache.rocketmq.shaded.com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber =
* PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ");
* if (!wireProto.getExtension().isEmpty()) {
* phoneNumber.setExtension(wireProto.getExtension());
* }
* Reference(s):
* - https://github.org.apache.rocketmq.shaded.com.google/libphonenumber
*
*
* Protobuf type {@code google.type.PhoneNumber}
*/
public static final class Builder extends org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.type.PhoneNumber)
org.apache.rocketmq.shaded.com.google.type.PhoneNumberOrBuilder {
public static final org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto.internal_static_google_type_PhoneNumber_descriptor;
}
@java.lang.Override
protected org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto
.internal_static_google_type_PhoneNumber_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.class, org.apache.rocketmq.shaded.com.google.type.PhoneNumber.Builder.class);
}
// Construct using org.apache.rocketmq.shaded.com.google.type.PhoneNumber.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (org.apache.rocketmq.shaded.com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
extension_ = "";
kindCase_ = 0;
kind_ = null;
return this;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumberProto.internal_static_google_type_PhoneNumber_descriptor;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.type.PhoneNumber getDefaultInstanceForType() {
return org.apache.rocketmq.shaded.com.google.type.PhoneNumber.getDefaultInstance();
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.type.PhoneNumber build() {
org.apache.rocketmq.shaded.com.google.type.PhoneNumber result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.type.PhoneNumber buildPartial() {
org.apache.rocketmq.shaded.com.google.type.PhoneNumber result = new org.apache.rocketmq.shaded.com.google.type.PhoneNumber(this);
if (kindCase_ == 1) {
result.kind_ = kind_;
}
if (kindCase_ == 2) {
if (shortCodeBuilder_ == null) {
result.kind_ = kind_;
} else {
result.kind_ = shortCodeBuilder_.build();
}
}
result.extension_ = extension_;
result.kindCase_ = kindCase_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
org.apache.rocketmq.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(org.apache.rocketmq.shaded.com.google.protobuf.Message other) {
if (other instanceof org.apache.rocketmq.shaded.com.google.type.PhoneNumber) {
return mergeFrom((org.apache.rocketmq.shaded.com.google.type.PhoneNumber) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.apache.rocketmq.shaded.com.google.type.PhoneNumber other) {
if (other == org.apache.rocketmq.shaded.com.google.type.PhoneNumber.getDefaultInstance()) return this;
if (!other.getExtension().isEmpty()) {
extension_ = other.extension_;
onChanged();
}
switch (other.getKindCase()) {
case E164_NUMBER:
{
kindCase_ = 1;
kind_ = other.kind_;
onChanged();
break;
}
case SHORT_CODE:
{
mergeShortCode(other.getShortCode());
break;
}
case KIND_NOT_SET:
{
break;
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.apache.rocketmq.shaded.com.google.type.PhoneNumber parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.apache.rocketmq.shaded.com.google.type.PhoneNumber) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int kindCase_ = 0;
private java.lang.Object kind_;
public KindCase getKindCase() {
return KindCase.forNumber(kindCase_);
}
public Builder clearKind() {
kindCase_ = 0;
kind_ = null;
onChanged();
return this;
}
/**
*
*
*
* The phone number, represented as a leading plus sign ('+'), followed by a
* phone number that uses a relaxed ITU E.164 format consisting of the
* country calling code (1 to 3 digits) and the subscriber number, with no
* additional spaces or formatting, e.g.:
* - correct: "+15552220123"
* - incorrect: "+1 (555) 222-01234 x123".
* The ITU E.164 format limits the latter to 12 digits, but in practice not
* all countries respect that, so we relax that restriction here.
* National-only numbers are not allowed.
* References:
* - https://www.itu.int/rec/T-REC-E.164-201011-I
* - https://en.wikipedia.org/wiki/E.164.
* - https://en.wikipedia.org/wiki/List_of_country_calling_codes
*
*
* string e164_number = 1;
*
* @return Whether the e164Number field is set.
*/
@java.lang.Override
public boolean hasE164Number() {
return kindCase_ == 1;
}
/**
*
*
*
* The phone number, represented as a leading plus sign ('+'), followed by a
* phone number that uses a relaxed ITU E.164 format consisting of the
* country calling code (1 to 3 digits) and the subscriber number, with no
* additional spaces or formatting, e.g.:
* - correct: "+15552220123"
* - incorrect: "+1 (555) 222-01234 x123".
* The ITU E.164 format limits the latter to 12 digits, but in practice not
* all countries respect that, so we relax that restriction here.
* National-only numbers are not allowed.
* References:
* - https://www.itu.int/rec/T-REC-E.164-201011-I
* - https://en.wikipedia.org/wiki/E.164.
* - https://en.wikipedia.org/wiki/List_of_country_calling_codes
*
* The phone number, represented as a leading plus sign ('+'), followed by a
* phone number that uses a relaxed ITU E.164 format consisting of the
* country calling code (1 to 3 digits) and the subscriber number, with no
* additional spaces or formatting, e.g.:
* - correct: "+15552220123"
* - incorrect: "+1 (555) 222-01234 x123".
* The ITU E.164 format limits the latter to 12 digits, but in practice not
* all countries respect that, so we relax that restriction here.
* National-only numbers are not allowed.
* References:
* - https://www.itu.int/rec/T-REC-E.164-201011-I
* - https://en.wikipedia.org/wiki/E.164.
* - https://en.wikipedia.org/wiki/List_of_country_calling_codes
*
*
* string e164_number = 1;
*
* @return The bytes for e164Number.
*/
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.protobuf.ByteString getE164NumberBytes() {
java.lang.Object ref = "";
if (kindCase_ == 1) {
ref = kind_;
}
if (ref instanceof String) {
org.apache.rocketmq.shaded.com.google.protobuf.ByteString b =
org.apache.rocketmq.shaded.com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (kindCase_ == 1) {
kind_ = b;
}
return b;
} else {
return (org.apache.rocketmq.shaded.com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The phone number, represented as a leading plus sign ('+'), followed by a
* phone number that uses a relaxed ITU E.164 format consisting of the
* country calling code (1 to 3 digits) and the subscriber number, with no
* additional spaces or formatting, e.g.:
* - correct: "+15552220123"
* - incorrect: "+1 (555) 222-01234 x123".
* The ITU E.164 format limits the latter to 12 digits, but in practice not
* all countries respect that, so we relax that restriction here.
* National-only numbers are not allowed.
* References:
* - https://www.itu.int/rec/T-REC-E.164-201011-I
* - https://en.wikipedia.org/wiki/E.164.
* - https://en.wikipedia.org/wiki/List_of_country_calling_codes
*
*
* string e164_number = 1;
*
* @param value The e164Number to set.
* @return This builder for chaining.
*/
public Builder setE164Number(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
kindCase_ = 1;
kind_ = value;
onChanged();
return this;
}
/**
*
*
*
* The phone number, represented as a leading plus sign ('+'), followed by a
* phone number that uses a relaxed ITU E.164 format consisting of the
* country calling code (1 to 3 digits) and the subscriber number, with no
* additional spaces or formatting, e.g.:
* - correct: "+15552220123"
* - incorrect: "+1 (555) 222-01234 x123".
* The ITU E.164 format limits the latter to 12 digits, but in practice not
* all countries respect that, so we relax that restriction here.
* National-only numbers are not allowed.
* References:
* - https://www.itu.int/rec/T-REC-E.164-201011-I
* - https://en.wikipedia.org/wiki/E.164.
* - https://en.wikipedia.org/wiki/List_of_country_calling_codes
*
*
* string e164_number = 1;
*
* @return This builder for chaining.
*/
public Builder clearE164Number() {
if (kindCase_ == 1) {
kindCase_ = 0;
kind_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* The phone number, represented as a leading plus sign ('+'), followed by a
* phone number that uses a relaxed ITU E.164 format consisting of the
* country calling code (1 to 3 digits) and the subscriber number, with no
* additional spaces or formatting, e.g.:
* - correct: "+15552220123"
* - incorrect: "+1 (555) 222-01234 x123".
* The ITU E.164 format limits the latter to 12 digits, but in practice not
* all countries respect that, so we relax that restriction here.
* National-only numbers are not allowed.
* References:
* - https://www.itu.int/rec/T-REC-E.164-201011-I
* - https://en.wikipedia.org/wiki/E.164.
* - https://en.wikipedia.org/wiki/List_of_country_calling_codes
*
*
* string e164_number = 1;
*
* @param value The bytes for e164Number to set.
* @return This builder for chaining.
*/
public Builder setE164NumberBytes(org.apache.rocketmq.shaded.com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
kindCase_ = 1;
kind_ = value;
onChanged();
return this;
}
private org.apache.rocketmq.shaded.com.google.protobuf.SingleFieldBuilderV3<
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode,
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCode.Builder,
org.apache.rocketmq.shaded.com.google.type.PhoneNumber.ShortCodeOrBuilder>
shortCodeBuilder_;
/**
*
*
*
* A short code.
* Reference(s):
* - https://en.wikipedia.org/wiki/Short_code
*
*
* .google.type.PhoneNumber.ShortCode short_code = 2;
*
* @return Whether the shortCode field is set.
*/
@java.lang.Override
public boolean hasShortCode() {
return kindCase_ == 2;
}
/**
*
*
*
* A short code.
* Reference(s):
* - https://en.wikipedia.org/wiki/Short_code
*
* The phone number's extension. The extension is not standardized in ITU
* recommendations, except for being defined as a series of numbers with a
* maximum length of 40 digits. Other than digits, some other dialing
* characters such as ',' (indicating a wait) or '#' may be stored here.
* Note that no regions currently use extensions with short codes, so this
* field is normally only set in conjunction with an E.164 number. It is held
* separately from the E.164 number to allow for short code extensions in the
* future.
*
* The phone number's extension. The extension is not standardized in ITU
* recommendations, except for being defined as a series of numbers with a
* maximum length of 40 digits. Other than digits, some other dialing
* characters such as ',' (indicating a wait) or '#' may be stored here.
* Note that no regions currently use extensions with short codes, so this
* field is normally only set in conjunction with an E.164 number. It is held
* separately from the E.164 number to allow for short code extensions in the
* future.
*
*
* string extension = 3;
*
* @return The bytes for extension.
*/
public org.apache.rocketmq.shaded.com.google.protobuf.ByteString getExtensionBytes() {
java.lang.Object ref = extension_;
if (ref instanceof String) {
org.apache.rocketmq.shaded.com.google.protobuf.ByteString b =
org.apache.rocketmq.shaded.com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
extension_ = b;
return b;
} else {
return (org.apache.rocketmq.shaded.com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The phone number's extension. The extension is not standardized in ITU
* recommendations, except for being defined as a series of numbers with a
* maximum length of 40 digits. Other than digits, some other dialing
* characters such as ',' (indicating a wait) or '#' may be stored here.
* Note that no regions currently use extensions with short codes, so this
* field is normally only set in conjunction with an E.164 number. It is held
* separately from the E.164 number to allow for short code extensions in the
* future.
*
*
* string extension = 3;
*
* @param value The extension to set.
* @return This builder for chaining.
*/
public Builder setExtension(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
extension_ = value;
onChanged();
return this;
}
/**
*
*
*
* The phone number's extension. The extension is not standardized in ITU
* recommendations, except for being defined as a series of numbers with a
* maximum length of 40 digits. Other than digits, some other dialing
* characters such as ',' (indicating a wait) or '#' may be stored here.
* Note that no regions currently use extensions with short codes, so this
* field is normally only set in conjunction with an E.164 number. It is held
* separately from the E.164 number to allow for short code extensions in the
* future.
*
*
* string extension = 3;
*
* @return This builder for chaining.
*/
public Builder clearExtension() {
extension_ = getDefaultInstance().getExtension();
onChanged();
return this;
}
/**
*
*
*
* The phone number's extension. The extension is not standardized in ITU
* recommendations, except for being defined as a series of numbers with a
* maximum length of 40 digits. Other than digits, some other dialing
* characters such as ',' (indicating a wait) or '#' may be stored here.
* Note that no regions currently use extensions with short codes, so this
* field is normally only set in conjunction with an E.164 number. It is held
* separately from the E.164 number to allow for short code extensions in the
* future.
*
*
* string extension = 3;
*
* @param value The bytes for extension to set.
* @return This builder for chaining.
*/
public Builder setExtensionBytes(org.apache.rocketmq.shaded.com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
extension_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final org.apache.rocketmq.shaded.com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.type.PhoneNumber)
}
// @@protoc_insertion_point(class_scope:google.type.PhoneNumber)
private static final org.apache.rocketmq.shaded.com.google.type.PhoneNumber DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.apache.rocketmq.shaded.com.google.type.PhoneNumber();
}
public static org.apache.rocketmq.shaded.com.google.type.PhoneNumber getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final org.apache.rocketmq.shaded.com.google.protobuf.Parser PARSER =
new org.apache.rocketmq.shaded.com.google.protobuf.AbstractParser() {
@java.lang.Override
public PhoneNumber parsePartialFrom(
org.apache.rocketmq.shaded.com.google.protobuf.CodedInputStream input,
org.apache.rocketmq.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws org.apache.rocketmq.shaded.com.google.protobuf.InvalidProtocolBufferException {
return new PhoneNumber(input, extensionRegistry);
}
};
public static org.apache.rocketmq.shaded.com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.apache.rocketmq.shaded.com.google.type.PhoneNumber getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}