Class KnowledgeBase.Builder (4.4.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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public KnowledgeBase.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
KnowledgeBase.Builder
Overrides

build()

public KnowledgeBase build()
Returns
TypeDescription
KnowledgeBase

buildPartial()

public KnowledgeBase buildPartial()
Returns
TypeDescription
KnowledgeBase

clear()

public KnowledgeBase.Builder clear()
Returns
TypeDescription
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
TypeDescription
KnowledgeBase.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public KnowledgeBase.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
KnowledgeBase.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public KnowledgeBase.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
KnowledgeBase.Builder
Overrides

clone()

public KnowledgeBase.Builder clone()
Returns
TypeDescription
KnowledgeBase.Builder
Overrides

getDefaultInstanceForType()

public KnowledgeBase getDefaultInstanceForType()
Returns
TypeDescription
KnowledgeBase

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for name.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(KnowledgeBase other)

public KnowledgeBase.Builder mergeFrom(KnowledgeBase other)
Parameter
NameDescription
otherKnowledgeBase
Returns
TypeDescription
KnowledgeBase.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public KnowledgeBase.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
KnowledgeBase.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public KnowledgeBase.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
KnowledgeBase.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final KnowledgeBase.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueString

The displayName to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for displayName to set.

Returns
TypeDescription
KnowledgeBase.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public KnowledgeBase.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The languageCode to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for languageCode to set.

Returns
TypeDescription
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
NameDescription
valueString

The name to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
KnowledgeBase.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final KnowledgeBase.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
KnowledgeBase.Builder
Overrides