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
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
public TruncatableString.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
public TruncatableString build()
Returns
public TruncatableString buildPartial()
Returns
public TruncatableString.Builder clear()
Returns
Overrides
public TruncatableString.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
public TruncatableString.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
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
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
public TruncatableString.Builder clone()
Returns
Overrides
public TruncatableString getDefaultInstanceForType()
Returns
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
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.
|
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.
|
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
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
public final boolean isInitialized()
Returns
Overrides
public TruncatableString.Builder mergeFrom(TruncatableString other)
Parameter
Returns
public TruncatableString.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
public TruncatableString.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
public final TruncatableString.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
public TruncatableString.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
public TruncatableString.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
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
public final TruncatableString.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
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
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