Class PhoneNumber.ShortCode (2.49.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
Type Description
int

REGION_CODE_FIELD_NUMBER

public static final int REGION_CODE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static PhoneNumber.ShortCode getDefaultInstance()
Returns
Type Description
PhoneNumber.ShortCode

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static PhoneNumber.ShortCode.Builder newBuilder()
Returns
Type Description
PhoneNumber.ShortCode.Builder

newBuilder(PhoneNumber.ShortCode prototype)

public static PhoneNumber.ShortCode.Builder newBuilder(PhoneNumber.ShortCode prototype)
Parameter
Name Description
prototype PhoneNumber.ShortCode
Returns
Type Description
PhoneNumber.ShortCode.Builder

parseDelimitedFrom(InputStream input)

public static PhoneNumber.ShortCode parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static PhoneNumber.ShortCode parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static PhoneNumber.ShortCode parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static PhoneNumber.ShortCode parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static PhoneNumber.ShortCode parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static PhoneNumber.ShortCode parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static PhoneNumber.ShortCode parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PhoneNumber.ShortCode
Exceptions
Type Description
InvalidProtocolBufferException

parser()

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

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public PhoneNumber.ShortCode getDefaultInstanceForType()
Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for number.

getParserForType()

public Parser<PhoneNumber.ShortCode> getParserForType()
Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for regionCode.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public PhoneNumber.ShortCode.Builder newBuilderForType()
Returns
Type Description
PhoneNumber.ShortCode.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected PhoneNumber.ShortCode.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
PhoneNumber.ShortCode.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public PhoneNumber.ShortCode.Builder toBuilder()
Returns
Type Description
PhoneNumber.ShortCode.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException