Class DocumentChunk (0.1.0)

public final class DocumentChunk extends GeneratedMessage 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 Fields

CONTENT_FIELD_NUMBER

public static final int CONTENT_FIELD_NUMBER
Field Value
Type Description
int

DOCUMENT_FIELD_NUMBER

public static final int DOCUMENT_FIELD_NUMBER
Field Value
Type Description
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
Type Description
int

PARENT_FIELD_NUMBER

public static final int PARENT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static DocumentChunk getDefaultInstance()
Returns
Type Description
DocumentChunk

getDescriptor()

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

newBuilder()

public static DocumentChunk.Builder newBuilder()
Returns
Type Description
DocumentChunk.Builder

newBuilder(DocumentChunk prototype)

public static DocumentChunk.Builder newBuilder(DocumentChunk prototype)
Parameter
Name Description
prototype DocumentChunk
Returns
Type Description
DocumentChunk.Builder

parseDelimitedFrom(InputStream input)

public static DocumentChunk parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DocumentChunk
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DocumentChunk parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DocumentChunk
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static DocumentChunk parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
DocumentChunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DocumentChunk parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DocumentChunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DocumentChunk parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
DocumentChunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DocumentChunk parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DocumentChunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DocumentChunk parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
DocumentChunk
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DocumentChunk parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DocumentChunk
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static DocumentChunk parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DocumentChunk
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DocumentChunk parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DocumentChunk
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static DocumentChunk parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
DocumentChunk
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DocumentChunk parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DocumentChunk
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<DocumentChunk> parser()
Returns
Type Description
Parser<DocumentChunk>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

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

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.

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.

getParserForType()

public Parser<DocumentChunk> getParserForType()
Returns
Type Description
Parser<DocumentChunk>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public DocumentChunk.Builder newBuilderForType()
Returns
Type Description
DocumentChunk.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

protected DocumentChunk.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
DocumentChunk.Builder
Overrides

toBuilder()

public DocumentChunk.Builder toBuilder()
Returns
Type Description
DocumentChunk.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException