Class TruncatableString.Builder (2.42.0)

public static final class TruncatableString.Builder extends GeneratedMessageV3.Builder<TruncatableString.Builder> implements TruncatableStringOrBuilder

Represents a string that might be shortened to a specified length.

Protobuf type google.devtools.cloudtrace.v2.TruncatableString

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public TruncatableString.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TruncatableString.Builder
Overrides

build()

public TruncatableString build()
Returns
Type Description
TruncatableString

buildPartial()

public TruncatableString buildPartial()
Returns
Type Description
TruncatableString

clear()

public TruncatableString.Builder clear()
Returns
Type Description
TruncatableString.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public TruncatableString.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
TruncatableString.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public TruncatableString.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
TruncatableString.Builder
Overrides

clearTruncatedByteCount()

public TruncatableString.Builder clearTruncatedByteCount()

The number of bytes removed from the original string. If this value is 0, then the string was not shortened.

int32 truncated_byte_count = 2;

Returns
Type Description
TruncatableString.Builder

This builder for chaining.

clearValue()

public TruncatableString.Builder clearValue()

The shortened string. For example, if the original string is 500 bytes long and the limit of the string is 128 bytes, then value contains the first 128 bytes of the 500-byte string.

Truncation always happens on a UTF8 character boundary. If there are multi-byte characters in the string, then the length of the shortened string might be less than the size limit.

string value = 1;

Returns
Type Description
TruncatableString.Builder

This builder for chaining.

clone()

public TruncatableString.Builder clone()
Returns
Type Description
TruncatableString.Builder
Overrides

getDefaultInstanceForType()

public TruncatableString getDefaultInstanceForType()
Returns
Type Description
TruncatableString

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getTruncatedByteCount()

public int getTruncatedByteCount()

The number of bytes removed from the original string. If this value is 0, then the string was not shortened.

int32 truncated_byte_count = 2;

Returns
Type Description
int

The truncatedByteCount.

getValue()

public String getValue()

The shortened string. For example, if the original string is 500 bytes long and the limit of the string is 128 bytes, then value contains the first 128 bytes of the 500-byte string.

Truncation always happens on a UTF8 character boundary. If there are multi-byte characters in the string, then the length of the shortened string might be less than the size limit.

string value = 1;

Returns
Type Description
String

The value.

getValueBytes()

public ByteString getValueBytes()

The shortened string. For example, if the original string is 500 bytes long and the limit of the string is 128 bytes, then value contains the first 128 bytes of the 500-byte string.

Truncation always happens on a UTF8 character boundary. If there are multi-byte characters in the string, then the length of the shortened string might be less than the size limit.

string value = 1;

Returns
Type Description
ByteString

The bytes for value.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(TruncatableString other)

public TruncatableString.Builder mergeFrom(TruncatableString other)
Parameter
Name Description
other TruncatableString
Returns
Type Description
TruncatableString.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TruncatableString.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
TruncatableString.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public TruncatableString.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
TruncatableString.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final TruncatableString.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TruncatableString.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public TruncatableString.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TruncatableString.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public TruncatableString.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
TruncatableString.Builder
Overrides

setTruncatedByteCount(int value)

public TruncatableString.Builder setTruncatedByteCount(int value)

The number of bytes removed from the original string. If this value is 0, then the string was not shortened.

int32 truncated_byte_count = 2;

Parameter
Name Description
value int

The truncatedByteCount to set.

Returns
Type Description
TruncatableString.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final TruncatableString.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TruncatableString.Builder
Overrides

setValue(String value)

public TruncatableString.Builder setValue(String value)

The shortened string. For example, if the original string is 500 bytes long and the limit of the string is 128 bytes, then value contains the first 128 bytes of the 500-byte string.

Truncation always happens on a UTF8 character boundary. If there are multi-byte characters in the string, then the length of the shortened string might be less than the size limit.

string value = 1;

Parameter
Name Description
value String

The value to set.

Returns
Type Description
TruncatableString.Builder

This builder for chaining.

setValueBytes(ByteString value)

public TruncatableString.Builder setValueBytes(ByteString value)

The shortened string. For example, if the original string is 500 bytes long and the limit of the string is 128 bytes, then value contains the first 128 bytes of the 500-byte string.

Truncation always happens on a UTF8 character boundary. If there are multi-byte characters in the string, then the length of the shortened string might be less than the size limit.

string value = 1;

Parameter
Name Description
value ByteString

The bytes for value to set.

Returns
Type Description
TruncatableString.Builder

This builder for chaining.