com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-dialogflow-v2 Show documentation
Show all versions of proto-google-cloud-dialogflow-v2 Show documentation
PROTO library for proto-google-cloud-dialogflow-v2
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dialogflow/v2/conversation.proto
// Protobuf Java Version: 3.25.5
package com.google.cloud.dialogflow.v2;
/**
*
*
*
* Represents a SearchKnowledge answer.
*
*
* Protobuf type {@code google.cloud.dialogflow.v2.SearchKnowledgeAnswer}
*/
public final class SearchKnowledgeAnswer extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.SearchKnowledgeAnswer)
SearchKnowledgeAnswerOrBuilder {
private static final long serialVersionUID = 0L;
// Use SearchKnowledgeAnswer.newBuilder() to construct.
private SearchKnowledgeAnswer(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private SearchKnowledgeAnswer() {
answer_ = "";
answerType_ = 0;
answerSources_ = java.util.Collections.emptyList();
answerRecord_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new SearchKnowledgeAnswer();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.class,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.Builder.class);
}
/**
*
*
*
* The type of the answer.
*
*
* Protobuf enum {@code google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType}
*/
public enum AnswerType implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
*
* The answer has a unspecified type.
*
*
* ANSWER_TYPE_UNSPECIFIED = 0;
*/
ANSWER_TYPE_UNSPECIFIED(0),
/**
*
*
*
* The answer is from FAQ documents.
*
*
* FAQ = 1;
*/
FAQ(1),
/**
*
*
*
* The answer is from generative model.
*
*
* GENERATIVE = 2;
*/
GENERATIVE(2),
/**
*
*
*
* The answer is from intent matching.
*
*
* INTENT = 3;
*/
INTENT(3),
UNRECOGNIZED(-1),
;
/**
*
*
*
* The answer has a unspecified type.
*
*
* ANSWER_TYPE_UNSPECIFIED = 0;
*/
public static final int ANSWER_TYPE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* The answer is from FAQ documents.
*
*
* FAQ = 1;
*/
public static final int FAQ_VALUE = 1;
/**
*
*
*
* The answer is from generative model.
*
*
* GENERATIVE = 2;
*/
public static final int GENERATIVE_VALUE = 2;
/**
*
*
*
* The answer is from intent matching.
*
*
* INTENT = 3;
*/
public static final int INTENT_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static AnswerType valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static AnswerType forNumber(int value) {
switch (value) {
case 0:
return ANSWER_TYPE_UNSPECIFIED;
case 1:
return FAQ;
case 2:
return GENERATIVE;
case 3:
return INTENT;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public AnswerType findValueByNumber(int number) {
return AnswerType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.getDescriptor()
.getEnumTypes()
.get(0);
}
private static final AnswerType[] VALUES = values();
public static AnswerType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private AnswerType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType)
}
public interface AnswerSourceOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* The title of the article.
*
*
* string title = 1;
*
* @return The title.
*/
java.lang.String getTitle();
/**
*
*
*
* The title of the article.
*
*
* string title = 1;
*
* @return The bytes for title.
*/
com.google.protobuf.ByteString getTitleBytes();
/**
*
*
*
* The URI of the article.
*
*
* string uri = 2;
*
* @return The uri.
*/
java.lang.String getUri();
/**
*
*
*
* The URI of the article.
*
*
* string uri = 2;
*
* @return The bytes for uri.
*/
com.google.protobuf.ByteString getUriBytes();
/**
*
*
*
* The relevant snippet of the article.
*
*
* string snippet = 3;
*
* @return The snippet.
*/
java.lang.String getSnippet();
/**
*
*
*
* The relevant snippet of the article.
*
*
* string snippet = 3;
*
* @return The bytes for snippet.
*/
com.google.protobuf.ByteString getSnippetBytes();
}
/**
*
*
*
* The sources of the answers.
*
*
* Protobuf type {@code google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource}
*/
public static final class AnswerSource extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource)
AnswerSourceOrBuilder {
private static final long serialVersionUID = 0L;
// Use AnswerSource.newBuilder() to construct.
private AnswerSource(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private AnswerSource() {
title_ = "";
uri_ = "";
snippet_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new AnswerSource();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_AnswerSource_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_AnswerSource_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.class,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder.class);
}
public static final int TITLE_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object title_ = "";
/**
*
*
*
* The title of the article.
*
*
* string title = 1;
*
* @return The title.
*/
@java.lang.Override
public java.lang.String getTitle() {
java.lang.Object ref = title_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
title_ = s;
return s;
}
}
/**
*
*
*
* The title of the article.
*
*
* string title = 1;
*
* @return The bytes for title.
*/
@java.lang.Override
public com.google.protobuf.ByteString getTitleBytes() {
java.lang.Object ref = title_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
title_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int URI_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object uri_ = "";
/**
*
*
*
* The URI of the article.
*
*
* string uri = 2;
*
* @return The uri.
*/
@java.lang.Override
public java.lang.String getUri() {
java.lang.Object ref = uri_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
uri_ = s;
return s;
}
}
/**
*
*
*
* The URI of the article.
*
*
* string uri = 2;
*
* @return The bytes for uri.
*/
@java.lang.Override
public com.google.protobuf.ByteString getUriBytes() {
java.lang.Object ref = uri_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
uri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SNIPPET_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile java.lang.Object snippet_ = "";
/**
*
*
*
* The relevant snippet of the article.
*
*
* string snippet = 3;
*
* @return The snippet.
*/
@java.lang.Override
public java.lang.String getSnippet() {
java.lang.Object ref = snippet_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
snippet_ = s;
return s;
}
}
/**
*
*
*
* The relevant snippet of the article.
*
*
* string snippet = 3;
*
* @return The bytes for snippet.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSnippetBytes() {
java.lang.Object ref = snippet_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
snippet_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, title_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uri_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snippet_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, snippet_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, title_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uri_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snippet_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, snippet_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource)) {
return super.equals(obj);
}
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource other =
(com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource) obj;
if (!getTitle().equals(other.getTitle())) return false;
if (!getUri().equals(other.getUri())) return false;
if (!getSnippet().equals(other.getSnippet())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + TITLE_FIELD_NUMBER;
hash = (53 * hash) + getTitle().hashCode();
hash = (37 * hash) + URI_FIELD_NUMBER;
hash = (53 * hash) + getUri().hashCode();
hash = (37 * hash) + SNIPPET_FIELD_NUMBER;
hash = (53 * hash) + getSnippet().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* The sources of the answers.
*
*
* Protobuf type {@code google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource)
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSourceOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_AnswerSource_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_AnswerSource_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.class,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder.class);
}
// Construct using
// com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
title_ = "";
uri_ = "";
snippet_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_AnswerSource_descriptor;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
getDefaultInstanceForType() {
return com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource build() {
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource buildPartial() {
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource result =
new com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.title_ = title_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.uri_ = uri_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.snippet_ = snippet_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource) {
return mergeFrom(
(com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource other) {
if (other
== com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
.getDefaultInstance()) return this;
if (!other.getTitle().isEmpty()) {
title_ = other.title_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getUri().isEmpty()) {
uri_ = other.uri_;
bitField0_ |= 0x00000002;
onChanged();
}
if (!other.getSnippet().isEmpty()) {
snippet_ = other.snippet_;
bitField0_ |= 0x00000004;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
title_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
uri_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
snippet_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 26
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object title_ = "";
/**
*
*
*
* The title of the article.
*
*
* string title = 1;
*
* @return The title.
*/
public java.lang.String getTitle() {
java.lang.Object ref = title_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
title_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The title of the article.
*
*
* string title = 1;
*
* @return The bytes for title.
*/
public com.google.protobuf.ByteString getTitleBytes() {
java.lang.Object ref = title_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
title_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The title of the article.
*
*
* string title = 1;
*
* @param value The title to set.
* @return This builder for chaining.
*/
public Builder setTitle(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
title_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The title of the article.
*
*
* string title = 1;
*
* @return This builder for chaining.
*/
public Builder clearTitle() {
title_ = getDefaultInstance().getTitle();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* The title of the article.
*
*
* string title = 1;
*
* @param value The bytes for title to set.
* @return This builder for chaining.
*/
public Builder setTitleBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
title_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object uri_ = "";
/**
*
*
*
* The URI of the article.
*
*
* string uri = 2;
*
* @return The uri.
*/
public java.lang.String getUri() {
java.lang.Object ref = uri_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
uri_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The URI of the article.
*
*
* string uri = 2;
*
* @return The bytes for uri.
*/
public com.google.protobuf.ByteString getUriBytes() {
java.lang.Object ref = uri_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
uri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The URI of the article.
*
*
* string uri = 2;
*
* @param value The uri to set.
* @return This builder for chaining.
*/
public Builder setUri(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
uri_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* The URI of the article.
*
*
* string uri = 2;
*
* @return This builder for chaining.
*/
public Builder clearUri() {
uri_ = getDefaultInstance().getUri();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
*
* The URI of the article.
*
*
* string uri = 2;
*
* @param value The bytes for uri to set.
* @return This builder for chaining.
*/
public Builder setUriBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
uri_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private java.lang.Object snippet_ = "";
/**
*
*
*
* The relevant snippet of the article.
*
*
* string snippet = 3;
*
* @return The snippet.
*/
public java.lang.String getSnippet() {
java.lang.Object ref = snippet_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
snippet_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The relevant snippet of the article.
*
*
* string snippet = 3;
*
* @return The bytes for snippet.
*/
public com.google.protobuf.ByteString getSnippetBytes() {
java.lang.Object ref = snippet_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
snippet_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The relevant snippet of the article.
*
*
* string snippet = 3;
*
* @param value The snippet to set.
* @return This builder for chaining.
*/
public Builder setSnippet(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
snippet_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* The relevant snippet of the article.
*
*
* string snippet = 3;
*
* @return This builder for chaining.
*/
public Builder clearSnippet() {
snippet_ = getDefaultInstance().getSnippet();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
/**
*
*
*
* The relevant snippet of the article.
*
*
* string snippet = 3;
*
* @param value The bytes for snippet to set.
* @return This builder for chaining.
*/
public Builder setSnippetBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
snippet_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource)
}
// @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource)
private static final com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource();
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public AnswerSource parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int ANSWER_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object answer_ = "";
/**
*
*
*
* The piece of text from the knowledge base documents that answers
* the search query
*
*
* string answer = 1;
*
* @return The answer.
*/
@java.lang.Override
public java.lang.String getAnswer() {
java.lang.Object ref = answer_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
answer_ = s;
return s;
}
}
/**
*
*
*
* The piece of text from the knowledge base documents that answers
* the search query
*
*
* string answer = 1;
*
* @return The bytes for answer.
*/
@java.lang.Override
public com.google.protobuf.ByteString getAnswerBytes() {
java.lang.Object ref = answer_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
answer_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ANSWER_TYPE_FIELD_NUMBER = 2;
private int answerType_ = 0;
/**
*
*
*
* The type of the answer.
*
*
* .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2;
*
* @return The enum numeric value on the wire for answerType.
*/
@java.lang.Override
public int getAnswerTypeValue() {
return answerType_;
}
/**
*
*
*
* The type of the answer.
*
*
* .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2;
*
* @return The answerType.
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType getAnswerType() {
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType result =
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType.forNumber(answerType_);
return result == null
? com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType.UNRECOGNIZED
: result;
}
public static final int ANSWER_SOURCES_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private java.util.List
answerSources_;
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
@java.lang.Override
public java.util.List
getAnswerSourcesList() {
return answerSources_;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
@java.lang.Override
public java.util.List<
? extends com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSourceOrBuilder>
getAnswerSourcesOrBuilderList() {
return answerSources_;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
@java.lang.Override
public int getAnswerSourcesCount() {
return answerSources_.size();
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource getAnswerSources(
int index) {
return answerSources_.get(index);
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSourceOrBuilder
getAnswerSourcesOrBuilder(int index) {
return answerSources_.get(index);
}
public static final int ANSWER_RECORD_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private volatile java.lang.Object answerRecord_ = "";
/**
*
*
*
* The name of the answer record.
* Format: `projects/<Project ID>/locations/<location ID>/answer
* Records/<Answer Record ID>`
*
*
* string answer_record = 5;
*
* @return The answerRecord.
*/
@java.lang.Override
public java.lang.String getAnswerRecord() {
java.lang.Object ref = answerRecord_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
answerRecord_ = s;
return s;
}
}
/**
*
*
*
* The name of the answer record.
* Format: `projects/<Project ID>/locations/<location ID>/answer
* Records/<Answer Record ID>`
*
*
* string answer_record = 5;
*
* @return The bytes for answerRecord.
*/
@java.lang.Override
public com.google.protobuf.ByteString getAnswerRecordBytes() {
java.lang.Object ref = answerRecord_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
answerRecord_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(answer_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, answer_);
}
if (answerType_
!= com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType.ANSWER_TYPE_UNSPECIFIED
.getNumber()) {
output.writeEnum(2, answerType_);
}
for (int i = 0; i < answerSources_.size(); i++) {
output.writeMessage(3, answerSources_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(answerRecord_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, answerRecord_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(answer_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, answer_);
}
if (answerType_
!= com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType.ANSWER_TYPE_UNSPECIFIED
.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, answerType_);
}
for (int i = 0; i < answerSources_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, answerSources_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(answerRecord_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, answerRecord_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer)) {
return super.equals(obj);
}
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer other =
(com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer) obj;
if (!getAnswer().equals(other.getAnswer())) return false;
if (answerType_ != other.answerType_) return false;
if (!getAnswerSourcesList().equals(other.getAnswerSourcesList())) return false;
if (!getAnswerRecord().equals(other.getAnswerRecord())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + ANSWER_FIELD_NUMBER;
hash = (53 * hash) + getAnswer().hashCode();
hash = (37 * hash) + ANSWER_TYPE_FIELD_NUMBER;
hash = (53 * hash) + answerType_;
if (getAnswerSourcesCount() > 0) {
hash = (37 * hash) + ANSWER_SOURCES_FIELD_NUMBER;
hash = (53 * hash) + getAnswerSourcesList().hashCode();
}
hash = (37 * hash) + ANSWER_RECORD_FIELD_NUMBER;
hash = (53 * hash) + getAnswerRecord().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* Represents a SearchKnowledge answer.
*
*
* Protobuf type {@code google.cloud.dialogflow.v2.SearchKnowledgeAnswer}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.SearchKnowledgeAnswer)
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswerOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.class,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.Builder.class);
}
// Construct using com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
answer_ = "";
answerType_ = 0;
if (answerSourcesBuilder_ == null) {
answerSources_ = java.util.Collections.emptyList();
} else {
answerSources_ = null;
answerSourcesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
answerRecord_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.dialogflow.v2.ConversationProto
.internal_static_google_cloud_dialogflow_v2_SearchKnowledgeAnswer_descriptor;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer getDefaultInstanceForType() {
return com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer build() {
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer buildPartial() {
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer result =
new com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer result) {
if (answerSourcesBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
answerSources_ = java.util.Collections.unmodifiableList(answerSources_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.answerSources_ = answerSources_;
} else {
result.answerSources_ = answerSourcesBuilder_.build();
}
}
private void buildPartial0(com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.answer_ = answer_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.answerType_ = answerType_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.answerRecord_ = answerRecord_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer) {
return mergeFrom((com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer other) {
if (other == com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.getDefaultInstance())
return this;
if (!other.getAnswer().isEmpty()) {
answer_ = other.answer_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.answerType_ != 0) {
setAnswerTypeValue(other.getAnswerTypeValue());
}
if (answerSourcesBuilder_ == null) {
if (!other.answerSources_.isEmpty()) {
if (answerSources_.isEmpty()) {
answerSources_ = other.answerSources_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureAnswerSourcesIsMutable();
answerSources_.addAll(other.answerSources_);
}
onChanged();
}
} else {
if (!other.answerSources_.isEmpty()) {
if (answerSourcesBuilder_.isEmpty()) {
answerSourcesBuilder_.dispose();
answerSourcesBuilder_ = null;
answerSources_ = other.answerSources_;
bitField0_ = (bitField0_ & ~0x00000004);
answerSourcesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getAnswerSourcesFieldBuilder()
: null;
} else {
answerSourcesBuilder_.addAllMessages(other.answerSources_);
}
}
}
if (!other.getAnswerRecord().isEmpty()) {
answerRecord_ = other.answerRecord_;
bitField0_ |= 0x00000008;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
answer_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 16:
{
answerType_ = input.readEnum();
bitField0_ |= 0x00000002;
break;
} // case 16
case 26:
{
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource m =
input.readMessage(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.parser(),
extensionRegistry);
if (answerSourcesBuilder_ == null) {
ensureAnswerSourcesIsMutable();
answerSources_.add(m);
} else {
answerSourcesBuilder_.addMessage(m);
}
break;
} // case 26
case 42:
{
answerRecord_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000008;
break;
} // case 42
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object answer_ = "";
/**
*
*
*
* The piece of text from the knowledge base documents that answers
* the search query
*
*
* string answer = 1;
*
* @return The answer.
*/
public java.lang.String getAnswer() {
java.lang.Object ref = answer_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
answer_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The piece of text from the knowledge base documents that answers
* the search query
*
*
* string answer = 1;
*
* @return The bytes for answer.
*/
public com.google.protobuf.ByteString getAnswerBytes() {
java.lang.Object ref = answer_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
answer_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The piece of text from the knowledge base documents that answers
* the search query
*
*
* string answer = 1;
*
* @param value The answer to set.
* @return This builder for chaining.
*/
public Builder setAnswer(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
answer_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The piece of text from the knowledge base documents that answers
* the search query
*
*
* string answer = 1;
*
* @return This builder for chaining.
*/
public Builder clearAnswer() {
answer_ = getDefaultInstance().getAnswer();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* The piece of text from the knowledge base documents that answers
* the search query
*
*
* string answer = 1;
*
* @param value The bytes for answer to set.
* @return This builder for chaining.
*/
public Builder setAnswerBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
answer_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private int answerType_ = 0;
/**
*
*
*
* The type of the answer.
*
*
* .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2;
*
* @return The enum numeric value on the wire for answerType.
*/
@java.lang.Override
public int getAnswerTypeValue() {
return answerType_;
}
/**
*
*
*
* The type of the answer.
*
*
* .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2;
*
* @param value The enum numeric value on the wire for answerType to set.
* @return This builder for chaining.
*/
public Builder setAnswerTypeValue(int value) {
answerType_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* The type of the answer.
*
*
* .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2;
*
* @return The answerType.
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType getAnswerType() {
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType result =
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType.forNumber(answerType_);
return result == null
? com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType.UNRECOGNIZED
: result;
}
/**
*
*
*
* The type of the answer.
*
*
* .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2;
*
* @param value The answerType to set.
* @return This builder for chaining.
*/
public Builder setAnswerType(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
answerType_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* The type of the answer.
*
*
* .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2;
*
* @return This builder for chaining.
*/
public Builder clearAnswerType() {
bitField0_ = (bitField0_ & ~0x00000002);
answerType_ = 0;
onChanged();
return this;
}
private java.util.List
answerSources_ = java.util.Collections.emptyList();
private void ensureAnswerSourcesIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
answerSources_ =
new java.util.ArrayList<
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource>(answerSources_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSourceOrBuilder>
answerSourcesBuilder_;
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public java.util.List
getAnswerSourcesList() {
if (answerSourcesBuilder_ == null) {
return java.util.Collections.unmodifiableList(answerSources_);
} else {
return answerSourcesBuilder_.getMessageList();
}
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public int getAnswerSourcesCount() {
if (answerSourcesBuilder_ == null) {
return answerSources_.size();
} else {
return answerSourcesBuilder_.getCount();
}
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource getAnswerSources(
int index) {
if (answerSourcesBuilder_ == null) {
return answerSources_.get(index);
} else {
return answerSourcesBuilder_.getMessage(index);
}
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public Builder setAnswerSources(
int index, com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource value) {
if (answerSourcesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAnswerSourcesIsMutable();
answerSources_.set(index, value);
onChanged();
} else {
answerSourcesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public Builder setAnswerSources(
int index,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder builderForValue) {
if (answerSourcesBuilder_ == null) {
ensureAnswerSourcesIsMutable();
answerSources_.set(index, builderForValue.build());
onChanged();
} else {
answerSourcesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public Builder addAnswerSources(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource value) {
if (answerSourcesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAnswerSourcesIsMutable();
answerSources_.add(value);
onChanged();
} else {
answerSourcesBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public Builder addAnswerSources(
int index, com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource value) {
if (answerSourcesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureAnswerSourcesIsMutable();
answerSources_.add(index, value);
onChanged();
} else {
answerSourcesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public Builder addAnswerSources(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder builderForValue) {
if (answerSourcesBuilder_ == null) {
ensureAnswerSourcesIsMutable();
answerSources_.add(builderForValue.build());
onChanged();
} else {
answerSourcesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public Builder addAnswerSources(
int index,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder builderForValue) {
if (answerSourcesBuilder_ == null) {
ensureAnswerSourcesIsMutable();
answerSources_.add(index, builderForValue.build());
onChanged();
} else {
answerSourcesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public Builder addAllAnswerSources(
java.lang.Iterable<
? extends com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource>
values) {
if (answerSourcesBuilder_ == null) {
ensureAnswerSourcesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, answerSources_);
onChanged();
} else {
answerSourcesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public Builder clearAnswerSources() {
if (answerSourcesBuilder_ == null) {
answerSources_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
answerSourcesBuilder_.clear();
}
return this;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public Builder removeAnswerSources(int index) {
if (answerSourcesBuilder_ == null) {
ensureAnswerSourcesIsMutable();
answerSources_.remove(index);
onChanged();
} else {
answerSourcesBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder
getAnswerSourcesBuilder(int index) {
return getAnswerSourcesFieldBuilder().getBuilder(index);
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSourceOrBuilder
getAnswerSourcesOrBuilder(int index) {
if (answerSourcesBuilder_ == null) {
return answerSources_.get(index);
} else {
return answerSourcesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public java.util.List<
? extends com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSourceOrBuilder>
getAnswerSourcesOrBuilderList() {
if (answerSourcesBuilder_ != null) {
return answerSourcesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(answerSources_);
}
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder
addAnswerSourcesBuilder() {
return getAnswerSourcesFieldBuilder()
.addBuilder(
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
.getDefaultInstance());
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder
addAnswerSourcesBuilder(int index) {
return getAnswerSourcesFieldBuilder()
.addBuilder(
index,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource
.getDefaultInstance());
}
/**
*
*
*
* All sources used to generate the answer.
*
*
*
* repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3;
*
*/
public java.util.List
getAnswerSourcesBuilderList() {
return getAnswerSourcesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSourceOrBuilder>
getAnswerSourcesFieldBuilder() {
if (answerSourcesBuilder_ == null) {
answerSourcesBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource.Builder,
com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSourceOrBuilder>(
answerSources_,
((bitField0_ & 0x00000004) != 0),
getParentForChildren(),
isClean());
answerSources_ = null;
}
return answerSourcesBuilder_;
}
private java.lang.Object answerRecord_ = "";
/**
*
*
*
* The name of the answer record.
* Format: `projects/<Project ID>/locations/<location ID>/answer
* Records/<Answer Record ID>`
*
*
* string answer_record = 5;
*
* @return The answerRecord.
*/
public java.lang.String getAnswerRecord() {
java.lang.Object ref = answerRecord_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
answerRecord_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The name of the answer record.
* Format: `projects/<Project ID>/locations/<location ID>/answer
* Records/<Answer Record ID>`
*
*
* string answer_record = 5;
*
* @return The bytes for answerRecord.
*/
public com.google.protobuf.ByteString getAnswerRecordBytes() {
java.lang.Object ref = answerRecord_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
answerRecord_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The name of the answer record.
* Format: `projects/<Project ID>/locations/<location ID>/answer
* Records/<Answer Record ID>`
*
*
* string answer_record = 5;
*
* @param value The answerRecord to set.
* @return This builder for chaining.
*/
public Builder setAnswerRecord(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
answerRecord_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* The name of the answer record.
* Format: `projects/<Project ID>/locations/<location ID>/answer
* Records/<Answer Record ID>`
*
*
* string answer_record = 5;
*
* @return This builder for chaining.
*/
public Builder clearAnswerRecord() {
answerRecord_ = getDefaultInstance().getAnswerRecord();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
*
*
* The name of the answer record.
* Format: `projects/<Project ID>/locations/<location ID>/answer
* Records/<Answer Record ID>`
*
*
* string answer_record = 5;
*
* @param value The bytes for answerRecord to set.
* @return This builder for chaining.
*/
public Builder setAnswerRecordBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
answerRecord_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.SearchKnowledgeAnswer)
}
// @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.SearchKnowledgeAnswer)
private static final com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer();
}
public static com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public SearchKnowledgeAnswer parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.SearchKnowledgeAnswer getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy