Class DocumentChunk.Builder (0.1.0)

public static final class DocumentChunk.Builder extends GeneratedMessage.Builder<DocumentChunk.Builder> implements DocumentChunkOrBuilder

A DocumentChunk represents a piece of content from a Document in the DeveloperKnowledge corpus. To fetch the entire document content, pass the parent to DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments.

Protobuf type google.developers.knowledge.v1.DocumentChunk

Static Methods

getDescriptor()

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

Methods

build()

public DocumentChunk build()
Returns
Type Description
DocumentChunk

buildPartial()

public DocumentChunk buildPartial()
Returns
Type Description
DocumentChunk

clear()

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

clearContent()

public DocumentChunk.Builder clearContent()

Output only. Contains the content of the document chunk.

string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DocumentChunk.Builder

This builder for chaining.

clearDocument()

public DocumentChunk.Builder clearDocument()

Output only. Represents metadata about the Document this chunk is from. The DocumentView of this Document message will be set to DOCUMENT_VIEW_BASIC. It is included here for convenience so that clients do not need to call DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments if they only need the metadata fields. Otherwise, clients should use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full document content.

.google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DocumentChunk.Builder

clearId()

public DocumentChunk.Builder clearId()

Output only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DocumentChunk.Builder

This builder for chaining.

clearParent()

public DocumentChunk.Builder clearParent()

Output only. Contains the resource name of the document this chunk is from. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets

string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
DocumentChunk.Builder

This builder for chaining.

getContent()

public String getContent()

Output only. Contains the content of the document chunk.

string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The content.

getContentBytes()

public ByteString getContentBytes()

Output only. Contains the content of the document chunk.

string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for content.

getDefaultInstanceForType()

public DocumentChunk getDefaultInstanceForType()
Returns
Type Description
DocumentChunk

getDescriptorForType()

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

getDocument()

public Document getDocument()

Output only. Represents metadata about the Document this chunk is from. The DocumentView of this Document message will be set to DOCUMENT_VIEW_BASIC. It is included here for convenience so that clients do not need to call DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments if they only need the metadata fields. Otherwise, clients should use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full document content.

.google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Document

The document.

getDocumentBuilder()

public Document.Builder getDocumentBuilder()

Output only. Represents metadata about the Document this chunk is from. The DocumentView of this Document message will be set to DOCUMENT_VIEW_BASIC. It is included here for convenience so that clients do not need to call DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments if they only need the metadata fields. Otherwise, clients should use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full document content.

.google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Document.Builder

getDocumentOrBuilder()

public DocumentOrBuilder getDocumentOrBuilder()

Output only. Represents metadata about the Document this chunk is from. The DocumentView of this Document message will be set to DOCUMENT_VIEW_BASIC. It is included here for convenience so that clients do not need to call DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments if they only need the metadata fields. Otherwise, clients should use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full document content.

.google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DocumentOrBuilder

getId()

public String getId()

Output only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The id.

getIdBytes()

public ByteString getIdBytes()

Output only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for id.

getParent()

public String getParent()

Output only. Contains the resource name of the document this chunk is from. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets

string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The parent.

getParentBytes()

public ByteString getParentBytes()

Output only. Contains the resource name of the document this chunk is from. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets

string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for parent.

hasDocument()

public boolean hasDocument()

Output only. Represents metadata about the Document this chunk is from. The DocumentView of this Document message will be set to DOCUMENT_VIEW_BASIC. It is included here for convenience so that clients do not need to call DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments if they only need the metadata fields. Otherwise, clients should use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full document content.

.google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the document field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeDocument(Document value)

public DocumentChunk.Builder mergeDocument(Document value)

Output only. Represents metadata about the Document this chunk is from. The DocumentView of this Document message will be set to DOCUMENT_VIEW_BASIC. It is included here for convenience so that clients do not need to call DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments if they only need the metadata fields. Otherwise, clients should use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full document content.

.google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Document
Returns
Type Description
DocumentChunk.Builder

mergeFrom(DocumentChunk other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

setContent(String value)

public DocumentChunk.Builder setContent(String value)

Output only. Contains the content of the document chunk.

string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The content to set.

Returns
Type Description
DocumentChunk.Builder

This builder for chaining.

setContentBytes(ByteString value)

public DocumentChunk.Builder setContentBytes(ByteString value)

Output only. Contains the content of the document chunk.

string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for content to set.

Returns
Type Description
DocumentChunk.Builder

This builder for chaining.

setDocument(Document value)

public DocumentChunk.Builder setDocument(Document value)

Output only. Represents metadata about the Document this chunk is from. The DocumentView of this Document message will be set to DOCUMENT_VIEW_BASIC. It is included here for convenience so that clients do not need to call DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments if they only need the metadata fields. Otherwise, clients should use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full document content.

.google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Document
Returns
Type Description
DocumentChunk.Builder

setDocument(Document.Builder builderForValue)

public DocumentChunk.Builder setDocument(Document.Builder builderForValue)

Output only. Represents metadata about the Document this chunk is from. The DocumentView of this Document message will be set to DOCUMENT_VIEW_BASIC. It is included here for convenience so that clients do not need to call DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments if they only need the metadata fields. Otherwise, clients should use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full document content.

.google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Document.Builder
Returns
Type Description
DocumentChunk.Builder

setId(String value)

public DocumentChunk.Builder setId(String value)

Output only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The id to set.

Returns
Type Description
DocumentChunk.Builder

This builder for chaining.

setIdBytes(ByteString value)

public DocumentChunk.Builder setIdBytes(ByteString value)

Output only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for id to set.

Returns
Type Description
DocumentChunk.Builder

This builder for chaining.

setParent(String value)

public DocumentChunk.Builder setParent(String value)

Output only. Contains the resource name of the document this chunk is from. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets

string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The parent to set.

Returns
Type Description
DocumentChunk.Builder

This builder for chaining.

setParentBytes(ByteString value)

public DocumentChunk.Builder setParentBytes(ByteString value)

Output only. Contains the resource name of the document this chunk is from. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets

string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for parent to set.

Returns
Type Description
DocumentChunk.Builder

This builder for chaining.