Class Chunk.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Chunk.Builder>
com.google.cloud.discoveryengine.v1beta.Chunk.Builder
All Implemented Interfaces:
ChunkOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Chunk

public static final class Chunk.Builder extends com.google.protobuf.GeneratedMessage.Builder<Chunk.Builder> implements ChunkOrBuilder
 Chunk captures all raw metadata information of items to be recommended or
 searched in the chunk mode.
 
Protobuf type google.cloud.discoveryengine.v1beta.Chunk
  • 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<Chunk.Builder>
    • clear

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

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

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

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

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

      public Chunk.Builder mergeFrom(Chunk other)
    • isInitialized

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

      public Chunk.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<Chunk.Builder>
      Throws:
      IOException
    • getName

      public String getName()
       The full resource name of the chunk.
       Format:
       `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`.
      
       This field must be a UTF-8 encoded string with a length limit of 1024
       characters.
       
      string name = 1;
      Specified by:
      getName in interface ChunkOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       The full resource name of the chunk.
       Format:
       `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`.
      
       This field must be a UTF-8 encoded string with a length limit of 1024
       characters.
       
      string name = 1;
      Specified by:
      getNameBytes in interface ChunkOrBuilder
      Returns:
      The bytes for name.
    • setName

      public Chunk.Builder setName(String value)
       The full resource name of the chunk.
       Format:
       `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`.
      
       This field must be a UTF-8 encoded string with a length limit of 1024
       characters.
       
      string name = 1;
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public Chunk.Builder clearName()
       The full resource name of the chunk.
       Format:
       `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`.
      
       This field must be a UTF-8 encoded string with a length limit of 1024
       characters.
       
      string name = 1;
      Returns:
      This builder for chaining.
    • setNameBytes

      public Chunk.Builder setNameBytes(com.google.protobuf.ByteString value)
       The full resource name of the chunk.
       Format:
       `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`.
      
       This field must be a UTF-8 encoded string with a length limit of 1024
       characters.
       
      string name = 1;
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getId

      public String getId()
       Unique chunk ID of the current chunk.
       
      string id = 2;
      Specified by:
      getId in interface ChunkOrBuilder
      Returns:
      The id.
    • getIdBytes

      public com.google.protobuf.ByteString getIdBytes()
       Unique chunk ID of the current chunk.
       
      string id = 2;
      Specified by:
      getIdBytes in interface ChunkOrBuilder
      Returns:
      The bytes for id.
    • setId

      public Chunk.Builder setId(String value)
       Unique chunk ID of the current chunk.
       
      string id = 2;
      Parameters:
      value - The id to set.
      Returns:
      This builder for chaining.
    • clearId

      public Chunk.Builder clearId()
       Unique chunk ID of the current chunk.
       
      string id = 2;
      Returns:
      This builder for chaining.
    • setIdBytes

      public Chunk.Builder setIdBytes(com.google.protobuf.ByteString value)
       Unique chunk ID of the current chunk.
       
      string id = 2;
      Parameters:
      value - The bytes for id to set.
      Returns:
      This builder for chaining.
    • getContent

      public String getContent()
       Content is a string from a document (parsed content).
       
      string content = 3;
      Specified by:
      getContent in interface ChunkOrBuilder
      Returns:
      The content.
    • getContentBytes

      public com.google.protobuf.ByteString getContentBytes()
       Content is a string from a document (parsed content).
       
      string content = 3;
      Specified by:
      getContentBytes in interface ChunkOrBuilder
      Returns:
      The bytes for content.
    • setContent

      public Chunk.Builder setContent(String value)
       Content is a string from a document (parsed content).
       
      string content = 3;
      Parameters:
      value - The content to set.
      Returns:
      This builder for chaining.
    • clearContent

      public Chunk.Builder clearContent()
       Content is a string from a document (parsed content).
       
      string content = 3;
      Returns:
      This builder for chaining.
    • setContentBytes

      public Chunk.Builder setContentBytes(com.google.protobuf.ByteString value)
       Content is a string from a document (parsed content).
       
      string content = 3;
      Parameters:
      value - The bytes for content to set.
      Returns:
      This builder for chaining.
    • hasRelevanceScore

      public boolean hasRelevanceScore()
       Output only. Represents the relevance score based on similarity.
       Higher score indicates higher chunk relevance.
       The score is in range [-1.0, 1.0].
       Only populated on [SearchService.SearchResponse][].
       
      optional double relevance_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasRelevanceScore in interface ChunkOrBuilder
      Returns:
      Whether the relevanceScore field is set.
    • getRelevanceScore

      public double getRelevanceScore()
       Output only. Represents the relevance score based on similarity.
       Higher score indicates higher chunk relevance.
       The score is in range [-1.0, 1.0].
       Only populated on [SearchService.SearchResponse][].
       
      optional double relevance_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRelevanceScore in interface ChunkOrBuilder
      Returns:
      The relevanceScore.
    • setRelevanceScore

      public Chunk.Builder setRelevanceScore(double value)
       Output only. Represents the relevance score based on similarity.
       Higher score indicates higher chunk relevance.
       The score is in range [-1.0, 1.0].
       Only populated on [SearchService.SearchResponse][].
       
      optional double relevance_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The relevanceScore to set.
      Returns:
      This builder for chaining.
    • clearRelevanceScore

      public Chunk.Builder clearRelevanceScore()
       Output only. Represents the relevance score based on similarity.
       Higher score indicates higher chunk relevance.
       The score is in range [-1.0, 1.0].
       Only populated on [SearchService.SearchResponse][].
       
      optional double relevance_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Returns:
      This builder for chaining.
    • hasDocumentMetadata

      public boolean hasDocumentMetadata()
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;
      Specified by:
      hasDocumentMetadata in interface ChunkOrBuilder
      Returns:
      Whether the documentMetadata field is set.
    • getDocumentMetadata

      public Chunk.DocumentMetadata getDocumentMetadata()
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;
      Specified by:
      getDocumentMetadata in interface ChunkOrBuilder
      Returns:
      The documentMetadata.
    • setDocumentMetadata

      public Chunk.Builder setDocumentMetadata(Chunk.DocumentMetadata value)
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;
    • setDocumentMetadata

      public Chunk.Builder setDocumentMetadata(Chunk.DocumentMetadata.Builder builderForValue)
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;
    • mergeDocumentMetadata

      public Chunk.Builder mergeDocumentMetadata(Chunk.DocumentMetadata value)
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;
    • clearDocumentMetadata

      public Chunk.Builder clearDocumentMetadata()
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;
    • getDocumentMetadataBuilder

      public Chunk.DocumentMetadata.Builder getDocumentMetadataBuilder()
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;
    • getDocumentMetadataOrBuilder

      public Chunk.DocumentMetadataOrBuilder getDocumentMetadataOrBuilder()
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.DocumentMetadata document_metadata = 5;
      Specified by:
      getDocumentMetadataOrBuilder in interface ChunkOrBuilder
    • hasDerivedStructData

      public boolean hasDerivedStructData()
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasDerivedStructData in interface ChunkOrBuilder
      Returns:
      Whether the derivedStructData field is set.
    • getDerivedStructData

      public com.google.protobuf.Struct getDerivedStructData()
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDerivedStructData in interface ChunkOrBuilder
      Returns:
      The derivedStructData.
    • setDerivedStructData

      public Chunk.Builder setDerivedStructData(com.google.protobuf.Struct value)
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setDerivedStructData

      public Chunk.Builder setDerivedStructData(com.google.protobuf.Struct.Builder builderForValue)
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • mergeDerivedStructData

      public Chunk.Builder mergeDerivedStructData(com.google.protobuf.Struct value)
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • clearDerivedStructData

      public Chunk.Builder clearDerivedStructData()
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getDerivedStructDataBuilder

      public com.google.protobuf.Struct.Builder getDerivedStructDataBuilder()
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getDerivedStructDataOrBuilder

      public com.google.protobuf.StructOrBuilder getDerivedStructDataOrBuilder()
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDerivedStructDataOrBuilder in interface ChunkOrBuilder
    • hasPageSpan

      public boolean hasPageSpan()
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;
      Specified by:
      hasPageSpan in interface ChunkOrBuilder
      Returns:
      Whether the pageSpan field is set.
    • getPageSpan

      public Chunk.PageSpan getPageSpan()
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;
      Specified by:
      getPageSpan in interface ChunkOrBuilder
      Returns:
      The pageSpan.
    • setPageSpan

      public Chunk.Builder setPageSpan(Chunk.PageSpan value)
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;
    • setPageSpan

      public Chunk.Builder setPageSpan(Chunk.PageSpan.Builder builderForValue)
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;
    • mergePageSpan

      public Chunk.Builder mergePageSpan(Chunk.PageSpan value)
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;
    • clearPageSpan

      public Chunk.Builder clearPageSpan()
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;
    • getPageSpanBuilder

      public Chunk.PageSpan.Builder getPageSpanBuilder()
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;
    • getPageSpanOrBuilder

      public Chunk.PageSpanOrBuilder getPageSpanOrBuilder()
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.PageSpan page_span = 6;
      Specified by:
      getPageSpanOrBuilder in interface ChunkOrBuilder
    • hasChunkMetadata

      public boolean hasChunkMetadata()
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasChunkMetadata in interface ChunkOrBuilder
      Returns:
      Whether the chunkMetadata field is set.
    • getChunkMetadata

      public Chunk.ChunkMetadata getChunkMetadata()
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getChunkMetadata in interface ChunkOrBuilder
      Returns:
      The chunkMetadata.
    • setChunkMetadata

      public Chunk.Builder setChunkMetadata(Chunk.ChunkMetadata value)
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setChunkMetadata

      public Chunk.Builder setChunkMetadata(Chunk.ChunkMetadata.Builder builderForValue)
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • mergeChunkMetadata

      public Chunk.Builder mergeChunkMetadata(Chunk.ChunkMetadata value)
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • clearChunkMetadata

      public Chunk.Builder clearChunkMetadata()
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getChunkMetadataBuilder

      public Chunk.ChunkMetadata.Builder getChunkMetadataBuilder()
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getChunkMetadataOrBuilder

      public Chunk.ChunkMetadataOrBuilder getChunkMetadataOrBuilder()
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1beta.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getChunkMetadataOrBuilder in interface ChunkOrBuilder