Class PhoneNumber.ShortCode (2.12.0)

public static final class PhoneNumber.ShortCode extends GeneratedMessageV3 implements PhoneNumber.ShortCodeOrBuilder

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 google.type.PhoneNumber.ShortCode

Static Fields

NUMBER_FIELD_NUMBER

public static final int NUMBER_FIELD_NUMBER
Field Value
TypeDescription
int

REGION_CODE_FIELD_NUMBER

public static final int REGION_CODE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static PhoneNumber.ShortCode getDefaultInstance()
Returns
TypeDescription
PhoneNumber.ShortCode

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static PhoneNumber.ShortCode.Builder newBuilder()
Returns
TypeDescription
PhoneNumber.ShortCode.Builder

newBuilder(PhoneNumber.ShortCode prototype)

public static PhoneNumber.ShortCode.Builder newBuilder(PhoneNumber.ShortCode prototype)
Parameter
NameDescription
prototypePhoneNumber.ShortCode
Returns
TypeDescription
PhoneNumber.ShortCode.Builder

parseDelimitedFrom(InputStream input)

public static PhoneNumber.ShortCode parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static PhoneNumber.ShortCode parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static PhoneNumber.ShortCode parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static PhoneNumber.ShortCode parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static PhoneNumber.ShortCode parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static PhoneNumber.ShortCode parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PhoneNumber.ShortCode
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<PhoneNumber.ShortCode> parser()
Returns
TypeDescription
Parser<ShortCode>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public PhoneNumber.ShortCode getDefaultInstanceForType()
Returns
TypeDescription
PhoneNumber.ShortCode

getNumber()

public String getNumber()

Required. The short code digits, without a leading plus ('+') or country calling code, e.g. "611".

string number = 2;

Returns
TypeDescription
String

The number.

getNumberBytes()

public ByteString getNumberBytes()

Required. The short code digits, without a leading plus ('+') or country calling code, e.g. "611".

string number = 2;

Returns
TypeDescription
ByteString

The bytes for number.

getParserForType()

public Parser<PhoneNumber.ShortCode> getParserForType()
Returns
TypeDescription
Parser<ShortCode>
Overrides

getRegionCode()

public String getRegionCode()

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):

string region_code = 1;

Returns
TypeDescription
String

The regionCode.

getRegionCodeBytes()

public ByteString getRegionCodeBytes()

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):

string region_code = 1;

Returns
TypeDescription
ByteString

The bytes for regionCode.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public PhoneNumber.ShortCode.Builder newBuilderForType()
Returns
TypeDescription
PhoneNumber.ShortCode.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected PhoneNumber.ShortCode.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
PhoneNumber.ShortCode.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public PhoneNumber.ShortCode.Builder toBuilder()
Returns
TypeDescription
PhoneNumber.ShortCode.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException