All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer Maven / Gradle / Ivy

There is a newer version: 4.59.0
Show newest version
/*
 * 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/participant.proto

// Protobuf Java Version: 3.25.4
package com.google.cloud.dialogflow.v2;

/**
 *
 *
 * 
 * Represents a Knowledge Assist answer.
 * 
* * Protobuf type {@code google.cloud.dialogflow.v2.KnowledgeAssistAnswer} */ public final class KnowledgeAssistAnswer extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer) KnowledgeAssistAnswerOrBuilder { private static final long serialVersionUID = 0L; // Use KnowledgeAssistAnswer.newBuilder() to construct. private KnowledgeAssistAnswer(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private KnowledgeAssistAnswer() { answerRecord_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new KnowledgeAssistAnswer(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.Builder.class); } public interface SuggestedQueryOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery) com.google.protobuf.MessageOrBuilder { /** * * *
     * Suggested query text.
     * 
* * string query_text = 1; * * @return The queryText. */ java.lang.String getQueryText(); /** * * *
     * Suggested query text.
     * 
* * string query_text = 1; * * @return The bytes for queryText. */ com.google.protobuf.ByteString getQueryTextBytes(); } /** * * *
   * Represents a suggested query.
   * 
* * Protobuf type {@code google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery} */ public static final class SuggestedQuery extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery) SuggestedQueryOrBuilder { private static final long serialVersionUID = 0L; // Use SuggestedQuery.newBuilder() to construct. private SuggestedQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private SuggestedQuery() { queryText_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new SuggestedQuery(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_SuggestedQuery_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_SuggestedQuery_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.Builder.class); } public static final int QUERY_TEXT_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object queryText_ = ""; /** * * *
     * Suggested query text.
     * 
* * string query_text = 1; * * @return The queryText. */ @java.lang.Override public java.lang.String getQueryText() { java.lang.Object ref = queryText_; 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(); queryText_ = s; return s; } } /** * * *
     * Suggested query text.
     * 
* * string query_text = 1; * * @return The bytes for queryText. */ @java.lang.Override public com.google.protobuf.ByteString getQueryTextBytes() { java.lang.Object ref = queryText_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); queryText_ = 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(queryText_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, queryText_); } 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(queryText_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, queryText_); } 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.KnowledgeAssistAnswer.SuggestedQuery)) { return super.equals(obj); } com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery other = (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery) obj; if (!getQueryText().equals(other.getQueryText())) 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) + QUERY_TEXT_FIELD_NUMBER; hash = (53 * hash) + getQueryText().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery 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.KnowledgeAssistAnswer.SuggestedQuery parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery 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.KnowledgeAssistAnswer.SuggestedQuery parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery 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.KnowledgeAssistAnswer.SuggestedQuery parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery 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.KnowledgeAssistAnswer.SuggestedQuery parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery 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.KnowledgeAssistAnswer.SuggestedQuery 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.KnowledgeAssistAnswer.SuggestedQuery 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.KnowledgeAssistAnswer.SuggestedQuery 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 suggested query.
     * 
* * Protobuf type {@code google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery) com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_SuggestedQuery_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_SuggestedQuery_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.Builder.class); } // Construct using // com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; queryText_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_SuggestedQuery_descriptor; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery getDefaultInstanceForType() { return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery .getDefaultInstance(); } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery build() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery buildPartial() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery result = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.queryText_ = queryText_; } } @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.KnowledgeAssistAnswer.SuggestedQuery) { return mergeFrom( (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery other) { if (other == com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery .getDefaultInstance()) return this; if (!other.getQueryText().isEmpty()) { queryText_ = other.queryText_; bitField0_ |= 0x00000001; 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: { queryText_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 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 queryText_ = ""; /** * * *
       * Suggested query text.
       * 
* * string query_text = 1; * * @return The queryText. */ public java.lang.String getQueryText() { java.lang.Object ref = queryText_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); queryText_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
       * Suggested query text.
       * 
* * string query_text = 1; * * @return The bytes for queryText. */ public com.google.protobuf.ByteString getQueryTextBytes() { java.lang.Object ref = queryText_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); queryText_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
       * Suggested query text.
       * 
* * string query_text = 1; * * @param value The queryText to set. * @return This builder for chaining. */ public Builder setQueryText(java.lang.String value) { if (value == null) { throw new NullPointerException(); } queryText_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
       * Suggested query text.
       * 
* * string query_text = 1; * * @return This builder for chaining. */ public Builder clearQueryText() { queryText_ = getDefaultInstance().getQueryText(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
       * Suggested query text.
       * 
* * string query_text = 1; * * @param value The bytes for queryText to set. * @return This builder for chaining. */ public Builder setQueryTextBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); queryText_ = value; bitField0_ |= 0x00000001; 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.KnowledgeAssistAnswer.SuggestedQuery) } // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery) private static final com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery(); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public SuggestedQuery 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.KnowledgeAssistAnswer.SuggestedQuery getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface KnowledgeAnswerOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer) com.google.protobuf.MessageOrBuilder { /** * * *
     * The piece of text from the `source` that answers this suggested query.
     * 
* * string answer_text = 1; * * @return The answerText. */ java.lang.String getAnswerText(); /** * * *
     * The piece of text from the `source` that answers this suggested query.
     * 
* * string answer_text = 1; * * @return The bytes for answerText. */ com.google.protobuf.ByteString getAnswerTextBytes(); /** * * *
     * Populated if the prediction came from FAQ.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * * * @return Whether the faqSource field is set. */ boolean hasFaqSource(); /** * * *
     * Populated if the prediction came from FAQ.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * * * @return The faqSource. */ com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource getFaqSource(); /** * * *
     * Populated if the prediction came from FAQ.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * */ com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceOrBuilder getFaqSourceOrBuilder(); /** * * *
     * Populated if the prediction was Generative.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * * * @return Whether the generativeSource field is set. */ boolean hasGenerativeSource(); /** * * *
     * Populated if the prediction was Generative.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * * * @return The generativeSource. */ com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource getGenerativeSource(); /** * * *
     * Populated if the prediction was Generative.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * */ com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceOrBuilder getGenerativeSourceOrBuilder(); com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.SourceCase getSourceCase(); } /** * * *
   * Represents an answer from Knowledge. Currently supports FAQ and Generative
   * answers.
   * 
* * Protobuf type {@code google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer} */ public static final class KnowledgeAnswer extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer) KnowledgeAnswerOrBuilder { private static final long serialVersionUID = 0L; // Use KnowledgeAnswer.newBuilder() to construct. private KnowledgeAnswer(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private KnowledgeAnswer() { answerText_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new KnowledgeAnswer(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.Builder.class); } public interface FaqSourceOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) com.google.protobuf.MessageOrBuilder { /** * * *
       * The corresponding FAQ question.
       * 
* * string question = 2; * * @return The question. */ java.lang.String getQuestion(); /** * * *
       * The corresponding FAQ question.
       * 
* * string question = 2; * * @return The bytes for question. */ com.google.protobuf.ByteString getQuestionBytes(); } /** * * *
     * Details about source of FAQ answer.
     * 
* * Protobuf type {@code * google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource} */ public static final class FaqSource extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) FaqSourceOrBuilder { private static final long serialVersionUID = 0L; // Use FaqSource.newBuilder() to construct. private FaqSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private FaqSource() { question_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new FaqSource(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_FaqSource_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_FaqSource_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .Builder.class); } public static final int QUESTION_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object question_ = ""; /** * * *
       * The corresponding FAQ question.
       * 
* * string question = 2; * * @return The question. */ @java.lang.Override public java.lang.String getQuestion() { java.lang.Object ref = question_; 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(); question_ = s; return s; } } /** * * *
       * The corresponding FAQ question.
       * 
* * string question = 2; * * @return The bytes for question. */ @java.lang.Override public com.google.protobuf.ByteString getQuestionBytes() { java.lang.Object ref = question_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); question_ = 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(question_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, question_); } 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(question_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, question_); } 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource)) { return super.equals(obj); } com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource other = (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) obj; if (!getQuestion().equals(other.getQuestion())) 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) + QUESTION_FIELD_NUMBER; hash = (53 * hash) + getQuestion().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource 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; } /** * * *
       * Details about source of FAQ answer.
       * 
* * Protobuf type {@code * google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_FaqSource_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_FaqSource_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .Builder.class); } // Construct using // com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; question_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_FaqSource_descriptor; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource getDefaultInstanceForType() { return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .getDefaultInstance(); } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource build() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource buildPartial() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource result = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource( this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.question_ = question_; } } @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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) { return mergeFrom( (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource other) { if (other == com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .getDefaultInstance()) return this; if (!other.getQuestion().isEmpty()) { question_ = other.question_; bitField0_ |= 0x00000001; 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 18: { question_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 18 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 question_ = ""; /** * * *
         * The corresponding FAQ question.
         * 
* * string question = 2; * * @return The question. */ public java.lang.String getQuestion() { java.lang.Object ref = question_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); question_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
         * The corresponding FAQ question.
         * 
* * string question = 2; * * @return The bytes for question. */ public com.google.protobuf.ByteString getQuestionBytes() { java.lang.Object ref = question_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); question_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
         * The corresponding FAQ question.
         * 
* * string question = 2; * * @param value The question to set. * @return This builder for chaining. */ public Builder setQuestion(java.lang.String value) { if (value == null) { throw new NullPointerException(); } question_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
         * The corresponding FAQ question.
         * 
* * string question = 2; * * @return This builder for chaining. */ public Builder clearQuestion() { question_ = getDefaultInstance().getQuestion(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
         * The corresponding FAQ question.
         * 
* * string question = 2; * * @param value The bytes for question to set. * @return This builder for chaining. */ public Builder setQuestionBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); question_ = value; bitField0_ |= 0x00000001; 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) } // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) private static final com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .FaqSource DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource(); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public FaqSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface GenerativeSourceOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource) com.google.protobuf.MessageOrBuilder { /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ java.util.List< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet> getSnippetsList(); /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet getSnippets(int index); /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ int getSnippetsCount(); /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ java.util.List< ? extends com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.SnippetOrBuilder> getSnippetsOrBuilderList(); /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .SnippetOrBuilder getSnippetsOrBuilder(int index); } /** * * *
     * Details about source of Generative answer.
     * 
* * Protobuf type {@code * google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource} */ public static final class GenerativeSource extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource) GenerativeSourceOrBuilder { private static final long serialVersionUID = 0L; // Use GenerativeSource.newBuilder() to construct. private GenerativeSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private GenerativeSource() { snippets_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new GenerativeSource(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Builder.class); } public interface SnippetOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet) com.google.protobuf.MessageOrBuilder { /** * * *
         * URI the data is sourced from.
         * 
* * string uri = 2; * * @return The uri. */ java.lang.String getUri(); /** * * *
         * URI the data is sourced from.
         * 
* * string uri = 2; * * @return The bytes for uri. */ com.google.protobuf.ByteString getUriBytes(); /** * * *
         * Text taken from that URI.
         * 
* * string text = 3; * * @return The text. */ java.lang.String getText(); /** * * *
         * Text taken from that URI.
         * 
* * string text = 3; * * @return The bytes for text. */ com.google.protobuf.ByteString getTextBytes(); /** * * *
         * Title of the document.
         * 
* * string title = 4; * * @return The title. */ java.lang.String getTitle(); /** * * *
         * Title of the document.
         * 
* * string title = 4; * * @return The bytes for title. */ com.google.protobuf.ByteString getTitleBytes(); } /** * * *
       * Snippet Source for a Generative Prediction.
       * 
* * Protobuf type {@code * google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet} */ public static final class Snippet extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet) SnippetOrBuilder { private static final long serialVersionUID = 0L; // Use Snippet.newBuilder() to construct. private Snippet(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Snippet() { uri_ = ""; text_ = ""; title_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new Snippet(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_Snippet_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_Snippet_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.Builder.class); } public static final int URI_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object uri_ = ""; /** * * *
         * URI the data is sourced from.
         * 
* * 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; } } /** * * *
         * URI the data is sourced from.
         * 
* * 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 TEXT_FIELD_NUMBER = 3; @SuppressWarnings("serial") private volatile java.lang.Object text_ = ""; /** * * *
         * Text taken from that URI.
         * 
* * string text = 3; * * @return The text. */ @java.lang.Override public java.lang.String getText() { java.lang.Object ref = text_; 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(); text_ = s; return s; } } /** * * *
         * Text taken from that URI.
         * 
* * string text = 3; * * @return The bytes for text. */ @java.lang.Override public com.google.protobuf.ByteString getTextBytes() { java.lang.Object ref = text_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); text_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int TITLE_FIELD_NUMBER = 4; @SuppressWarnings("serial") private volatile java.lang.Object title_ = ""; /** * * *
         * Title of the document.
         * 
* * string title = 4; * * @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; } } /** * * *
         * Title of the document.
         * 
* * string title = 4; * * @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; } } 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(uri_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uri_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, text_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, title_); } 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(uri_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uri_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, text_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, title_); } 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.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet)) { return super.equals(obj); } com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet other = (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet) obj; if (!getUri().equals(other.getUri())) return false; if (!getText().equals(other.getText())) return false; if (!getTitle().equals(other.getTitle())) 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) + URI_FIELD_NUMBER; hash = (53 * hash) + getUri().hashCode(); hash = (37 * hash) + TEXT_FIELD_NUMBER; hash = (53 * hash) + getText().hashCode(); hash = (37 * hash) + TITLE_FIELD_NUMBER; hash = (53 * hash) + getTitle().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet 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.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet 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; } /** * * *
         * Snippet Source for a Generative Prediction.
         * 
* * Protobuf type {@code * google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet) com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .SnippetOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_Snippet_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_Snippet_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.Builder.class); } // Construct using // com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; uri_ = ""; text_ = ""; title_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_Snippet_descriptor; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet getDefaultInstanceForType() { return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.getDefaultInstance(); } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet build() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet buildPartial() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet result = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.uri_ = uri_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.text_ = text_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.title_ = title_; } } @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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet) { return mergeFrom( (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet other) { if (other == com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.getDefaultInstance()) return this; if (!other.getUri().isEmpty()) { uri_ = other.uri_; bitField0_ |= 0x00000001; onChanged(); } if (!other.getText().isEmpty()) { text_ = other.text_; bitField0_ |= 0x00000002; onChanged(); } if (!other.getTitle().isEmpty()) { title_ = other.title_; 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 18: { uri_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 18 case 26: { text_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 26 case 34: { title_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000004; break; } // case 34 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 uri_ = ""; /** * * *
           * URI the data is sourced from.
           * 
* * 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; } } /** * * *
           * URI the data is sourced from.
           * 
* * 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; } } /** * * *
           * URI the data is sourced from.
           * 
* * 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_ |= 0x00000001; onChanged(); return this; } /** * * *
           * URI the data is sourced from.
           * 
* * string uri = 2; * * @return This builder for chaining. */ public Builder clearUri() { uri_ = getDefaultInstance().getUri(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
           * URI the data is sourced from.
           * 
* * 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_ |= 0x00000001; onChanged(); return this; } private java.lang.Object text_ = ""; /** * * *
           * Text taken from that URI.
           * 
* * string text = 3; * * @return The text. */ public java.lang.String getText() { java.lang.Object ref = text_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); text_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
           * Text taken from that URI.
           * 
* * string text = 3; * * @return The bytes for text. */ public com.google.protobuf.ByteString getTextBytes() { java.lang.Object ref = text_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); text_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
           * Text taken from that URI.
           * 
* * string text = 3; * * @param value The text to set. * @return This builder for chaining. */ public Builder setText(java.lang.String value) { if (value == null) { throw new NullPointerException(); } text_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
           * Text taken from that URI.
           * 
* * string text = 3; * * @return This builder for chaining. */ public Builder clearText() { text_ = getDefaultInstance().getText(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * * *
           * Text taken from that URI.
           * 
* * string text = 3; * * @param value The bytes for text to set. * @return This builder for chaining. */ public Builder setTextBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); text_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object title_ = ""; /** * * *
           * Title of the document.
           * 
* * string title = 4; * * @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; } } /** * * *
           * Title of the document.
           * 
* * string title = 4; * * @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; } } /** * * *
           * Title of the document.
           * 
* * string title = 4; * * @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_ |= 0x00000004; onChanged(); return this; } /** * * *
           * Title of the document.
           * 
* * string title = 4; * * @return This builder for chaining. */ public Builder clearTitle() { title_ = getDefaultInstance().getTitle(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** * * *
           * Title of the document.
           * 
* * string title = 4; * * @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_ |= 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.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet) } // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet) private static final com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet(); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Snippet 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.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public static final int SNIPPETS_FIELD_NUMBER = 1; @SuppressWarnings("serial") private java.util.List< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet> snippets_; /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ @java.lang.Override public java.util.List< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet> getSnippetsList() { return snippets_; } /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ @java.lang.Override public java.util.List< ? extends com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.SnippetOrBuilder> getSnippetsOrBuilderList() { return snippets_; } /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ @java.lang.Override public int getSnippetsCount() { return snippets_.size(); } /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet getSnippets(int index) { return snippets_.get(index); } /** * * *
       * All snippets used for this Generative Prediction, with their source URI
       * and data.
       * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .SnippetOrBuilder getSnippetsOrBuilder(int index) { return snippets_.get(index); } 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 { for (int i = 0; i < snippets_.size(); i++) { output.writeMessage(1, snippets_.get(i)); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < snippets_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, snippets_.get(i)); } 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource)) { return super.equals(obj); } com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource other = (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) obj; if (!getSnippetsList().equals(other.getSnippetsList())) 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(); if (getSnippetsCount() > 0) { hash = (37 * hash) + SNIPPETS_FIELD_NUMBER; hash = (53 * hash) + getSnippetsList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource 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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource 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; } /** * * *
       * Details about source of Generative answer.
       * 
* * Protobuf type {@code * google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource) com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSourceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Builder.class); } // Construct using // com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; if (snippetsBuilder_ == null) { snippets_ = java.util.Collections.emptyList(); } else { snippets_ = null; snippetsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_descriptor; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource getDefaultInstanceForType() { return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.getDefaultInstance(); } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource build() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource buildPartial() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource result = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartialRepeatedFields( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource result) { if (snippetsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { snippets_ = java.util.Collections.unmodifiableList(snippets_); bitField0_ = (bitField0_ & ~0x00000001); } result.snippets_ = snippets_; } else { result.snippets_ = snippetsBuilder_.build(); } } private void buildPartial0( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource result) { int from_bitField0_ = bitField0_; } @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.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) { return mergeFrom( (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource other) { if (other == com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.getDefaultInstance()) return this; if (snippetsBuilder_ == null) { if (!other.snippets_.isEmpty()) { if (snippets_.isEmpty()) { snippets_ = other.snippets_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureSnippetsIsMutable(); snippets_.addAll(other.snippets_); } onChanged(); } } else { if (!other.snippets_.isEmpty()) { if (snippetsBuilder_.isEmpty()) { snippetsBuilder_.dispose(); snippetsBuilder_ = null; snippets_ = other.snippets_; bitField0_ = (bitField0_ & ~0x00000001); snippetsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getSnippetsFieldBuilder() : null; } else { snippetsBuilder_.addAllMessages(other.snippets_); } } } 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: { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet m = input.readMessage( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.parser(), extensionRegistry); if (snippetsBuilder_ == null) { ensureSnippetsIsMutable(); snippets_.add(m); } else { snippetsBuilder_.addMessage(m); } break; } // case 10 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.util.List< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet> snippets_ = java.util.Collections.emptyList(); private void ensureSnippetsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { snippets_ = new java.util.ArrayList< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet>(snippets_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.SnippetOrBuilder> snippetsBuilder_; /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public java.util.List< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet> getSnippetsList() { if (snippetsBuilder_ == null) { return java.util.Collections.unmodifiableList(snippets_); } else { return snippetsBuilder_.getMessageList(); } } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public int getSnippetsCount() { if (snippetsBuilder_ == null) { return snippets_.size(); } else { return snippetsBuilder_.getCount(); } } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet getSnippets(int index) { if (snippetsBuilder_ == null) { return snippets_.get(index); } else { return snippetsBuilder_.getMessage(index); } } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public Builder setSnippets( int index, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet value) { if (snippetsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSnippetsIsMutable(); snippets_.set(index, value); onChanged(); } else { snippetsBuilder_.setMessage(index, value); } return this; } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public Builder setSnippets( int index, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet.Builder builderForValue) { if (snippetsBuilder_ == null) { ensureSnippetsIsMutable(); snippets_.set(index, builderForValue.build()); onChanged(); } else { snippetsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public Builder addSnippets( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet value) { if (snippetsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSnippetsIsMutable(); snippets_.add(value); onChanged(); } else { snippetsBuilder_.addMessage(value); } return this; } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public Builder addSnippets( int index, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet value) { if (snippetsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSnippetsIsMutable(); snippets_.add(index, value); onChanged(); } else { snippetsBuilder_.addMessage(index, value); } return this; } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public Builder addSnippets( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet.Builder builderForValue) { if (snippetsBuilder_ == null) { ensureSnippetsIsMutable(); snippets_.add(builderForValue.build()); onChanged(); } else { snippetsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public Builder addSnippets( int index, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet.Builder builderForValue) { if (snippetsBuilder_ == null) { ensureSnippetsIsMutable(); snippets_.add(index, builderForValue.build()); onChanged(); } else { snippetsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public Builder addAllSnippets( java.lang.Iterable< ? extends com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet> values) { if (snippetsBuilder_ == null) { ensureSnippetsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, snippets_); onChanged(); } else { snippetsBuilder_.addAllMessages(values); } return this; } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public Builder clearSnippets() { if (snippetsBuilder_ == null) { snippets_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { snippetsBuilder_.clear(); } return this; } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public Builder removeSnippets(int index) { if (snippetsBuilder_ == null) { ensureSnippetsIsMutable(); snippets_.remove(index); onChanged(); } else { snippetsBuilder_.remove(index); } return this; } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet.Builder getSnippetsBuilder(int index) { return getSnippetsFieldBuilder().getBuilder(index); } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .SnippetOrBuilder getSnippetsOrBuilder(int index) { if (snippetsBuilder_ == null) { return snippets_.get(index); } else { return snippetsBuilder_.getMessageOrBuilder(index); } } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public java.util.List< ? extends com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.SnippetOrBuilder> getSnippetsOrBuilderList() { if (snippetsBuilder_ != null) { return snippetsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(snippets_); } } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet.Builder addSnippetsBuilder() { return getSnippetsFieldBuilder() .addBuilder( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.getDefaultInstance()); } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Snippet.Builder addSnippetsBuilder(int index) { return getSnippetsFieldBuilder() .addBuilder( index, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.getDefaultInstance()); } /** * * *
         * All snippets used for this Generative Prediction, with their source URI
         * and data.
         * 
* * * repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; * */ public java.util.List< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.Builder> getSnippetsBuilderList() { return getSnippetsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.SnippetOrBuilder> getSnippetsFieldBuilder() { if (snippetsBuilder_ == null) { snippetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Snippet.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.SnippetOrBuilder>( snippets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); snippets_ = null; } return snippetsBuilder_; } @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.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource) } // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource) private static final com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource(); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public GenerativeSource 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.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private int sourceCase_ = 0; @SuppressWarnings("serial") private java.lang.Object source_; public enum SourceCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { FAQ_SOURCE(3), GENERATIVE_SOURCE(4), SOURCE_NOT_SET(0); private final int value; private SourceCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static SourceCase valueOf(int value) { return forNumber(value); } public static SourceCase forNumber(int value) { switch (value) { case 3: return FAQ_SOURCE; case 4: return GENERATIVE_SOURCE; case 0: return SOURCE_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public SourceCase getSourceCase() { return SourceCase.forNumber(sourceCase_); } public static final int ANSWER_TEXT_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object answerText_ = ""; /** * * *
     * The piece of text from the `source` that answers this suggested query.
     * 
* * string answer_text = 1; * * @return The answerText. */ @java.lang.Override public java.lang.String getAnswerText() { java.lang.Object ref = answerText_; 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(); answerText_ = s; return s; } } /** * * *
     * The piece of text from the `source` that answers this suggested query.
     * 
* * string answer_text = 1; * * @return The bytes for answerText. */ @java.lang.Override public com.google.protobuf.ByteString getAnswerTextBytes() { java.lang.Object ref = answerText_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); answerText_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int FAQ_SOURCE_FIELD_NUMBER = 3; /** * * *
     * Populated if the prediction came from FAQ.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * * * @return Whether the faqSource field is set. */ @java.lang.Override public boolean hasFaqSource() { return sourceCase_ == 3; } /** * * *
     * Populated if the prediction came from FAQ.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * * * @return The faqSource. */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource getFaqSource() { if (sourceCase_ == 3) { return (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) source_; } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .getDefaultInstance(); } /** * * *
     * Populated if the prediction came from FAQ.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceOrBuilder getFaqSourceOrBuilder() { if (sourceCase_ == 3) { return (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) source_; } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .getDefaultInstance(); } public static final int GENERATIVE_SOURCE_FIELD_NUMBER = 4; /** * * *
     * Populated if the prediction was Generative.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * * * @return Whether the generativeSource field is set. */ @java.lang.Override public boolean hasGenerativeSource() { return sourceCase_ == 4; } /** * * *
     * Populated if the prediction was Generative.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * * * @return The generativeSource. */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource getGenerativeSource() { if (sourceCase_ == 4) { return (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) source_; } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .getDefaultInstance(); } /** * * *
     * Populated if the prediction was Generative.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSourceOrBuilder getGenerativeSourceOrBuilder() { if (sourceCase_ == 4) { return (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) source_; } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .getDefaultInstance(); } 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(answerText_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, answerText_); } if (sourceCase_ == 3) { output.writeMessage( 3, (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) source_); } if (sourceCase_ == 4) { output.writeMessage( 4, (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource) source_); } 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(answerText_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, answerText_); } if (sourceCase_ == 3) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 3, (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) source_); } if (sourceCase_ == 4) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 4, (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) source_); } 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.KnowledgeAssistAnswer.KnowledgeAnswer)) { return super.equals(obj); } com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer other = (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer) obj; if (!getAnswerText().equals(other.getAnswerText())) return false; if (!getSourceCase().equals(other.getSourceCase())) return false; switch (sourceCase_) { case 3: if (!getFaqSource().equals(other.getFaqSource())) return false; break; case 4: if (!getGenerativeSource().equals(other.getGenerativeSource())) return false; break; case 0: default: } 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_TEXT_FIELD_NUMBER; hash = (53 * hash) + getAnswerText().hashCode(); switch (sourceCase_) { case 3: hash = (37 * hash) + FAQ_SOURCE_FIELD_NUMBER; hash = (53 * hash) + getFaqSource().hashCode(); break; case 4: hash = (37 * hash) + GENERATIVE_SOURCE_FIELD_NUMBER; hash = (53 * hash) + getGenerativeSource().hashCode(); break; case 0: default: } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer 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.KnowledgeAssistAnswer.KnowledgeAnswer parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer 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.KnowledgeAssistAnswer.KnowledgeAnswer parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer 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.KnowledgeAssistAnswer.KnowledgeAnswer parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer 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.KnowledgeAssistAnswer.KnowledgeAnswer parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer 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.KnowledgeAssistAnswer.KnowledgeAnswer 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.KnowledgeAssistAnswer.KnowledgeAnswer 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.KnowledgeAssistAnswer.KnowledgeAnswer 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 an answer from Knowledge. Currently supports FAQ and Generative
     * answers.
     * 
* * Protobuf type {@code google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer) com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswerOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.Builder.class); } // Construct using // com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; answerText_ = ""; if (faqSourceBuilder_ != null) { faqSourceBuilder_.clear(); } if (generativeSourceBuilder_ != null) { generativeSourceBuilder_.clear(); } sourceCase_ = 0; source_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_KnowledgeAnswer_descriptor; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer getDefaultInstanceForType() { return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .getDefaultInstance(); } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer build() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer buildPartial() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer result = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer(this); if (bitField0_ != 0) { buildPartial0(result); } buildPartialOneofs(result); onBuilt(); return result; } private void buildPartial0( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.answerText_ = answerText_; } } private void buildPartialOneofs( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer result) { result.sourceCase_ = sourceCase_; result.source_ = this.source_; if (sourceCase_ == 3 && faqSourceBuilder_ != null) { result.source_ = faqSourceBuilder_.build(); } if (sourceCase_ == 4 && generativeSourceBuilder_ != null) { result.source_ = generativeSourceBuilder_.build(); } } @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.KnowledgeAssistAnswer.KnowledgeAnswer) { return mergeFrom( (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer other) { if (other == com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .getDefaultInstance()) return this; if (!other.getAnswerText().isEmpty()) { answerText_ = other.answerText_; bitField0_ |= 0x00000001; onChanged(); } switch (other.getSourceCase()) { case FAQ_SOURCE: { mergeFaqSource(other.getFaqSource()); break; } case GENERATIVE_SOURCE: { mergeGenerativeSource(other.getGenerativeSource()); break; } case SOURCE_NOT_SET: { break; } } 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: { answerText_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 26: { input.readMessage(getFaqSourceFieldBuilder().getBuilder(), extensionRegistry); sourceCase_ = 3; break; } // case 26 case 34: { input.readMessage( getGenerativeSourceFieldBuilder().getBuilder(), extensionRegistry); sourceCase_ = 4; break; } // case 34 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 sourceCase_ = 0; private java.lang.Object source_; public SourceCase getSourceCase() { return SourceCase.forNumber(sourceCase_); } public Builder clearSource() { sourceCase_ = 0; source_ = null; onChanged(); return this; } private int bitField0_; private java.lang.Object answerText_ = ""; /** * * *
       * The piece of text from the `source` that answers this suggested query.
       * 
* * string answer_text = 1; * * @return The answerText. */ public java.lang.String getAnswerText() { java.lang.Object ref = answerText_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); answerText_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
       * The piece of text from the `source` that answers this suggested query.
       * 
* * string answer_text = 1; * * @return The bytes for answerText. */ public com.google.protobuf.ByteString getAnswerTextBytes() { java.lang.Object ref = answerText_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); answerText_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
       * The piece of text from the `source` that answers this suggested query.
       * 
* * string answer_text = 1; * * @param value The answerText to set. * @return This builder for chaining. */ public Builder setAnswerText(java.lang.String value) { if (value == null) { throw new NullPointerException(); } answerText_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
       * The piece of text from the `source` that answers this suggested query.
       * 
* * string answer_text = 1; * * @return This builder for chaining. */ public Builder clearAnswerText() { answerText_ = getDefaultInstance().getAnswerText(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
       * The piece of text from the `source` that answers this suggested query.
       * 
* * string answer_text = 1; * * @param value The bytes for answerText to set. * @return This builder for chaining. */ public Builder setAnswerTextBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); answerText_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .FaqSourceOrBuilder> faqSourceBuilder_; /** * * *
       * Populated if the prediction came from FAQ.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * * * @return Whether the faqSource field is set. */ @java.lang.Override public boolean hasFaqSource() { return sourceCase_ == 3; } /** * * *
       * Populated if the prediction came from FAQ.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * * * @return The faqSource. */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource getFaqSource() { if (faqSourceBuilder_ == null) { if (sourceCase_ == 3) { return (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) source_; } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .getDefaultInstance(); } else { if (sourceCase_ == 3) { return faqSourceBuilder_.getMessage(); } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .getDefaultInstance(); } } /** * * *
       * Populated if the prediction came from FAQ.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * */ public Builder setFaqSource( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource value) { if (faqSourceBuilder_ == null) { if (value == null) { throw new NullPointerException(); } source_ = value; onChanged(); } else { faqSourceBuilder_.setMessage(value); } sourceCase_ = 3; return this; } /** * * *
       * Populated if the prediction came from FAQ.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * */ public Builder setFaqSource( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource.Builder builderForValue) { if (faqSourceBuilder_ == null) { source_ = builderForValue.build(); onChanged(); } else { faqSourceBuilder_.setMessage(builderForValue.build()); } sourceCase_ = 3; return this; } /** * * *
       * Populated if the prediction came from FAQ.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * */ public Builder mergeFaqSource( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource value) { if (faqSourceBuilder_ == null) { if (sourceCase_ == 3 && source_ != com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .getDefaultInstance()) { source_ = com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .newBuilder( (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .FaqSource) source_) .mergeFrom(value) .buildPartial(); } else { source_ = value; } onChanged(); } else { if (sourceCase_ == 3) { faqSourceBuilder_.mergeFrom(value); } else { faqSourceBuilder_.setMessage(value); } } sourceCase_ = 3; return this; } /** * * *
       * Populated if the prediction came from FAQ.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * */ public Builder clearFaqSource() { if (faqSourceBuilder_ == null) { if (sourceCase_ == 3) { sourceCase_ = 0; source_ = null; onChanged(); } } else { if (sourceCase_ == 3) { sourceCase_ = 0; source_ = null; } faqSourceBuilder_.clear(); } return this; } /** * * *
       * Populated if the prediction came from FAQ.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource.Builder getFaqSourceBuilder() { return getFaqSourceFieldBuilder().getBuilder(); } /** * * *
       * Populated if the prediction came from FAQ.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceOrBuilder getFaqSourceOrBuilder() { if ((sourceCase_ == 3) && (faqSourceBuilder_ != null)) { return faqSourceBuilder_.getMessageOrBuilder(); } else { if (sourceCase_ == 3) { return (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) source_; } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .getDefaultInstance(); } } /** * * *
       * Populated if the prediction came from FAQ.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .FaqSourceOrBuilder> getFaqSourceFieldBuilder() { if (faqSourceBuilder_ == null) { if (!(sourceCase_ == 3)) { source_ = com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .getDefaultInstance(); } faqSourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource .Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .FaqSourceOrBuilder>( (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource) source_, getParentForChildren(), isClean()); source_ = null; } sourceCase_ = 3; onChanged(); return faqSourceBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSourceOrBuilder> generativeSourceBuilder_; /** * * *
       * Populated if the prediction was Generative.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * * * @return Whether the generativeSource field is set. */ @java.lang.Override public boolean hasGenerativeSource() { return sourceCase_ == 4; } /** * * *
       * Populated if the prediction was Generative.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * * * @return The generativeSource. */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource getGenerativeSource() { if (generativeSourceBuilder_ == null) { if (sourceCase_ == 4) { return (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) source_; } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.getDefaultInstance(); } else { if (sourceCase_ == 4) { return generativeSourceBuilder_.getMessage(); } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.getDefaultInstance(); } } /** * * *
       * Populated if the prediction was Generative.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * */ public Builder setGenerativeSource( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource value) { if (generativeSourceBuilder_ == null) { if (value == null) { throw new NullPointerException(); } source_ = value; onChanged(); } else { generativeSourceBuilder_.setMessage(value); } sourceCase_ = 4; return this; } /** * * *
       * Populated if the prediction was Generative.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * */ public Builder setGenerativeSource( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Builder builderForValue) { if (generativeSourceBuilder_ == null) { source_ = builderForValue.build(); onChanged(); } else { generativeSourceBuilder_.setMessage(builderForValue.build()); } sourceCase_ = 4; return this; } /** * * *
       * Populated if the prediction was Generative.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * */ public Builder mergeGenerativeSource( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource value) { if (generativeSourceBuilder_ == null) { if (sourceCase_ == 4 && source_ != com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.getDefaultInstance()) { source_ = com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.newBuilder( (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) source_) .mergeFrom(value) .buildPartial(); } else { source_ = value; } onChanged(); } else { if (sourceCase_ == 4) { generativeSourceBuilder_.mergeFrom(value); } else { generativeSourceBuilder_.setMessage(value); } } sourceCase_ = 4; return this; } /** * * *
       * Populated if the prediction was Generative.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * */ public Builder clearGenerativeSource() { if (generativeSourceBuilder_ == null) { if (sourceCase_ == 4) { sourceCase_ = 0; source_ = null; onChanged(); } } else { if (sourceCase_ == 4) { sourceCase_ = 0; source_ = null; } generativeSourceBuilder_.clear(); } return this; } /** * * *
       * Populated if the prediction was Generative.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Builder getGenerativeSourceBuilder() { return getGenerativeSourceFieldBuilder().getBuilder(); } /** * * *
       * Populated if the prediction was Generative.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSourceOrBuilder getGenerativeSourceOrBuilder() { if ((sourceCase_ == 4) && (generativeSourceBuilder_ != null)) { return generativeSourceBuilder_.getMessageOrBuilder(); } else { if (sourceCase_ == 4) { return (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) source_; } return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.getDefaultInstance(); } } /** * * *
       * Populated if the prediction was Generative.
       * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource .Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSourceOrBuilder> getGenerativeSourceFieldBuilder() { if (generativeSourceBuilder_ == null) { if (!(sourceCase_ == 4)) { source_ = com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.getDefaultInstance(); } generativeSourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSourceOrBuilder>( (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .GenerativeSource) source_, getParentForChildren(), isClean()); source_ = null; } sourceCase_ = 4; onChanged(); return generativeSourceBuilder_; } @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.KnowledgeAssistAnswer.KnowledgeAnswer) } // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer) private static final com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer(); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public KnowledgeAnswer 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.KnowledgeAssistAnswer.KnowledgeAnswer getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private int bitField0_; public static final int SUGGESTED_QUERY_FIELD_NUMBER = 1; private com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggestedQuery_; /** * * *
   * The query suggested based on the context. Suggestion is made only if it
   * is different from the previous suggestion.
   * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * * * @return Whether the suggestedQuery field is set. */ @java.lang.Override public boolean hasSuggestedQuery() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * The query suggested based on the context. Suggestion is made only if it
   * is different from the previous suggestion.
   * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * * * @return The suggestedQuery. */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery getSuggestedQuery() { return suggestedQuery_ == null ? com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.getDefaultInstance() : suggestedQuery_; } /** * * *
   * The query suggested based on the context. Suggestion is made only if it
   * is different from the previous suggestion.
   * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryOrBuilder getSuggestedQueryOrBuilder() { return suggestedQuery_ == null ? com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.getDefaultInstance() : suggestedQuery_; } public static final int SUGGESTED_QUERY_ANSWER_FIELD_NUMBER = 2; private com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggestedQueryAnswer_; /** * * *
   * The answer generated for the suggested query. Whether or not an answer is
   * generated depends on how confident we are about the generated query.
   * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * * * @return Whether the suggestedQueryAnswer field is set. */ @java.lang.Override public boolean hasSuggestedQueryAnswer() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
   * The answer generated for the suggested query. Whether or not an answer is
   * generated depends on how confident we are about the generated query.
   * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * * * @return The suggestedQueryAnswer. */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer getSuggestedQueryAnswer() { return suggestedQueryAnswer_ == null ? com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.getDefaultInstance() : suggestedQueryAnswer_; } /** * * *
   * The answer generated for the suggested query. Whether or not an answer is
   * generated depends on how confident we are about the generated query.
   * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * */ @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswerOrBuilder getSuggestedQueryAnswerOrBuilder() { return suggestedQueryAnswer_ == null ? com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.getDefaultInstance() : suggestedQueryAnswer_; } public static final int ANSWER_RECORD_FIELD_NUMBER = 3; @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 = 3; * * @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 = 3; * * @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 (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getSuggestedQuery()); } if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getSuggestedQueryAnswer()); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(answerRecord_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, answerRecord_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSuggestedQuery()); } if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSuggestedQueryAnswer()); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(answerRecord_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.KnowledgeAssistAnswer)) { return super.equals(obj); } com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer other = (com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer) obj; if (hasSuggestedQuery() != other.hasSuggestedQuery()) return false; if (hasSuggestedQuery()) { if (!getSuggestedQuery().equals(other.getSuggestedQuery())) return false; } if (hasSuggestedQueryAnswer() != other.hasSuggestedQueryAnswer()) return false; if (hasSuggestedQueryAnswer()) { if (!getSuggestedQueryAnswer().equals(other.getSuggestedQueryAnswer())) 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(); if (hasSuggestedQuery()) { hash = (37 * hash) + SUGGESTED_QUERY_FIELD_NUMBER; hash = (53 * hash) + getSuggestedQuery().hashCode(); } if (hasSuggestedQueryAnswer()) { hash = (37 * hash) + SUGGESTED_QUERY_ANSWER_FIELD_NUMBER; hash = (53 * hash) + getSuggestedQueryAnswer().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.KnowledgeAssistAnswer parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer 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.KnowledgeAssistAnswer parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer 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.KnowledgeAssistAnswer parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer 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.KnowledgeAssistAnswer parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer 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.KnowledgeAssistAnswer parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer 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.KnowledgeAssistAnswer 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.KnowledgeAssistAnswer 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.KnowledgeAssistAnswer 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 Knowledge Assist answer.
   * 
* * Protobuf type {@code google.cloud.dialogflow.v2.KnowledgeAssistAnswer} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.KnowledgeAssistAnswer) com.google.cloud.dialogflow.v2.KnowledgeAssistAnswerOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.class, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.Builder.class); } // Construct using com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getSuggestedQueryFieldBuilder(); getSuggestedQueryAnswerFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; suggestedQuery_ = null; if (suggestedQueryBuilder_ != null) { suggestedQueryBuilder_.dispose(); suggestedQueryBuilder_ = null; } suggestedQueryAnswer_ = null; if (suggestedQueryAnswerBuilder_ != null) { suggestedQueryAnswerBuilder_.dispose(); suggestedQueryAnswerBuilder_ = null; } answerRecord_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.dialogflow.v2.ParticipantProto .internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_descriptor; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer getDefaultInstanceForType() { return com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.getDefaultInstance(); } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer build() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer buildPartial() { com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer result = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { result.suggestedQuery_ = suggestedQueryBuilder_ == null ? suggestedQuery_ : suggestedQueryBuilder_.build(); to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000002) != 0)) { result.suggestedQueryAnswer_ = suggestedQueryAnswerBuilder_ == null ? suggestedQueryAnswer_ : suggestedQueryAnswerBuilder_.build(); to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000004) != 0)) { result.answerRecord_ = answerRecord_; } result.bitField0_ |= to_bitField0_; } @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.KnowledgeAssistAnswer) { return mergeFrom((com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer other) { if (other == com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.getDefaultInstance()) return this; if (other.hasSuggestedQuery()) { mergeSuggestedQuery(other.getSuggestedQuery()); } if (other.hasSuggestedQueryAnswer()) { mergeSuggestedQueryAnswer(other.getSuggestedQueryAnswer()); } if (!other.getAnswerRecord().isEmpty()) { answerRecord_ = other.answerRecord_; 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: { input.readMessage(getSuggestedQueryFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000001; break; } // case 10 case 18: { input.readMessage( getSuggestedQueryAnswerFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000002; break; } // case 18 case 26: { answerRecord_ = 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 com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggestedQuery_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryOrBuilder> suggestedQueryBuilder_; /** * * *
     * The query suggested based on the context. Suggestion is made only if it
     * is different from the previous suggestion.
     * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * * * @return Whether the suggestedQuery field is set. */ public boolean hasSuggestedQuery() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
     * The query suggested based on the context. Suggestion is made only if it
     * is different from the previous suggestion.
     * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * * * @return The suggestedQuery. */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery getSuggestedQuery() { if (suggestedQueryBuilder_ == null) { return suggestedQuery_ == null ? com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery .getDefaultInstance() : suggestedQuery_; } else { return suggestedQueryBuilder_.getMessage(); } } /** * * *
     * The query suggested based on the context. Suggestion is made only if it
     * is different from the previous suggestion.
     * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * */ public Builder setSuggestedQuery( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery value) { if (suggestedQueryBuilder_ == null) { if (value == null) { throw new NullPointerException(); } suggestedQuery_ = value; } else { suggestedQueryBuilder_.setMessage(value); } bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * The query suggested based on the context. Suggestion is made only if it
     * is different from the previous suggestion.
     * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * */ public Builder setSuggestedQuery( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.Builder builderForValue) { if (suggestedQueryBuilder_ == null) { suggestedQuery_ = builderForValue.build(); } else { suggestedQueryBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * The query suggested based on the context. Suggestion is made only if it
     * is different from the previous suggestion.
     * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * */ public Builder mergeSuggestedQuery( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery value) { if (suggestedQueryBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0) && suggestedQuery_ != null && suggestedQuery_ != com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery .getDefaultInstance()) { getSuggestedQueryBuilder().mergeFrom(value); } else { suggestedQuery_ = value; } } else { suggestedQueryBuilder_.mergeFrom(value); } if (suggestedQuery_ != null) { bitField0_ |= 0x00000001; onChanged(); } return this; } /** * * *
     * The query suggested based on the context. Suggestion is made only if it
     * is different from the previous suggestion.
     * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * */ public Builder clearSuggestedQuery() { bitField0_ = (bitField0_ & ~0x00000001); suggestedQuery_ = null; if (suggestedQueryBuilder_ != null) { suggestedQueryBuilder_.dispose(); suggestedQueryBuilder_ = null; } onChanged(); return this; } /** * * *
     * The query suggested based on the context. Suggestion is made only if it
     * is different from the previous suggestion.
     * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.Builder getSuggestedQueryBuilder() { bitField0_ |= 0x00000001; onChanged(); return getSuggestedQueryFieldBuilder().getBuilder(); } /** * * *
     * The query suggested based on the context. Suggestion is made only if it
     * is different from the previous suggestion.
     * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryOrBuilder getSuggestedQueryOrBuilder() { if (suggestedQueryBuilder_ != null) { return suggestedQueryBuilder_.getMessageOrBuilder(); } else { return suggestedQuery_ == null ? com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery .getDefaultInstance() : suggestedQuery_; } } /** * * *
     * The query suggested based on the context. Suggestion is made only if it
     * is different from the previous suggestion.
     * 
* * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryOrBuilder> getSuggestedQueryFieldBuilder() { if (suggestedQueryBuilder_ == null) { suggestedQueryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryOrBuilder>( getSuggestedQuery(), getParentForChildren(), isClean()); suggestedQuery_ = null; } return suggestedQueryBuilder_; } private com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggestedQueryAnswer_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswerOrBuilder> suggestedQueryAnswerBuilder_; /** * * *
     * The answer generated for the suggested query. Whether or not an answer is
     * generated depends on how confident we are about the generated query.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * * * @return Whether the suggestedQueryAnswer field is set. */ public boolean hasSuggestedQueryAnswer() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
     * The answer generated for the suggested query. Whether or not an answer is
     * generated depends on how confident we are about the generated query.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * * * @return The suggestedQueryAnswer. */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer getSuggestedQueryAnswer() { if (suggestedQueryAnswerBuilder_ == null) { return suggestedQueryAnswer_ == null ? com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .getDefaultInstance() : suggestedQueryAnswer_; } else { return suggestedQueryAnswerBuilder_.getMessage(); } } /** * * *
     * The answer generated for the suggested query. Whether or not an answer is
     * generated depends on how confident we are about the generated query.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * */ public Builder setSuggestedQueryAnswer( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer value) { if (suggestedQueryAnswerBuilder_ == null) { if (value == null) { throw new NullPointerException(); } suggestedQueryAnswer_ = value; } else { suggestedQueryAnswerBuilder_.setMessage(value); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * The answer generated for the suggested query. Whether or not an answer is
     * generated depends on how confident we are about the generated query.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * */ public Builder setSuggestedQueryAnswer( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.Builder builderForValue) { if (suggestedQueryAnswerBuilder_ == null) { suggestedQueryAnswer_ = builderForValue.build(); } else { suggestedQueryAnswerBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * The answer generated for the suggested query. Whether or not an answer is
     * generated depends on how confident we are about the generated query.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * */ public Builder mergeSuggestedQueryAnswer( com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer value) { if (suggestedQueryAnswerBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0) && suggestedQueryAnswer_ != null && suggestedQueryAnswer_ != com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .getDefaultInstance()) { getSuggestedQueryAnswerBuilder().mergeFrom(value); } else { suggestedQueryAnswer_ = value; } } else { suggestedQueryAnswerBuilder_.mergeFrom(value); } if (suggestedQueryAnswer_ != null) { bitField0_ |= 0x00000002; onChanged(); } return this; } /** * * *
     * The answer generated for the suggested query. Whether or not an answer is
     * generated depends on how confident we are about the generated query.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * */ public Builder clearSuggestedQueryAnswer() { bitField0_ = (bitField0_ & ~0x00000002); suggestedQueryAnswer_ = null; if (suggestedQueryAnswerBuilder_ != null) { suggestedQueryAnswerBuilder_.dispose(); suggestedQueryAnswerBuilder_ = null; } onChanged(); return this; } /** * * *
     * The answer generated for the suggested query. Whether or not an answer is
     * generated depends on how confident we are about the generated query.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.Builder getSuggestedQueryAnswerBuilder() { bitField0_ |= 0x00000002; onChanged(); return getSuggestedQueryAnswerFieldBuilder().getBuilder(); } /** * * *
     * The answer generated for the suggested query. Whether or not an answer is
     * generated depends on how confident we are about the generated query.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * */ public com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswerOrBuilder getSuggestedQueryAnswerOrBuilder() { if (suggestedQueryAnswerBuilder_ != null) { return suggestedQueryAnswerBuilder_.getMessageOrBuilder(); } else { return suggestedQueryAnswer_ == null ? com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer .getDefaultInstance() : suggestedQueryAnswer_; } } /** * * *
     * The answer generated for the suggested query. Whether or not an answer is
     * generated depends on how confident we are about the generated query.
     * 
* * * .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswerOrBuilder> getSuggestedQueryAnswerFieldBuilder() { if (suggestedQueryAnswerBuilder_ == null) { suggestedQueryAnswerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.Builder, com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswerOrBuilder>( getSuggestedQueryAnswer(), getParentForChildren(), isClean()); suggestedQueryAnswer_ = null; } return suggestedQueryAnswerBuilder_; } 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 = 3; * * @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 = 3; * * @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 = 3; * * @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_ |= 0x00000004; onChanged(); return this; } /** * * *
     * The name of the answer record.
     * Format: `projects/<Project ID>/locations/<location ID>/answer
     * Records/<Answer Record ID>`.
     * 
* * string answer_record = 3; * * @return This builder for chaining. */ public Builder clearAnswerRecord() { answerRecord_ = getDefaultInstance().getAnswerRecord(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** * * *
     * The name of the answer record.
     * Format: `projects/<Project ID>/locations/<location ID>/answer
     * Records/<Answer Record ID>`.
     * 
* * string answer_record = 3; * * @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_ |= 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.KnowledgeAssistAnswer) } // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.KnowledgeAssistAnswer) private static final com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer(); } public static com.google.cloud.dialogflow.v2.KnowledgeAssistAnswer getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public KnowledgeAssistAnswer 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.KnowledgeAssistAnswer getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy