Class TruncatableString.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, TruncatableStringOrBuilder, Cloneable
    Enclosing class:
    TruncatableString

    public static final class TruncatableString.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
    implements TruncatableStringOrBuilder
     A string that might be shortened to a specified length.
     
    Protobuf type opencensus.proto.trace.v1.TruncatableString
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • clear

        public TruncatableString.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • getDefaultInstanceForType

        public TruncatableString getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public TruncatableString build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public TruncatableString buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public TruncatableString.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • setField

        public TruncatableString.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • clearField

        public TruncatableString.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • clearOneof

        public TruncatableString.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • setRepeatedField

        public TruncatableString.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                          int index,
                                                          Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • addRepeatedField

        public TruncatableString.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                          Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • mergeFrom

        public TruncatableString.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TruncatableString.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • mergeFrom

        public TruncatableString.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TruncatableString.Builder>
        Throws:
        IOException
      • getValue

        public String getValue()
         The shortened string. For example, if the original string was 500 bytes long and
         the limit of the string was 128 bytes, then this value contains the first 128
         bytes of the 500-byte string. Note that truncation always happens on a
         character boundary, to ensure that a truncated string is still valid UTF-8.
         Because it may contain multi-byte characters, the size of the truncated string
         may be less than the truncation limit.
         
        string value = 1;
        Specified by:
        getValue in interface TruncatableStringOrBuilder
        Returns:
        The value.
      • getValueBytes

        public com.google.protobuf.ByteString getValueBytes()
         The shortened string. For example, if the original string was 500 bytes long and
         the limit of the string was 128 bytes, then this value contains the first 128
         bytes of the 500-byte string. Note that truncation always happens on a
         character boundary, to ensure that a truncated string is still valid UTF-8.
         Because it may contain multi-byte characters, the size of the truncated string
         may be less than the truncation limit.
         
        string value = 1;
        Specified by:
        getValueBytes in interface TruncatableStringOrBuilder
        Returns:
        The bytes for value.
      • setValue

        public TruncatableString.Builder setValue​(String value)
         The shortened string. For example, if the original string was 500 bytes long and
         the limit of the string was 128 bytes, then this value contains the first 128
         bytes of the 500-byte string. Note that truncation always happens on a
         character boundary, to ensure that a truncated string is still valid UTF-8.
         Because it may contain multi-byte characters, the size of the truncated string
         may be less than the truncation limit.
         
        string value = 1;
        Parameters:
        value - The value to set.
        Returns:
        This builder for chaining.
      • clearValue

        public TruncatableString.Builder clearValue()
         The shortened string. For example, if the original string was 500 bytes long and
         the limit of the string was 128 bytes, then this value contains the first 128
         bytes of the 500-byte string. Note that truncation always happens on a
         character boundary, to ensure that a truncated string is still valid UTF-8.
         Because it may contain multi-byte characters, the size of the truncated string
         may be less than the truncation limit.
         
        string value = 1;
        Returns:
        This builder for chaining.
      • setValueBytes

        public TruncatableString.Builder setValueBytes​(com.google.protobuf.ByteString value)
         The shortened string. For example, if the original string was 500 bytes long and
         the limit of the string was 128 bytes, then this value contains the first 128
         bytes of the 500-byte string. Note that truncation always happens on a
         character boundary, to ensure that a truncated string is still valid UTF-8.
         Because it may contain multi-byte characters, the size of the truncated string
         may be less than the truncation limit.
         
        string value = 1;
        Parameters:
        value - The bytes for value to set.
        Returns:
        This builder for chaining.
      • 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;
        Specified by:
        getTruncatedByteCount in interface TruncatableStringOrBuilder
        Returns:
        The truncatedByteCount.
      • setTruncatedByteCount

        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;
        Parameters:
        value - The truncatedByteCount to set.
        Returns:
        This builder for chaining.
      • 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:
        This builder for chaining.
      • setUnknownFields

        public final TruncatableString.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>
      • mergeUnknownFields

        public final TruncatableString.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TruncatableString.Builder>