Class Chunk.Builder (0.41.0)

public static final class Chunk.Builder extends GeneratedMessageV3.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.v1alpha.Chunk

Implements

ChunkOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Chunk.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Chunk.Builder
Overrides

build()

public Chunk build()
Returns
Type Description
Chunk

buildPartial()

public Chunk buildPartial()
Returns
Type Description
Chunk

clear()

public Chunk.Builder clear()
Returns
Type Description
Chunk.Builder
Overrides

clearChunkMetadata()

public Chunk.Builder clearChunkMetadata()

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Chunk.Builder

clearContent()

public Chunk.Builder clearContent()

Content is a string from a document (parsed content).

string content = 3;

Returns
Type Description
Chunk.Builder

This builder for chaining.

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];

Returns
Type Description
Chunk.Builder

clearDocumentMetadata()

public Chunk.Builder clearDocumentMetadata()

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata document_metadata = 5;

Returns
Type Description
Chunk.Builder

clearField(Descriptors.FieldDescriptor field)

public Chunk.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Chunk.Builder
Overrides

clearId()

public Chunk.Builder clearId()

Unique chunk ID of the current chunk.

string id = 2;

Returns
Type Description
Chunk.Builder

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
Type Description
Chunk.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Chunk.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Chunk.Builder
Overrides

clearPageSpan()

public Chunk.Builder clearPageSpan()

Page span of the chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan page_span = 6;

Returns
Type Description
Chunk.Builder

clearRelevanceScore()

public Chunk.Builder clearRelevanceScore()

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
Type Description
Chunk.Builder

This builder for chaining.

clone()

public Chunk.Builder clone()
Returns
Type Description
Chunk.Builder
Overrides

getChunkMetadata()

public Chunk.ChunkMetadata getChunkMetadata()

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Chunk.ChunkMetadata

The chunkMetadata.

getChunkMetadataBuilder()

public Chunk.ChunkMetadata.Builder getChunkMetadataBuilder()

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Chunk.ChunkMetadata.Builder

getChunkMetadataOrBuilder()

public Chunk.ChunkMetadataOrBuilder getChunkMetadataOrBuilder()

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Chunk.ChunkMetadataOrBuilder

getContent()

public String getContent()

Content is a string from a document (parsed content).

string content = 3;

Returns
Type Description
String

The content.

getContentBytes()

public ByteString getContentBytes()

Content is a string from a document (parsed content).

string content = 3;

Returns
Type Description
ByteString

The bytes for content.

getDefaultInstanceForType()

public Chunk getDefaultInstanceForType()
Returns
Type Description
Chunk

getDerivedStructData()

public 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];

Returns
Type Description
Struct

The derivedStructData.

getDerivedStructDataBuilder()

public 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];

Returns
Type Description
Builder

getDerivedStructDataOrBuilder()

public 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];

Returns
Type Description
StructOrBuilder

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDocumentMetadata()

public Chunk.DocumentMetadata getDocumentMetadata()

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata document_metadata = 5;

Returns
Type Description
Chunk.DocumentMetadata

The documentMetadata.

getDocumentMetadataBuilder()

public Chunk.DocumentMetadata.Builder getDocumentMetadataBuilder()

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata document_metadata = 5;

Returns
Type Description
Chunk.DocumentMetadata.Builder

getDocumentMetadataOrBuilder()

public Chunk.DocumentMetadataOrBuilder getDocumentMetadataOrBuilder()

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata document_metadata = 5;

Returns
Type Description
Chunk.DocumentMetadataOrBuilder

getId()

public String getId()

Unique chunk ID of the current chunk.

string id = 2;

Returns
Type Description
String

The id.

getIdBytes()

public ByteString getIdBytes()

Unique chunk ID of the current chunk.

string id = 2;

Returns
Type Description
ByteString

The bytes for id.

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;

Returns
Type Description
String

The name.

getNameBytes()

public 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;

Returns
Type Description
ByteString

The bytes for name.

getPageSpan()

public Chunk.PageSpan getPageSpan()

Page span of the chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan page_span = 6;

Returns
Type Description
Chunk.PageSpan

The pageSpan.

getPageSpanBuilder()

public Chunk.PageSpan.Builder getPageSpanBuilder()

Page span of the chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan page_span = 6;

Returns
Type Description
Chunk.PageSpan.Builder

getPageSpanOrBuilder()

public Chunk.PageSpanOrBuilder getPageSpanOrBuilder()

Page span of the chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan page_span = 6;

Returns
Type Description
Chunk.PageSpanOrBuilder

getRelevanceScore()

public double getRelevanceScore()

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
Type Description
double

The relevanceScore.

hasChunkMetadata()

public boolean hasChunkMetadata()

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the chunkMetadata field is set.

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];

Returns
Type Description
boolean

Whether the derivedStructData field is set.

hasDocumentMetadata()

public boolean hasDocumentMetadata()

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata document_metadata = 5;

Returns
Type Description
boolean

Whether the documentMetadata field is set.

hasPageSpan()

public boolean hasPageSpan()

Page span of the chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan page_span = 6;

Returns
Type Description
boolean

Whether the pageSpan field is set.

hasRelevanceScore()

public boolean hasRelevanceScore()

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
Type Description
boolean

Whether the relevanceScore field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeChunkMetadata(Chunk.ChunkMetadata value)

public Chunk.Builder mergeChunkMetadata(Chunk.ChunkMetadata value)

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Chunk.ChunkMetadata
Returns
Type Description
Chunk.Builder

mergeDerivedStructData(Struct value)

public Chunk.Builder mergeDerivedStructData(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];

Parameter
Name Description
value Struct
Returns
Type Description
Chunk.Builder

mergeDocumentMetadata(Chunk.DocumentMetadata value)

public Chunk.Builder mergeDocumentMetadata(Chunk.DocumentMetadata value)

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata document_metadata = 5;

Parameter
Name Description
value Chunk.DocumentMetadata
Returns
Type Description
Chunk.Builder

mergeFrom(Chunk other)

public Chunk.Builder mergeFrom(Chunk other)
Parameter
Name Description
other Chunk
Returns
Type Description
Chunk.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Chunk.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Chunk.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Chunk.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Chunk.Builder
Overrides

mergePageSpan(Chunk.PageSpan value)

public Chunk.Builder mergePageSpan(Chunk.PageSpan value)

Page span of the chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan page_span = 6;

Parameter
Name Description
value Chunk.PageSpan
Returns
Type Description
Chunk.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Chunk.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Chunk.Builder
Overrides

setChunkMetadata(Chunk.ChunkMetadata value)

public Chunk.Builder setChunkMetadata(Chunk.ChunkMetadata value)

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Chunk.ChunkMetadata
Returns
Type Description
Chunk.Builder

setChunkMetadata(Chunk.ChunkMetadata.Builder builderForValue)

public Chunk.Builder setChunkMetadata(Chunk.ChunkMetadata.Builder builderForValue)

Output only. Metadata of the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Chunk.ChunkMetadata.Builder
Returns
Type Description
Chunk.Builder

setContent(String value)

public Chunk.Builder setContent(String value)

Content is a string from a document (parsed content).

string content = 3;

Parameter
Name Description
value String

The content to set.

Returns
Type Description
Chunk.Builder

This builder for chaining.

setContentBytes(ByteString value)

public Chunk.Builder setContentBytes(ByteString value)

Content is a string from a document (parsed content).

string content = 3;

Parameter
Name Description
value ByteString

The bytes for content to set.

Returns
Type Description
Chunk.Builder

This builder for chaining.

setDerivedStructData(Struct value)

public Chunk.Builder setDerivedStructData(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];

Parameter
Name Description
value Struct
Returns
Type Description
Chunk.Builder

setDerivedStructData(Struct.Builder builderForValue)

public Chunk.Builder setDerivedStructData(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];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Chunk.Builder

setDocumentMetadata(Chunk.DocumentMetadata value)

public Chunk.Builder setDocumentMetadata(Chunk.DocumentMetadata value)

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata document_metadata = 5;

Parameter
Name Description
value Chunk.DocumentMetadata
Returns
Type Description
Chunk.Builder

setDocumentMetadata(Chunk.DocumentMetadata.Builder builderForValue)

public Chunk.Builder setDocumentMetadata(Chunk.DocumentMetadata.Builder builderForValue)

Metadata of the document from the current chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata document_metadata = 5;

Parameter
Name Description
builderForValue Chunk.DocumentMetadata.Builder
Returns
Type Description
Chunk.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Chunk.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Chunk.Builder
Overrides

setId(String value)

public Chunk.Builder setId(String value)

Unique chunk ID of the current chunk.

string id = 2;

Parameter
Name Description
value String

The id to set.

Returns
Type Description
Chunk.Builder

This builder for chaining.

setIdBytes(ByteString value)

public Chunk.Builder setIdBytes(ByteString value)

Unique chunk ID of the current chunk.

string id = 2;

Parameter
Name Description
value ByteString

The bytes for id to set.

Returns
Type Description
Chunk.Builder

This builder for chaining.

setName(String value)

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;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Chunk.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Chunk.Builder setNameBytes(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;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Chunk.Builder

This builder for chaining.

setPageSpan(Chunk.PageSpan value)

public Chunk.Builder setPageSpan(Chunk.PageSpan value)

Page span of the chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan page_span = 6;

Parameter
Name Description
value Chunk.PageSpan
Returns
Type Description
Chunk.Builder

setPageSpan(Chunk.PageSpan.Builder builderForValue)

public Chunk.Builder setPageSpan(Chunk.PageSpan.Builder builderForValue)

Page span of the chunk.

.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan page_span = 6;

Parameter
Name Description
builderForValue Chunk.PageSpan.Builder
Returns
Type Description
Chunk.Builder

setRelevanceScore(double value)

public Chunk.Builder setRelevanceScore(double value)

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];

Parameter
Name Description
value double

The relevanceScore to set.

Returns
Type Description
Chunk.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Chunk.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Chunk.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Chunk.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Chunk.Builder
Overrides