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.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
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()
Methods
public TruncatableString.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
public TruncatableString build()
public TruncatableString buildPartial()
public TruncatableString.Builder clear()
Overrides
public TruncatableString.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
public TruncatableString.Builder clearOneof(Descriptors.OneofDescriptor oneof)
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;
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;
public TruncatableString.Builder clone()
Overrides
public TruncatableString getDefaultInstanceForType()
public Descriptors.Descriptor getDescriptorForType()
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 |
Type |
Description |
ByteString |
The bytes for value.
|
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
public final boolean isInitialized()
Overrides
public TruncatableString.Builder mergeFrom(TruncatableString other)
public TruncatableString.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
public TruncatableString.Builder mergeFrom(Message other)
Parameter |
Name |
Description |
other |
Message
|
Overrides
public final TruncatableString.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
public TruncatableString.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
public TruncatableString.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
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.
|
public final TruncatableString.Builder setUnknownFields(UnknownFieldSet unknownFields)
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.
|
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.
|