Class TruncatableString.Builder (2.8.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public TruncatableString.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TruncatableString.Builder
Overrides

build()

public TruncatableString build()
Returns
TypeDescription
TruncatableString

buildPartial()

public TruncatableString buildPartial()
Returns
TypeDescription
TruncatableString

clear()

public TruncatableString.Builder clear()
Returns
TypeDescription
TruncatableString.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public TruncatableString.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
TruncatableString.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public TruncatableString.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
TruncatableString.Builder

This builder for chaining.

clone()

public TruncatableString.Builder clone()
Returns
TypeDescription
TruncatableString.Builder
Overrides

getDefaultInstanceForType()

public TruncatableString getDefaultInstanceForType()
Returns
TypeDescription
TruncatableString

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for value.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(TruncatableString other)

public TruncatableString.Builder mergeFrom(TruncatableString other)
Parameter
NameDescription
otherTruncatableString
Returns
TypeDescription
TruncatableString.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TruncatableString.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TruncatableString.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public TruncatableString.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
TruncatableString.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final TruncatableString.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
TruncatableString.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public TruncatableString.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TruncatableString.Builder
Overrides

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

public TruncatableString.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueint

The truncatedByteCount to set.

Returns
TypeDescription
TruncatableString.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final TruncatableString.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueString

The value to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for value to set.

Returns
TypeDescription
TruncatableString.Builder

This builder for chaining.