Class KnowledgeBase.Builder (4.54.0)

public static final class KnowledgeBase.Builder extends GeneratedMessageV3.Builder<KnowledgeBase.Builder> implements KnowledgeBaseOrBuilder

A knowledge base represents a collection of knowledge documents that you provide to Dialogflow. Your knowledge documents contain information that may be useful during conversations with end-users. Some Dialogflow features use knowledge bases when looking for a response to an end-user input.

For more information, see the knowledge base guide.

Note: The projects.agent.knowledgeBases resource is deprecated; only use projects.knowledgeBases.

Protobuf type google.cloud.dialogflow.v2beta1.KnowledgeBase

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public KnowledgeBase build()
Returns
Type Description
KnowledgeBase

buildPartial()

public KnowledgeBase buildPartial()
Returns
Type Description
KnowledgeBase

clear()

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

clearDisplayName()

public KnowledgeBase.Builder clearDisplayName()

Required. The display name of the knowledge base. The name must be 1024 bytes or less; otherwise, the creation request fails.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
KnowledgeBase.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearLanguageCode()

public KnowledgeBase.Builder clearLanguageCode()

Language which represents the KnowledgeBase. When the KnowledgeBase is created/updated, this is populated for all non en-us languages. If not populated, the default language en-us applies.

string language_code = 4;

Returns
Type Description
KnowledgeBase.Builder

This builder for chaining.

clearName()

public KnowledgeBase.Builder clearName()

The knowledge base resource name. The name must be empty when creating a knowledge base. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

string name = 1;

Returns
Type Description
KnowledgeBase.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getDefaultInstanceForType()

public KnowledgeBase getDefaultInstanceForType()
Returns
Type Description
KnowledgeBase

getDescriptorForType()

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

getDisplayName()

public String getDisplayName()

Required. The display name of the knowledge base. The name must be 1024 bytes or less; otherwise, the creation request fails.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Required. The display name of the knowledge base. The name must be 1024 bytes or less; otherwise, the creation request fails.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for displayName.

getLanguageCode()

public String getLanguageCode()

Language which represents the KnowledgeBase. When the KnowledgeBase is created/updated, this is populated for all non en-us languages. If not populated, the default language en-us applies.

string language_code = 4;

Returns
Type Description
String

The languageCode.

getLanguageCodeBytes()

public ByteString getLanguageCodeBytes()

Language which represents the KnowledgeBase. When the KnowledgeBase is created/updated, this is populated for all non en-us languages. If not populated, the default language en-us applies.

string language_code = 4;

Returns
Type Description
ByteString

The bytes for languageCode.

getName()

public String getName()

The knowledge base resource name. The name must be empty when creating a knowledge base. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The knowledge base resource name. The name must be empty when creating a knowledge base. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(KnowledgeBase other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setDisplayName(String value)

public KnowledgeBase.Builder setDisplayName(String value)

Required. The display name of the knowledge base. The name must be 1024 bytes or less; otherwise, the creation request fails.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
KnowledgeBase.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public KnowledgeBase.Builder setDisplayNameBytes(ByteString value)

Required. The display name of the knowledge base. The name must be 1024 bytes or less; otherwise, the creation request fails.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
KnowledgeBase.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setLanguageCode(String value)

public KnowledgeBase.Builder setLanguageCode(String value)

Language which represents the KnowledgeBase. When the KnowledgeBase is created/updated, this is populated for all non en-us languages. If not populated, the default language en-us applies.

string language_code = 4;

Parameter
Name Description
value String

The languageCode to set.

Returns
Type Description
KnowledgeBase.Builder

This builder for chaining.

setLanguageCodeBytes(ByteString value)

public KnowledgeBase.Builder setLanguageCodeBytes(ByteString value)

Language which represents the KnowledgeBase. When the KnowledgeBase is created/updated, this is populated for all non en-us languages. If not populated, the default language en-us applies.

string language_code = 4;

Parameter
Name Description
value ByteString

The bytes for languageCode to set.

Returns
Type Description
KnowledgeBase.Builder

This builder for chaining.

setName(String value)

public KnowledgeBase.Builder setName(String value)

The knowledge base resource name. The name must be empty when creating a knowledge base. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
KnowledgeBase.Builder

This builder for chaining.

setNameBytes(ByteString value)

public KnowledgeBase.Builder setNameBytes(ByteString value)

The knowledge base resource name. The name must be empty when creating a knowledge base. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
KnowledgeBase.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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