Class TextSegment.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<TextSegment.Builder>
com.google.cloud.automl.v1.TextSegment.Builder
All Implemented Interfaces:
TextSegmentOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
TextSegment

public static final class TextSegment.Builder extends com.google.protobuf.GeneratedMessage.Builder<TextSegment.Builder> implements TextSegmentOrBuilder
 A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding.
 
Protobuf type google.cloud.automl.v1.TextSegment
  • Method Details

    • getDescriptor

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

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

      public TextSegment.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.GeneratedMessage.Builder<TextSegment.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.GeneratedMessage.Builder<TextSegment.Builder>
    • getDefaultInstanceForType

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

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

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

      public TextSegment.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<TextSegment.Builder>
    • mergeFrom

      public TextSegment.Builder mergeFrom(TextSegment other)
    • isInitialized

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

      public TextSegment.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<TextSegment.Builder>
      Throws:
      IOException
    • getContent

      public String getContent()
       Output only. The content of the TextSegment.
       
      string content = 3;
      Specified by:
      getContent in interface TextSegmentOrBuilder
      Returns:
      The content.
    • getContentBytes

      public com.google.protobuf.ByteString getContentBytes()
       Output only. The content of the TextSegment.
       
      string content = 3;
      Specified by:
      getContentBytes in interface TextSegmentOrBuilder
      Returns:
      The bytes for content.
    • setContent

      public TextSegment.Builder setContent(String value)
       Output only. The content of the TextSegment.
       
      string content = 3;
      Parameters:
      value - The content to set.
      Returns:
      This builder for chaining.
    • clearContent

      public TextSegment.Builder clearContent()
       Output only. The content of the TextSegment.
       
      string content = 3;
      Returns:
      This builder for chaining.
    • setContentBytes

      public TextSegment.Builder setContentBytes(com.google.protobuf.ByteString value)
       Output only. The content of the TextSegment.
       
      string content = 3;
      Parameters:
      value - The bytes for content to set.
      Returns:
      This builder for chaining.
    • getStartOffset

      public long getStartOffset()
       Required. Zero-based character index of the first character of the text
       segment (counting characters from the beginning of the text).
       
      int64 start_offset = 1;
      Specified by:
      getStartOffset in interface TextSegmentOrBuilder
      Returns:
      The startOffset.
    • setStartOffset

      public TextSegment.Builder setStartOffset(long value)
       Required. Zero-based character index of the first character of the text
       segment (counting characters from the beginning of the text).
       
      int64 start_offset = 1;
      Parameters:
      value - The startOffset to set.
      Returns:
      This builder for chaining.
    • clearStartOffset

      public TextSegment.Builder clearStartOffset()
       Required. Zero-based character index of the first character of the text
       segment (counting characters from the beginning of the text).
       
      int64 start_offset = 1;
      Returns:
      This builder for chaining.
    • getEndOffset

      public long getEndOffset()
       Required. Zero-based character index of the first character past the end of
       the text segment (counting character from the beginning of the text).
       The character at the end_offset is NOT included in the text segment.
       
      int64 end_offset = 2;
      Specified by:
      getEndOffset in interface TextSegmentOrBuilder
      Returns:
      The endOffset.
    • setEndOffset

      public TextSegment.Builder setEndOffset(long value)
       Required. Zero-based character index of the first character past the end of
       the text segment (counting character from the beginning of the text).
       The character at the end_offset is NOT included in the text segment.
       
      int64 end_offset = 2;
      Parameters:
      value - The endOffset to set.
      Returns:
      This builder for chaining.
    • clearEndOffset

      public TextSegment.Builder clearEndOffset()
       Required. Zero-based character index of the first character past the end of
       the text segment (counting character from the beginning of the text).
       The character at the end_offset is NOT included in the text segment.
       
      int64 end_offset = 2;
      Returns:
      This builder for chaining.