1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/dialogflow/v2/audio_config.proto 18 19 package com.google.cloud.dialogflow.v2; 20 21 /** 22 * 23 * 24 * <pre> 25 * Hints for the speech recognizer to help with recognition in a specific 26 * conversation state. 27 * </pre> 28 * 29 * Protobuf type {@code google.cloud.dialogflow.v2.SpeechContext} 30 */ 31 public final class SpeechContext extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.SpeechContext) 34 SpeechContextOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use SpeechContext.newBuilder() to construct. SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 SpeechContext()41 private SpeechContext() { 42 phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new SpeechContext(); 49 } 50 51 @java.lang.Override getUnknownFields()52 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 53 return this.unknownFields; 54 } 55 getDescriptor()56 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 57 return com.google.cloud.dialogflow.v2.AudioConfigProto 58 .internal_static_google_cloud_dialogflow_v2_SpeechContext_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.cloud.dialogflow.v2.AudioConfigProto 65 .internal_static_google_cloud_dialogflow_v2_SpeechContext_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.cloud.dialogflow.v2.SpeechContext.class, 68 com.google.cloud.dialogflow.v2.SpeechContext.Builder.class); 69 } 70 71 public static final int PHRASES_FIELD_NUMBER = 1; 72 73 @SuppressWarnings("serial") 74 private com.google.protobuf.LazyStringList phrases_; 75 /** 76 * 77 * 78 * <pre> 79 * Optional. A list of strings containing words and phrases that the speech 80 * recognizer should recognize with higher likelihood. 81 * This list can be used to: 82 * * improve accuracy for words and phrases you expect the user to say, 83 * e.g. typical commands for your Dialogflow agent 84 * * add additional words to the speech recognizer vocabulary 85 * * ... 86 * See the [Cloud Speech 87 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 88 * limits. 89 * </pre> 90 * 91 * <code>repeated string phrases = 1;</code> 92 * 93 * @return A list containing the phrases. 94 */ getPhrasesList()95 public com.google.protobuf.ProtocolStringList getPhrasesList() { 96 return phrases_; 97 } 98 /** 99 * 100 * 101 * <pre> 102 * Optional. A list of strings containing words and phrases that the speech 103 * recognizer should recognize with higher likelihood. 104 * This list can be used to: 105 * * improve accuracy for words and phrases you expect the user to say, 106 * e.g. typical commands for your Dialogflow agent 107 * * add additional words to the speech recognizer vocabulary 108 * * ... 109 * See the [Cloud Speech 110 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 111 * limits. 112 * </pre> 113 * 114 * <code>repeated string phrases = 1;</code> 115 * 116 * @return The count of phrases. 117 */ getPhrasesCount()118 public int getPhrasesCount() { 119 return phrases_.size(); 120 } 121 /** 122 * 123 * 124 * <pre> 125 * Optional. A list of strings containing words and phrases that the speech 126 * recognizer should recognize with higher likelihood. 127 * This list can be used to: 128 * * improve accuracy for words and phrases you expect the user to say, 129 * e.g. typical commands for your Dialogflow agent 130 * * add additional words to the speech recognizer vocabulary 131 * * ... 132 * See the [Cloud Speech 133 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 134 * limits. 135 * </pre> 136 * 137 * <code>repeated string phrases = 1;</code> 138 * 139 * @param index The index of the element to return. 140 * @return The phrases at the given index. 141 */ getPhrases(int index)142 public java.lang.String getPhrases(int index) { 143 return phrases_.get(index); 144 } 145 /** 146 * 147 * 148 * <pre> 149 * Optional. A list of strings containing words and phrases that the speech 150 * recognizer should recognize with higher likelihood. 151 * This list can be used to: 152 * * improve accuracy for words and phrases you expect the user to say, 153 * e.g. typical commands for your Dialogflow agent 154 * * add additional words to the speech recognizer vocabulary 155 * * ... 156 * See the [Cloud Speech 157 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 158 * limits. 159 * </pre> 160 * 161 * <code>repeated string phrases = 1;</code> 162 * 163 * @param index The index of the value to return. 164 * @return The bytes of the phrases at the given index. 165 */ getPhrasesBytes(int index)166 public com.google.protobuf.ByteString getPhrasesBytes(int index) { 167 return phrases_.getByteString(index); 168 } 169 170 public static final int BOOST_FIELD_NUMBER = 2; 171 private float boost_ = 0F; 172 /** 173 * 174 * 175 * <pre> 176 * Optional. Boost for this context compared to other contexts: 177 * * If the boost is positive, Dialogflow will increase the probability that 178 * the phrases in this context are recognized over similar sounding phrases. 179 * * If the boost is unspecified or non-positive, Dialogflow will not apply 180 * any boost. 181 * Dialogflow recommends that you use boosts in the range (0, 20] and that you 182 * find a value that fits your use case with binary search. 183 * </pre> 184 * 185 * <code>float boost = 2;</code> 186 * 187 * @return The boost. 188 */ 189 @java.lang.Override getBoost()190 public float getBoost() { 191 return boost_; 192 } 193 194 private byte memoizedIsInitialized = -1; 195 196 @java.lang.Override isInitialized()197 public final boolean isInitialized() { 198 byte isInitialized = memoizedIsInitialized; 199 if (isInitialized == 1) return true; 200 if (isInitialized == 0) return false; 201 202 memoizedIsInitialized = 1; 203 return true; 204 } 205 206 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)207 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 208 for (int i = 0; i < phrases_.size(); i++) { 209 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, phrases_.getRaw(i)); 210 } 211 if (java.lang.Float.floatToRawIntBits(boost_) != 0) { 212 output.writeFloat(2, boost_); 213 } 214 getUnknownFields().writeTo(output); 215 } 216 217 @java.lang.Override getSerializedSize()218 public int getSerializedSize() { 219 int size = memoizedSize; 220 if (size != -1) return size; 221 222 size = 0; 223 { 224 int dataSize = 0; 225 for (int i = 0; i < phrases_.size(); i++) { 226 dataSize += computeStringSizeNoTag(phrases_.getRaw(i)); 227 } 228 size += dataSize; 229 size += 1 * getPhrasesList().size(); 230 } 231 if (java.lang.Float.floatToRawIntBits(boost_) != 0) { 232 size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, boost_); 233 } 234 size += getUnknownFields().getSerializedSize(); 235 memoizedSize = size; 236 return size; 237 } 238 239 @java.lang.Override equals(final java.lang.Object obj)240 public boolean equals(final java.lang.Object obj) { 241 if (obj == this) { 242 return true; 243 } 244 if (!(obj instanceof com.google.cloud.dialogflow.v2.SpeechContext)) { 245 return super.equals(obj); 246 } 247 com.google.cloud.dialogflow.v2.SpeechContext other = 248 (com.google.cloud.dialogflow.v2.SpeechContext) obj; 249 250 if (!getPhrasesList().equals(other.getPhrasesList())) return false; 251 if (java.lang.Float.floatToIntBits(getBoost()) 252 != java.lang.Float.floatToIntBits(other.getBoost())) return false; 253 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 254 return true; 255 } 256 257 @java.lang.Override hashCode()258 public int hashCode() { 259 if (memoizedHashCode != 0) { 260 return memoizedHashCode; 261 } 262 int hash = 41; 263 hash = (19 * hash) + getDescriptor().hashCode(); 264 if (getPhrasesCount() > 0) { 265 hash = (37 * hash) + PHRASES_FIELD_NUMBER; 266 hash = (53 * hash) + getPhrasesList().hashCode(); 267 } 268 hash = (37 * hash) + BOOST_FIELD_NUMBER; 269 hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); 270 hash = (29 * hash) + getUnknownFields().hashCode(); 271 memoizedHashCode = hash; 272 return hash; 273 } 274 parseFrom(java.nio.ByteBuffer data)275 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom(java.nio.ByteBuffer data) 276 throws com.google.protobuf.InvalidProtocolBufferException { 277 return PARSER.parseFrom(data); 278 } 279 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)280 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom( 281 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 282 throws com.google.protobuf.InvalidProtocolBufferException { 283 return PARSER.parseFrom(data, extensionRegistry); 284 } 285 parseFrom( com.google.protobuf.ByteString data)286 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom( 287 com.google.protobuf.ByteString data) 288 throws com.google.protobuf.InvalidProtocolBufferException { 289 return PARSER.parseFrom(data); 290 } 291 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)292 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom( 293 com.google.protobuf.ByteString data, 294 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 295 throws com.google.protobuf.InvalidProtocolBufferException { 296 return PARSER.parseFrom(data, extensionRegistry); 297 } 298 parseFrom(byte[] data)299 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom(byte[] data) 300 throws com.google.protobuf.InvalidProtocolBufferException { 301 return PARSER.parseFrom(data); 302 } 303 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)304 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom( 305 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 306 throws com.google.protobuf.InvalidProtocolBufferException { 307 return PARSER.parseFrom(data, extensionRegistry); 308 } 309 parseFrom(java.io.InputStream input)310 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom(java.io.InputStream input) 311 throws java.io.IOException { 312 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 313 } 314 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)315 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom( 316 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 317 throws java.io.IOException { 318 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 319 PARSER, input, extensionRegistry); 320 } 321 parseDelimitedFrom( java.io.InputStream input)322 public static com.google.cloud.dialogflow.v2.SpeechContext parseDelimitedFrom( 323 java.io.InputStream input) throws java.io.IOException { 324 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 325 } 326 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)327 public static com.google.cloud.dialogflow.v2.SpeechContext parseDelimitedFrom( 328 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 329 throws java.io.IOException { 330 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 331 PARSER, input, extensionRegistry); 332 } 333 parseFrom( com.google.protobuf.CodedInputStream input)334 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom( 335 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 336 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 337 } 338 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)339 public static com.google.cloud.dialogflow.v2.SpeechContext parseFrom( 340 com.google.protobuf.CodedInputStream input, 341 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 342 throws java.io.IOException { 343 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 344 PARSER, input, extensionRegistry); 345 } 346 347 @java.lang.Override newBuilderForType()348 public Builder newBuilderForType() { 349 return newBuilder(); 350 } 351 newBuilder()352 public static Builder newBuilder() { 353 return DEFAULT_INSTANCE.toBuilder(); 354 } 355 newBuilder(com.google.cloud.dialogflow.v2.SpeechContext prototype)356 public static Builder newBuilder(com.google.cloud.dialogflow.v2.SpeechContext prototype) { 357 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 358 } 359 360 @java.lang.Override toBuilder()361 public Builder toBuilder() { 362 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 363 } 364 365 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)366 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 367 Builder builder = new Builder(parent); 368 return builder; 369 } 370 /** 371 * 372 * 373 * <pre> 374 * Hints for the speech recognizer to help with recognition in a specific 375 * conversation state. 376 * </pre> 377 * 378 * Protobuf type {@code google.cloud.dialogflow.v2.SpeechContext} 379 */ 380 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 381 implements 382 // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.SpeechContext) 383 com.google.cloud.dialogflow.v2.SpeechContextOrBuilder { getDescriptor()384 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 385 return com.google.cloud.dialogflow.v2.AudioConfigProto 386 .internal_static_google_cloud_dialogflow_v2_SpeechContext_descriptor; 387 } 388 389 @java.lang.Override 390 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()391 internalGetFieldAccessorTable() { 392 return com.google.cloud.dialogflow.v2.AudioConfigProto 393 .internal_static_google_cloud_dialogflow_v2_SpeechContext_fieldAccessorTable 394 .ensureFieldAccessorsInitialized( 395 com.google.cloud.dialogflow.v2.SpeechContext.class, 396 com.google.cloud.dialogflow.v2.SpeechContext.Builder.class); 397 } 398 399 // Construct using com.google.cloud.dialogflow.v2.SpeechContext.newBuilder() Builder()400 private Builder() {} 401 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)402 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 403 super(parent); 404 } 405 406 @java.lang.Override clear()407 public Builder clear() { 408 super.clear(); 409 bitField0_ = 0; 410 phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; 411 bitField0_ = (bitField0_ & ~0x00000001); 412 boost_ = 0F; 413 return this; 414 } 415 416 @java.lang.Override getDescriptorForType()417 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 418 return com.google.cloud.dialogflow.v2.AudioConfigProto 419 .internal_static_google_cloud_dialogflow_v2_SpeechContext_descriptor; 420 } 421 422 @java.lang.Override getDefaultInstanceForType()423 public com.google.cloud.dialogflow.v2.SpeechContext getDefaultInstanceForType() { 424 return com.google.cloud.dialogflow.v2.SpeechContext.getDefaultInstance(); 425 } 426 427 @java.lang.Override build()428 public com.google.cloud.dialogflow.v2.SpeechContext build() { 429 com.google.cloud.dialogflow.v2.SpeechContext result = buildPartial(); 430 if (!result.isInitialized()) { 431 throw newUninitializedMessageException(result); 432 } 433 return result; 434 } 435 436 @java.lang.Override buildPartial()437 public com.google.cloud.dialogflow.v2.SpeechContext buildPartial() { 438 com.google.cloud.dialogflow.v2.SpeechContext result = 439 new com.google.cloud.dialogflow.v2.SpeechContext(this); 440 buildPartialRepeatedFields(result); 441 if (bitField0_ != 0) { 442 buildPartial0(result); 443 } 444 onBuilt(); 445 return result; 446 } 447 buildPartialRepeatedFields(com.google.cloud.dialogflow.v2.SpeechContext result)448 private void buildPartialRepeatedFields(com.google.cloud.dialogflow.v2.SpeechContext result) { 449 if (((bitField0_ & 0x00000001) != 0)) { 450 phrases_ = phrases_.getUnmodifiableView(); 451 bitField0_ = (bitField0_ & ~0x00000001); 452 } 453 result.phrases_ = phrases_; 454 } 455 buildPartial0(com.google.cloud.dialogflow.v2.SpeechContext result)456 private void buildPartial0(com.google.cloud.dialogflow.v2.SpeechContext result) { 457 int from_bitField0_ = bitField0_; 458 if (((from_bitField0_ & 0x00000002) != 0)) { 459 result.boost_ = boost_; 460 } 461 } 462 463 @java.lang.Override clone()464 public Builder clone() { 465 return super.clone(); 466 } 467 468 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)469 public Builder setField( 470 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 471 return super.setField(field, value); 472 } 473 474 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)475 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 476 return super.clearField(field); 477 } 478 479 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)480 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 481 return super.clearOneof(oneof); 482 } 483 484 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)485 public Builder setRepeatedField( 486 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 487 return super.setRepeatedField(field, index, value); 488 } 489 490 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)491 public Builder addRepeatedField( 492 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 493 return super.addRepeatedField(field, value); 494 } 495 496 @java.lang.Override mergeFrom(com.google.protobuf.Message other)497 public Builder mergeFrom(com.google.protobuf.Message other) { 498 if (other instanceof com.google.cloud.dialogflow.v2.SpeechContext) { 499 return mergeFrom((com.google.cloud.dialogflow.v2.SpeechContext) other); 500 } else { 501 super.mergeFrom(other); 502 return this; 503 } 504 } 505 mergeFrom(com.google.cloud.dialogflow.v2.SpeechContext other)506 public Builder mergeFrom(com.google.cloud.dialogflow.v2.SpeechContext other) { 507 if (other == com.google.cloud.dialogflow.v2.SpeechContext.getDefaultInstance()) return this; 508 if (!other.phrases_.isEmpty()) { 509 if (phrases_.isEmpty()) { 510 phrases_ = other.phrases_; 511 bitField0_ = (bitField0_ & ~0x00000001); 512 } else { 513 ensurePhrasesIsMutable(); 514 phrases_.addAll(other.phrases_); 515 } 516 onChanged(); 517 } 518 if (other.getBoost() != 0F) { 519 setBoost(other.getBoost()); 520 } 521 this.mergeUnknownFields(other.getUnknownFields()); 522 onChanged(); 523 return this; 524 } 525 526 @java.lang.Override isInitialized()527 public final boolean isInitialized() { 528 return true; 529 } 530 531 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)532 public Builder mergeFrom( 533 com.google.protobuf.CodedInputStream input, 534 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 535 throws java.io.IOException { 536 if (extensionRegistry == null) { 537 throw new java.lang.NullPointerException(); 538 } 539 try { 540 boolean done = false; 541 while (!done) { 542 int tag = input.readTag(); 543 switch (tag) { 544 case 0: 545 done = true; 546 break; 547 case 10: 548 { 549 java.lang.String s = input.readStringRequireUtf8(); 550 ensurePhrasesIsMutable(); 551 phrases_.add(s); 552 break; 553 } // case 10 554 case 21: 555 { 556 boost_ = input.readFloat(); 557 bitField0_ |= 0x00000002; 558 break; 559 } // case 21 560 default: 561 { 562 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 563 done = true; // was an endgroup tag 564 } 565 break; 566 } // default: 567 } // switch (tag) 568 } // while (!done) 569 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 570 throw e.unwrapIOException(); 571 } finally { 572 onChanged(); 573 } // finally 574 return this; 575 } 576 577 private int bitField0_; 578 579 private com.google.protobuf.LazyStringList phrases_ = 580 com.google.protobuf.LazyStringArrayList.EMPTY; 581 ensurePhrasesIsMutable()582 private void ensurePhrasesIsMutable() { 583 if (!((bitField0_ & 0x00000001) != 0)) { 584 phrases_ = new com.google.protobuf.LazyStringArrayList(phrases_); 585 bitField0_ |= 0x00000001; 586 } 587 } 588 /** 589 * 590 * 591 * <pre> 592 * Optional. A list of strings containing words and phrases that the speech 593 * recognizer should recognize with higher likelihood. 594 * This list can be used to: 595 * * improve accuracy for words and phrases you expect the user to say, 596 * e.g. typical commands for your Dialogflow agent 597 * * add additional words to the speech recognizer vocabulary 598 * * ... 599 * See the [Cloud Speech 600 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 601 * limits. 602 * </pre> 603 * 604 * <code>repeated string phrases = 1;</code> 605 * 606 * @return A list containing the phrases. 607 */ getPhrasesList()608 public com.google.protobuf.ProtocolStringList getPhrasesList() { 609 return phrases_.getUnmodifiableView(); 610 } 611 /** 612 * 613 * 614 * <pre> 615 * Optional. A list of strings containing words and phrases that the speech 616 * recognizer should recognize with higher likelihood. 617 * This list can be used to: 618 * * improve accuracy for words and phrases you expect the user to say, 619 * e.g. typical commands for your Dialogflow agent 620 * * add additional words to the speech recognizer vocabulary 621 * * ... 622 * See the [Cloud Speech 623 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 624 * limits. 625 * </pre> 626 * 627 * <code>repeated string phrases = 1;</code> 628 * 629 * @return The count of phrases. 630 */ getPhrasesCount()631 public int getPhrasesCount() { 632 return phrases_.size(); 633 } 634 /** 635 * 636 * 637 * <pre> 638 * Optional. A list of strings containing words and phrases that the speech 639 * recognizer should recognize with higher likelihood. 640 * This list can be used to: 641 * * improve accuracy for words and phrases you expect the user to say, 642 * e.g. typical commands for your Dialogflow agent 643 * * add additional words to the speech recognizer vocabulary 644 * * ... 645 * See the [Cloud Speech 646 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 647 * limits. 648 * </pre> 649 * 650 * <code>repeated string phrases = 1;</code> 651 * 652 * @param index The index of the element to return. 653 * @return The phrases at the given index. 654 */ getPhrases(int index)655 public java.lang.String getPhrases(int index) { 656 return phrases_.get(index); 657 } 658 /** 659 * 660 * 661 * <pre> 662 * Optional. A list of strings containing words and phrases that the speech 663 * recognizer should recognize with higher likelihood. 664 * This list can be used to: 665 * * improve accuracy for words and phrases you expect the user to say, 666 * e.g. typical commands for your Dialogflow agent 667 * * add additional words to the speech recognizer vocabulary 668 * * ... 669 * See the [Cloud Speech 670 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 671 * limits. 672 * </pre> 673 * 674 * <code>repeated string phrases = 1;</code> 675 * 676 * @param index The index of the value to return. 677 * @return The bytes of the phrases at the given index. 678 */ getPhrasesBytes(int index)679 public com.google.protobuf.ByteString getPhrasesBytes(int index) { 680 return phrases_.getByteString(index); 681 } 682 /** 683 * 684 * 685 * <pre> 686 * Optional. A list of strings containing words and phrases that the speech 687 * recognizer should recognize with higher likelihood. 688 * This list can be used to: 689 * * improve accuracy for words and phrases you expect the user to say, 690 * e.g. typical commands for your Dialogflow agent 691 * * add additional words to the speech recognizer vocabulary 692 * * ... 693 * See the [Cloud Speech 694 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 695 * limits. 696 * </pre> 697 * 698 * <code>repeated string phrases = 1;</code> 699 * 700 * @param index The index to set the value at. 701 * @param value The phrases to set. 702 * @return This builder for chaining. 703 */ setPhrases(int index, java.lang.String value)704 public Builder setPhrases(int index, java.lang.String value) { 705 if (value == null) { 706 throw new NullPointerException(); 707 } 708 ensurePhrasesIsMutable(); 709 phrases_.set(index, value); 710 onChanged(); 711 return this; 712 } 713 /** 714 * 715 * 716 * <pre> 717 * Optional. A list of strings containing words and phrases that the speech 718 * recognizer should recognize with higher likelihood. 719 * This list can be used to: 720 * * improve accuracy for words and phrases you expect the user to say, 721 * e.g. typical commands for your Dialogflow agent 722 * * add additional words to the speech recognizer vocabulary 723 * * ... 724 * See the [Cloud Speech 725 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 726 * limits. 727 * </pre> 728 * 729 * <code>repeated string phrases = 1;</code> 730 * 731 * @param value The phrases to add. 732 * @return This builder for chaining. 733 */ addPhrases(java.lang.String value)734 public Builder addPhrases(java.lang.String value) { 735 if (value == null) { 736 throw new NullPointerException(); 737 } 738 ensurePhrasesIsMutable(); 739 phrases_.add(value); 740 onChanged(); 741 return this; 742 } 743 /** 744 * 745 * 746 * <pre> 747 * Optional. A list of strings containing words and phrases that the speech 748 * recognizer should recognize with higher likelihood. 749 * This list can be used to: 750 * * improve accuracy for words and phrases you expect the user to say, 751 * e.g. typical commands for your Dialogflow agent 752 * * add additional words to the speech recognizer vocabulary 753 * * ... 754 * See the [Cloud Speech 755 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 756 * limits. 757 * </pre> 758 * 759 * <code>repeated string phrases = 1;</code> 760 * 761 * @param values The phrases to add. 762 * @return This builder for chaining. 763 */ addAllPhrases(java.lang.Iterable<java.lang.String> values)764 public Builder addAllPhrases(java.lang.Iterable<java.lang.String> values) { 765 ensurePhrasesIsMutable(); 766 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phrases_); 767 onChanged(); 768 return this; 769 } 770 /** 771 * 772 * 773 * <pre> 774 * Optional. A list of strings containing words and phrases that the speech 775 * recognizer should recognize with higher likelihood. 776 * This list can be used to: 777 * * improve accuracy for words and phrases you expect the user to say, 778 * e.g. typical commands for your Dialogflow agent 779 * * add additional words to the speech recognizer vocabulary 780 * * ... 781 * See the [Cloud Speech 782 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 783 * limits. 784 * </pre> 785 * 786 * <code>repeated string phrases = 1;</code> 787 * 788 * @return This builder for chaining. 789 */ clearPhrases()790 public Builder clearPhrases() { 791 phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; 792 bitField0_ = (bitField0_ & ~0x00000001); 793 onChanged(); 794 return this; 795 } 796 /** 797 * 798 * 799 * <pre> 800 * Optional. A list of strings containing words and phrases that the speech 801 * recognizer should recognize with higher likelihood. 802 * This list can be used to: 803 * * improve accuracy for words and phrases you expect the user to say, 804 * e.g. typical commands for your Dialogflow agent 805 * * add additional words to the speech recognizer vocabulary 806 * * ... 807 * See the [Cloud Speech 808 * documentation](https://cloud.google.com/speech-to-text/quotas) for usage 809 * limits. 810 * </pre> 811 * 812 * <code>repeated string phrases = 1;</code> 813 * 814 * @param value The bytes of the phrases to add. 815 * @return This builder for chaining. 816 */ addPhrasesBytes(com.google.protobuf.ByteString value)817 public Builder addPhrasesBytes(com.google.protobuf.ByteString value) { 818 if (value == null) { 819 throw new NullPointerException(); 820 } 821 checkByteStringIsUtf8(value); 822 ensurePhrasesIsMutable(); 823 phrases_.add(value); 824 onChanged(); 825 return this; 826 } 827 828 private float boost_; 829 /** 830 * 831 * 832 * <pre> 833 * Optional. Boost for this context compared to other contexts: 834 * * If the boost is positive, Dialogflow will increase the probability that 835 * the phrases in this context are recognized over similar sounding phrases. 836 * * If the boost is unspecified or non-positive, Dialogflow will not apply 837 * any boost. 838 * Dialogflow recommends that you use boosts in the range (0, 20] and that you 839 * find a value that fits your use case with binary search. 840 * </pre> 841 * 842 * <code>float boost = 2;</code> 843 * 844 * @return The boost. 845 */ 846 @java.lang.Override getBoost()847 public float getBoost() { 848 return boost_; 849 } 850 /** 851 * 852 * 853 * <pre> 854 * Optional. Boost for this context compared to other contexts: 855 * * If the boost is positive, Dialogflow will increase the probability that 856 * the phrases in this context are recognized over similar sounding phrases. 857 * * If the boost is unspecified or non-positive, Dialogflow will not apply 858 * any boost. 859 * Dialogflow recommends that you use boosts in the range (0, 20] and that you 860 * find a value that fits your use case with binary search. 861 * </pre> 862 * 863 * <code>float boost = 2;</code> 864 * 865 * @param value The boost to set. 866 * @return This builder for chaining. 867 */ setBoost(float value)868 public Builder setBoost(float value) { 869 870 boost_ = value; 871 bitField0_ |= 0x00000002; 872 onChanged(); 873 return this; 874 } 875 /** 876 * 877 * 878 * <pre> 879 * Optional. Boost for this context compared to other contexts: 880 * * If the boost is positive, Dialogflow will increase the probability that 881 * the phrases in this context are recognized over similar sounding phrases. 882 * * If the boost is unspecified or non-positive, Dialogflow will not apply 883 * any boost. 884 * Dialogflow recommends that you use boosts in the range (0, 20] and that you 885 * find a value that fits your use case with binary search. 886 * </pre> 887 * 888 * <code>float boost = 2;</code> 889 * 890 * @return This builder for chaining. 891 */ clearBoost()892 public Builder clearBoost() { 893 bitField0_ = (bitField0_ & ~0x00000002); 894 boost_ = 0F; 895 onChanged(); 896 return this; 897 } 898 899 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)900 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 901 return super.setUnknownFields(unknownFields); 902 } 903 904 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)905 public final Builder mergeUnknownFields( 906 final com.google.protobuf.UnknownFieldSet unknownFields) { 907 return super.mergeUnknownFields(unknownFields); 908 } 909 910 // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.SpeechContext) 911 } 912 913 // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.SpeechContext) 914 private static final com.google.cloud.dialogflow.v2.SpeechContext DEFAULT_INSTANCE; 915 916 static { 917 DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.SpeechContext(); 918 } 919 getDefaultInstance()920 public static com.google.cloud.dialogflow.v2.SpeechContext getDefaultInstance() { 921 return DEFAULT_INSTANCE; 922 } 923 924 private static final com.google.protobuf.Parser<SpeechContext> PARSER = 925 new com.google.protobuf.AbstractParser<SpeechContext>() { 926 @java.lang.Override 927 public SpeechContext parsePartialFrom( 928 com.google.protobuf.CodedInputStream input, 929 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 930 throws com.google.protobuf.InvalidProtocolBufferException { 931 Builder builder = newBuilder(); 932 try { 933 builder.mergeFrom(input, extensionRegistry); 934 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 935 throw e.setUnfinishedMessage(builder.buildPartial()); 936 } catch (com.google.protobuf.UninitializedMessageException e) { 937 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 938 } catch (java.io.IOException e) { 939 throw new com.google.protobuf.InvalidProtocolBufferException(e) 940 .setUnfinishedMessage(builder.buildPartial()); 941 } 942 return builder.buildPartial(); 943 } 944 }; 945 parser()946 public static com.google.protobuf.Parser<SpeechContext> parser() { 947 return PARSER; 948 } 949 950 @java.lang.Override getParserForType()951 public com.google.protobuf.Parser<SpeechContext> getParserForType() { 952 return PARSER; 953 } 954 955 @java.lang.Override getDefaultInstanceForType()956 public com.google.cloud.dialogflow.v2.SpeechContext getDefaultInstanceForType() { 957 return DEFAULT_INSTANCE; 958 } 959 } 960