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/speech/v1p1beta1/resource.proto 18 19 package com.google.cloud.speech.v1p1beta1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Provides "hints" to the speech recognizer to favor specific words and phrases 26 * in the results. 27 * </pre> 28 * 29 * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet} 30 */ 31 public final class PhraseSet extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.PhraseSet) 34 PhraseSetOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use PhraseSet.newBuilder() to construct. PhraseSet(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private PhraseSet(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 PhraseSet()41 private PhraseSet() { 42 name_ = ""; 43 phrases_ = java.util.Collections.emptyList(); 44 } 45 46 @java.lang.Override 47 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)48 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 49 return new PhraseSet(); 50 } 51 52 @java.lang.Override getUnknownFields()53 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 54 return this.unknownFields; 55 } 56 getDescriptor()57 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 58 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 59 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; 60 } 61 62 @java.lang.Override 63 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()64 internalGetFieldAccessorTable() { 65 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 66 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable 67 .ensureFieldAccessorsInitialized( 68 com.google.cloud.speech.v1p1beta1.PhraseSet.class, 69 com.google.cloud.speech.v1p1beta1.PhraseSet.Builder.class); 70 } 71 72 public interface PhraseOrBuilder 73 extends 74 // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) 75 com.google.protobuf.MessageOrBuilder { 76 77 /** 78 * 79 * 80 * <pre> 81 * The phrase itself. 82 * </pre> 83 * 84 * <code>string value = 1;</code> 85 * 86 * @return The value. 87 */ getValue()88 java.lang.String getValue(); 89 /** 90 * 91 * 92 * <pre> 93 * The phrase itself. 94 * </pre> 95 * 96 * <code>string value = 1;</code> 97 * 98 * @return The bytes for value. 99 */ getValueBytes()100 com.google.protobuf.ByteString getValueBytes(); 101 102 /** 103 * 104 * 105 * <pre> 106 * Hint Boost. Overrides the boost set at the phrase set level. 107 * Positive value will increase the probability that a specific phrase will 108 * be recognized over other similar sounding phrases. The higher the boost, 109 * the higher the chance of false positive recognition as well. Negative 110 * boost will simply be ignored. Though `boost` can accept a wide range of 111 * positive values, most use cases are best served 112 * with values between 0 and 20. We recommend using a binary search approach 113 * to finding the optimal value for your use case as well as adding 114 * phrases both with and without boost to your requests. 115 * </pre> 116 * 117 * <code>float boost = 2;</code> 118 * 119 * @return The boost. 120 */ getBoost()121 float getBoost(); 122 } 123 /** 124 * 125 * 126 * <pre> 127 * A phrases containing words and phrase "hints" so that 128 * the speech recognition is more likely to recognize them. This can be used 129 * to improve the accuracy for specific words and phrases, for example, if 130 * specific commands are typically spoken by the user. This can also be used 131 * to add additional words to the vocabulary of the recognizer. See 132 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 133 * List items can also include pre-built or custom classes containing groups 134 * of words that represent common concepts that occur in natural language. For 135 * example, rather than providing a phrase hint for every month of the 136 * year (e.g. "i was born in january", "i was born in febuary", ...), use the 137 * pre-built `$MONTH` class improves the likelihood of correctly transcribing 138 * audio that includes months (e.g. "i was born in $month"). 139 * To refer to pre-built classes, use the class' symbol prepended with `$` 140 * e.g. `$MONTH`. To refer to custom classes that were defined inline in the 141 * request, set the class's `custom_class_id` to a string unique to all class 142 * resources and inline classes. Then use the class' id wrapped in $`{...}` 143 * e.g. "${my-months}". To refer to custom classes resources, use the class' 144 * id wrapped in `${}` (e.g. `${my-months}`). 145 * Speech-to-Text supports three locations: `global`, `us` (US North America), 146 * and `eu` (Europe). If you are calling the `speech.googleapis.com` 147 * endpoint, use the `global` location. To specify a region, use a 148 * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 149 * with matching `us` or `eu` location value. 150 * </pre> 151 * 152 * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet.Phrase} 153 */ 154 public static final class Phrase extends com.google.protobuf.GeneratedMessageV3 155 implements 156 // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) 157 PhraseOrBuilder { 158 private static final long serialVersionUID = 0L; 159 // Use Phrase.newBuilder() to construct. Phrase(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)160 private Phrase(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 161 super(builder); 162 } 163 Phrase()164 private Phrase() { 165 value_ = ""; 166 } 167 168 @java.lang.Override 169 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)170 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 171 return new Phrase(); 172 } 173 174 @java.lang.Override getUnknownFields()175 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 176 return this.unknownFields; 177 } 178 getDescriptor()179 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 180 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 181 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; 182 } 183 184 @java.lang.Override 185 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()186 internalGetFieldAccessorTable() { 187 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 188 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable 189 .ensureFieldAccessorsInitialized( 190 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.class, 191 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder.class); 192 } 193 194 public static final int VALUE_FIELD_NUMBER = 1; 195 196 @SuppressWarnings("serial") 197 private volatile java.lang.Object value_ = ""; 198 /** 199 * 200 * 201 * <pre> 202 * The phrase itself. 203 * </pre> 204 * 205 * <code>string value = 1;</code> 206 * 207 * @return The value. 208 */ 209 @java.lang.Override getValue()210 public java.lang.String getValue() { 211 java.lang.Object ref = value_; 212 if (ref instanceof java.lang.String) { 213 return (java.lang.String) ref; 214 } else { 215 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 216 java.lang.String s = bs.toStringUtf8(); 217 value_ = s; 218 return s; 219 } 220 } 221 /** 222 * 223 * 224 * <pre> 225 * The phrase itself. 226 * </pre> 227 * 228 * <code>string value = 1;</code> 229 * 230 * @return The bytes for value. 231 */ 232 @java.lang.Override getValueBytes()233 public com.google.protobuf.ByteString getValueBytes() { 234 java.lang.Object ref = value_; 235 if (ref instanceof java.lang.String) { 236 com.google.protobuf.ByteString b = 237 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 238 value_ = b; 239 return b; 240 } else { 241 return (com.google.protobuf.ByteString) ref; 242 } 243 } 244 245 public static final int BOOST_FIELD_NUMBER = 2; 246 private float boost_ = 0F; 247 /** 248 * 249 * 250 * <pre> 251 * Hint Boost. Overrides the boost set at the phrase set level. 252 * Positive value will increase the probability that a specific phrase will 253 * be recognized over other similar sounding phrases. The higher the boost, 254 * the higher the chance of false positive recognition as well. Negative 255 * boost will simply be ignored. Though `boost` can accept a wide range of 256 * positive values, most use cases are best served 257 * with values between 0 and 20. We recommend using a binary search approach 258 * to finding the optimal value for your use case as well as adding 259 * phrases both with and without boost to your requests. 260 * </pre> 261 * 262 * <code>float boost = 2;</code> 263 * 264 * @return The boost. 265 */ 266 @java.lang.Override getBoost()267 public float getBoost() { 268 return boost_; 269 } 270 271 private byte memoizedIsInitialized = -1; 272 273 @java.lang.Override isInitialized()274 public final boolean isInitialized() { 275 byte isInitialized = memoizedIsInitialized; 276 if (isInitialized == 1) return true; 277 if (isInitialized == 0) return false; 278 279 memoizedIsInitialized = 1; 280 return true; 281 } 282 283 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)284 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 285 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { 286 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); 287 } 288 if (java.lang.Float.floatToRawIntBits(boost_) != 0) { 289 output.writeFloat(2, boost_); 290 } 291 getUnknownFields().writeTo(output); 292 } 293 294 @java.lang.Override getSerializedSize()295 public int getSerializedSize() { 296 int size = memoizedSize; 297 if (size != -1) return size; 298 299 size = 0; 300 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { 301 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); 302 } 303 if (java.lang.Float.floatToRawIntBits(boost_) != 0) { 304 size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, boost_); 305 } 306 size += getUnknownFields().getSerializedSize(); 307 memoizedSize = size; 308 return size; 309 } 310 311 @java.lang.Override equals(final java.lang.Object obj)312 public boolean equals(final java.lang.Object obj) { 313 if (obj == this) { 314 return true; 315 } 316 if (!(obj instanceof com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase)) { 317 return super.equals(obj); 318 } 319 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase other = 320 (com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) obj; 321 322 if (!getValue().equals(other.getValue())) return false; 323 if (java.lang.Float.floatToIntBits(getBoost()) 324 != java.lang.Float.floatToIntBits(other.getBoost())) return false; 325 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 326 return true; 327 } 328 329 @java.lang.Override hashCode()330 public int hashCode() { 331 if (memoizedHashCode != 0) { 332 return memoizedHashCode; 333 } 334 int hash = 41; 335 hash = (19 * hash) + getDescriptor().hashCode(); 336 hash = (37 * hash) + VALUE_FIELD_NUMBER; 337 hash = (53 * hash) + getValue().hashCode(); 338 hash = (37 * hash) + BOOST_FIELD_NUMBER; 339 hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); 340 hash = (29 * hash) + getUnknownFields().hashCode(); 341 memoizedHashCode = hash; 342 return hash; 343 } 344 parseFrom( java.nio.ByteBuffer data)345 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( 346 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 347 return PARSER.parseFrom(data); 348 } 349 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)350 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( 351 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 352 throws com.google.protobuf.InvalidProtocolBufferException { 353 return PARSER.parseFrom(data, extensionRegistry); 354 } 355 parseFrom( com.google.protobuf.ByteString data)356 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( 357 com.google.protobuf.ByteString data) 358 throws com.google.protobuf.InvalidProtocolBufferException { 359 return PARSER.parseFrom(data); 360 } 361 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)362 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( 363 com.google.protobuf.ByteString data, 364 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 365 throws com.google.protobuf.InvalidProtocolBufferException { 366 return PARSER.parseFrom(data, extensionRegistry); 367 } 368 parseFrom(byte[] data)369 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom(byte[] data) 370 throws com.google.protobuf.InvalidProtocolBufferException { 371 return PARSER.parseFrom(data); 372 } 373 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)374 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( 375 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 376 throws com.google.protobuf.InvalidProtocolBufferException { 377 return PARSER.parseFrom(data, extensionRegistry); 378 } 379 parseFrom( java.io.InputStream input)380 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( 381 java.io.InputStream input) throws java.io.IOException { 382 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 383 } 384 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)385 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( 386 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 387 throws java.io.IOException { 388 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 389 PARSER, input, extensionRegistry); 390 } 391 parseDelimitedFrom( java.io.InputStream input)392 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseDelimitedFrom( 393 java.io.InputStream input) throws java.io.IOException { 394 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 395 } 396 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)397 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseDelimitedFrom( 398 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 399 throws java.io.IOException { 400 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 401 PARSER, input, extensionRegistry); 402 } 403 parseFrom( com.google.protobuf.CodedInputStream input)404 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( 405 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 406 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 407 } 408 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)409 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( 410 com.google.protobuf.CodedInputStream input, 411 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 412 throws java.io.IOException { 413 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 414 PARSER, input, extensionRegistry); 415 } 416 417 @java.lang.Override newBuilderForType()418 public Builder newBuilderForType() { 419 return newBuilder(); 420 } 421 newBuilder()422 public static Builder newBuilder() { 423 return DEFAULT_INSTANCE.toBuilder(); 424 } 425 newBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase prototype)426 public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase prototype) { 427 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 428 } 429 430 @java.lang.Override toBuilder()431 public Builder toBuilder() { 432 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 433 } 434 435 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)436 protected Builder newBuilderForType( 437 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 438 Builder builder = new Builder(parent); 439 return builder; 440 } 441 /** 442 * 443 * 444 * <pre> 445 * A phrases containing words and phrase "hints" so that 446 * the speech recognition is more likely to recognize them. This can be used 447 * to improve the accuracy for specific words and phrases, for example, if 448 * specific commands are typically spoken by the user. This can also be used 449 * to add additional words to the vocabulary of the recognizer. See 450 * [usage limits](https://cloud.google.com/speech-to-text/quotas#content). 451 * List items can also include pre-built or custom classes containing groups 452 * of words that represent common concepts that occur in natural language. For 453 * example, rather than providing a phrase hint for every month of the 454 * year (e.g. "i was born in january", "i was born in febuary", ...), use the 455 * pre-built `$MONTH` class improves the likelihood of correctly transcribing 456 * audio that includes months (e.g. "i was born in $month"). 457 * To refer to pre-built classes, use the class' symbol prepended with `$` 458 * e.g. `$MONTH`. To refer to custom classes that were defined inline in the 459 * request, set the class's `custom_class_id` to a string unique to all class 460 * resources and inline classes. Then use the class' id wrapped in $`{...}` 461 * e.g. "${my-months}". To refer to custom classes resources, use the class' 462 * id wrapped in `${}` (e.g. `${my-months}`). 463 * Speech-to-Text supports three locations: `global`, `us` (US North America), 464 * and `eu` (Europe). If you are calling the `speech.googleapis.com` 465 * endpoint, use the `global` location. To specify a region, use a 466 * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 467 * with matching `us` or `eu` location value. 468 * </pre> 469 * 470 * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet.Phrase} 471 */ 472 public static final class Builder 473 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 474 implements 475 // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) 476 com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder { getDescriptor()477 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 478 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 479 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; 480 } 481 482 @java.lang.Override 483 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()484 internalGetFieldAccessorTable() { 485 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 486 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable 487 .ensureFieldAccessorsInitialized( 488 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.class, 489 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder.class); 490 } 491 492 // Construct using com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.newBuilder() Builder()493 private Builder() {} 494 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)495 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 496 super(parent); 497 } 498 499 @java.lang.Override clear()500 public Builder clear() { 501 super.clear(); 502 bitField0_ = 0; 503 value_ = ""; 504 boost_ = 0F; 505 return this; 506 } 507 508 @java.lang.Override getDescriptorForType()509 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 510 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 511 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; 512 } 513 514 @java.lang.Override getDefaultInstanceForType()515 public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstanceForType() { 516 return com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance(); 517 } 518 519 @java.lang.Override build()520 public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase build() { 521 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result = buildPartial(); 522 if (!result.isInitialized()) { 523 throw newUninitializedMessageException(result); 524 } 525 return result; 526 } 527 528 @java.lang.Override buildPartial()529 public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase buildPartial() { 530 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result = 531 new com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(this); 532 if (bitField0_ != 0) { 533 buildPartial0(result); 534 } 535 onBuilt(); 536 return result; 537 } 538 buildPartial0(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result)539 private void buildPartial0(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result) { 540 int from_bitField0_ = bitField0_; 541 if (((from_bitField0_ & 0x00000001) != 0)) { 542 result.value_ = value_; 543 } 544 if (((from_bitField0_ & 0x00000002) != 0)) { 545 result.boost_ = boost_; 546 } 547 } 548 549 @java.lang.Override clone()550 public Builder clone() { 551 return super.clone(); 552 } 553 554 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)555 public Builder setField( 556 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 557 return super.setField(field, value); 558 } 559 560 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)561 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 562 return super.clearField(field); 563 } 564 565 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)566 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 567 return super.clearOneof(oneof); 568 } 569 570 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)571 public Builder setRepeatedField( 572 com.google.protobuf.Descriptors.FieldDescriptor field, 573 int index, 574 java.lang.Object value) { 575 return super.setRepeatedField(field, index, value); 576 } 577 578 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)579 public Builder addRepeatedField( 580 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 581 return super.addRepeatedField(field, value); 582 } 583 584 @java.lang.Override mergeFrom(com.google.protobuf.Message other)585 public Builder mergeFrom(com.google.protobuf.Message other) { 586 if (other instanceof com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) { 587 return mergeFrom((com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) other); 588 } else { 589 super.mergeFrom(other); 590 return this; 591 } 592 } 593 mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase other)594 public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase other) { 595 if (other == com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()) 596 return this; 597 if (!other.getValue().isEmpty()) { 598 value_ = other.value_; 599 bitField0_ |= 0x00000001; 600 onChanged(); 601 } 602 if (other.getBoost() != 0F) { 603 setBoost(other.getBoost()); 604 } 605 this.mergeUnknownFields(other.getUnknownFields()); 606 onChanged(); 607 return this; 608 } 609 610 @java.lang.Override isInitialized()611 public final boolean isInitialized() { 612 return true; 613 } 614 615 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)616 public Builder mergeFrom( 617 com.google.protobuf.CodedInputStream input, 618 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 619 throws java.io.IOException { 620 if (extensionRegistry == null) { 621 throw new java.lang.NullPointerException(); 622 } 623 try { 624 boolean done = false; 625 while (!done) { 626 int tag = input.readTag(); 627 switch (tag) { 628 case 0: 629 done = true; 630 break; 631 case 10: 632 { 633 value_ = input.readStringRequireUtf8(); 634 bitField0_ |= 0x00000001; 635 break; 636 } // case 10 637 case 21: 638 { 639 boost_ = input.readFloat(); 640 bitField0_ |= 0x00000002; 641 break; 642 } // case 21 643 default: 644 { 645 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 646 done = true; // was an endgroup tag 647 } 648 break; 649 } // default: 650 } // switch (tag) 651 } // while (!done) 652 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 653 throw e.unwrapIOException(); 654 } finally { 655 onChanged(); 656 } // finally 657 return this; 658 } 659 660 private int bitField0_; 661 662 private java.lang.Object value_ = ""; 663 /** 664 * 665 * 666 * <pre> 667 * The phrase itself. 668 * </pre> 669 * 670 * <code>string value = 1;</code> 671 * 672 * @return The value. 673 */ getValue()674 public java.lang.String getValue() { 675 java.lang.Object ref = value_; 676 if (!(ref instanceof java.lang.String)) { 677 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 678 java.lang.String s = bs.toStringUtf8(); 679 value_ = s; 680 return s; 681 } else { 682 return (java.lang.String) ref; 683 } 684 } 685 /** 686 * 687 * 688 * <pre> 689 * The phrase itself. 690 * </pre> 691 * 692 * <code>string value = 1;</code> 693 * 694 * @return The bytes for value. 695 */ getValueBytes()696 public com.google.protobuf.ByteString getValueBytes() { 697 java.lang.Object ref = value_; 698 if (ref instanceof String) { 699 com.google.protobuf.ByteString b = 700 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 701 value_ = b; 702 return b; 703 } else { 704 return (com.google.protobuf.ByteString) ref; 705 } 706 } 707 /** 708 * 709 * 710 * <pre> 711 * The phrase itself. 712 * </pre> 713 * 714 * <code>string value = 1;</code> 715 * 716 * @param value The value to set. 717 * @return This builder for chaining. 718 */ setValue(java.lang.String value)719 public Builder setValue(java.lang.String value) { 720 if (value == null) { 721 throw new NullPointerException(); 722 } 723 value_ = value; 724 bitField0_ |= 0x00000001; 725 onChanged(); 726 return this; 727 } 728 /** 729 * 730 * 731 * <pre> 732 * The phrase itself. 733 * </pre> 734 * 735 * <code>string value = 1;</code> 736 * 737 * @return This builder for chaining. 738 */ clearValue()739 public Builder clearValue() { 740 value_ = getDefaultInstance().getValue(); 741 bitField0_ = (bitField0_ & ~0x00000001); 742 onChanged(); 743 return this; 744 } 745 /** 746 * 747 * 748 * <pre> 749 * The phrase itself. 750 * </pre> 751 * 752 * <code>string value = 1;</code> 753 * 754 * @param value The bytes for value to set. 755 * @return This builder for chaining. 756 */ setValueBytes(com.google.protobuf.ByteString value)757 public Builder setValueBytes(com.google.protobuf.ByteString value) { 758 if (value == null) { 759 throw new NullPointerException(); 760 } 761 checkByteStringIsUtf8(value); 762 value_ = value; 763 bitField0_ |= 0x00000001; 764 onChanged(); 765 return this; 766 } 767 768 private float boost_; 769 /** 770 * 771 * 772 * <pre> 773 * Hint Boost. Overrides the boost set at the phrase set level. 774 * Positive value will increase the probability that a specific phrase will 775 * be recognized over other similar sounding phrases. The higher the boost, 776 * the higher the chance of false positive recognition as well. Negative 777 * boost will simply be ignored. Though `boost` can accept a wide range of 778 * positive values, most use cases are best served 779 * with values between 0 and 20. We recommend using a binary search approach 780 * to finding the optimal value for your use case as well as adding 781 * phrases both with and without boost to your requests. 782 * </pre> 783 * 784 * <code>float boost = 2;</code> 785 * 786 * @return The boost. 787 */ 788 @java.lang.Override getBoost()789 public float getBoost() { 790 return boost_; 791 } 792 /** 793 * 794 * 795 * <pre> 796 * Hint Boost. Overrides the boost set at the phrase set level. 797 * Positive value will increase the probability that a specific phrase will 798 * be recognized over other similar sounding phrases. The higher the boost, 799 * the higher the chance of false positive recognition as well. Negative 800 * boost will simply be ignored. Though `boost` can accept a wide range of 801 * positive values, most use cases are best served 802 * with values between 0 and 20. We recommend using a binary search approach 803 * to finding the optimal value for your use case as well as adding 804 * phrases both with and without boost to your requests. 805 * </pre> 806 * 807 * <code>float boost = 2;</code> 808 * 809 * @param value The boost to set. 810 * @return This builder for chaining. 811 */ setBoost(float value)812 public Builder setBoost(float value) { 813 814 boost_ = value; 815 bitField0_ |= 0x00000002; 816 onChanged(); 817 return this; 818 } 819 /** 820 * 821 * 822 * <pre> 823 * Hint Boost. Overrides the boost set at the phrase set level. 824 * Positive value will increase the probability that a specific phrase will 825 * be recognized over other similar sounding phrases. The higher the boost, 826 * the higher the chance of false positive recognition as well. Negative 827 * boost will simply be ignored. Though `boost` can accept a wide range of 828 * positive values, most use cases are best served 829 * with values between 0 and 20. We recommend using a binary search approach 830 * to finding the optimal value for your use case as well as adding 831 * phrases both with and without boost to your requests. 832 * </pre> 833 * 834 * <code>float boost = 2;</code> 835 * 836 * @return This builder for chaining. 837 */ clearBoost()838 public Builder clearBoost() { 839 bitField0_ = (bitField0_ & ~0x00000002); 840 boost_ = 0F; 841 onChanged(); 842 return this; 843 } 844 845 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)846 public final Builder setUnknownFields( 847 final com.google.protobuf.UnknownFieldSet unknownFields) { 848 return super.setUnknownFields(unknownFields); 849 } 850 851 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)852 public final Builder mergeUnknownFields( 853 final com.google.protobuf.UnknownFieldSet unknownFields) { 854 return super.mergeUnknownFields(unknownFields); 855 } 856 857 // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) 858 } 859 860 // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) 861 private static final com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase DEFAULT_INSTANCE; 862 863 static { 864 DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(); 865 } 866 getDefaultInstance()867 public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstance() { 868 return DEFAULT_INSTANCE; 869 } 870 871 private static final com.google.protobuf.Parser<Phrase> PARSER = 872 new com.google.protobuf.AbstractParser<Phrase>() { 873 @java.lang.Override 874 public Phrase parsePartialFrom( 875 com.google.protobuf.CodedInputStream input, 876 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 877 throws com.google.protobuf.InvalidProtocolBufferException { 878 Builder builder = newBuilder(); 879 try { 880 builder.mergeFrom(input, extensionRegistry); 881 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 882 throw e.setUnfinishedMessage(builder.buildPartial()); 883 } catch (com.google.protobuf.UninitializedMessageException e) { 884 throw e.asInvalidProtocolBufferException() 885 .setUnfinishedMessage(builder.buildPartial()); 886 } catch (java.io.IOException e) { 887 throw new com.google.protobuf.InvalidProtocolBufferException(e) 888 .setUnfinishedMessage(builder.buildPartial()); 889 } 890 return builder.buildPartial(); 891 } 892 }; 893 parser()894 public static com.google.protobuf.Parser<Phrase> parser() { 895 return PARSER; 896 } 897 898 @java.lang.Override getParserForType()899 public com.google.protobuf.Parser<Phrase> getParserForType() { 900 return PARSER; 901 } 902 903 @java.lang.Override getDefaultInstanceForType()904 public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstanceForType() { 905 return DEFAULT_INSTANCE; 906 } 907 } 908 909 public static final int NAME_FIELD_NUMBER = 1; 910 911 @SuppressWarnings("serial") 912 private volatile java.lang.Object name_ = ""; 913 /** 914 * 915 * 916 * <pre> 917 * The resource name of the phrase set. 918 * </pre> 919 * 920 * <code>string name = 1;</code> 921 * 922 * @return The name. 923 */ 924 @java.lang.Override getName()925 public java.lang.String getName() { 926 java.lang.Object ref = name_; 927 if (ref instanceof java.lang.String) { 928 return (java.lang.String) ref; 929 } else { 930 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 931 java.lang.String s = bs.toStringUtf8(); 932 name_ = s; 933 return s; 934 } 935 } 936 /** 937 * 938 * 939 * <pre> 940 * The resource name of the phrase set. 941 * </pre> 942 * 943 * <code>string name = 1;</code> 944 * 945 * @return The bytes for name. 946 */ 947 @java.lang.Override getNameBytes()948 public com.google.protobuf.ByteString getNameBytes() { 949 java.lang.Object ref = name_; 950 if (ref instanceof java.lang.String) { 951 com.google.protobuf.ByteString b = 952 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 953 name_ = b; 954 return b; 955 } else { 956 return (com.google.protobuf.ByteString) ref; 957 } 958 } 959 960 public static final int PHRASES_FIELD_NUMBER = 2; 961 962 @SuppressWarnings("serial") 963 private java.util.List<com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase> phrases_; 964 /** 965 * 966 * 967 * <pre> 968 * A list of word and phrases. 969 * </pre> 970 * 971 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 972 */ 973 @java.lang.Override getPhrasesList()974 public java.util.List<com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase> getPhrasesList() { 975 return phrases_; 976 } 977 /** 978 * 979 * 980 * <pre> 981 * A list of word and phrases. 982 * </pre> 983 * 984 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 985 */ 986 @java.lang.Override 987 public java.util.List<? extends com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> getPhrasesOrBuilderList()988 getPhrasesOrBuilderList() { 989 return phrases_; 990 } 991 /** 992 * 993 * 994 * <pre> 995 * A list of word and phrases. 996 * </pre> 997 * 998 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 999 */ 1000 @java.lang.Override getPhrasesCount()1001 public int getPhrasesCount() { 1002 return phrases_.size(); 1003 } 1004 /** 1005 * 1006 * 1007 * <pre> 1008 * A list of word and phrases. 1009 * </pre> 1010 * 1011 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1012 */ 1013 @java.lang.Override getPhrases(int index)1014 public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index) { 1015 return phrases_.get(index); 1016 } 1017 /** 1018 * 1019 * 1020 * <pre> 1021 * A list of word and phrases. 1022 * </pre> 1023 * 1024 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1025 */ 1026 @java.lang.Override getPhrasesOrBuilder( int index)1027 public com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( 1028 int index) { 1029 return phrases_.get(index); 1030 } 1031 1032 public static final int BOOST_FIELD_NUMBER = 4; 1033 private float boost_ = 0F; 1034 /** 1035 * 1036 * 1037 * <pre> 1038 * Hint Boost. Positive value will increase the probability that a specific 1039 * phrase will be recognized over other similar sounding phrases. The higher 1040 * the boost, the higher the chance of false positive recognition as well. 1041 * Negative boost values would correspond to anti-biasing. Anti-biasing is not 1042 * enabled, so negative boost will simply be ignored. Though `boost` can 1043 * accept a wide range of positive values, most use cases are best served with 1044 * values between 0 (exclusive) and 20. We recommend using a binary search 1045 * approach to finding the optimal value for your use case as well as adding 1046 * phrases both with and without boost to your requests. 1047 * </pre> 1048 * 1049 * <code>float boost = 4;</code> 1050 * 1051 * @return The boost. 1052 */ 1053 @java.lang.Override getBoost()1054 public float getBoost() { 1055 return boost_; 1056 } 1057 1058 private byte memoizedIsInitialized = -1; 1059 1060 @java.lang.Override isInitialized()1061 public final boolean isInitialized() { 1062 byte isInitialized = memoizedIsInitialized; 1063 if (isInitialized == 1) return true; 1064 if (isInitialized == 0) return false; 1065 1066 memoizedIsInitialized = 1; 1067 return true; 1068 } 1069 1070 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1071 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1072 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1073 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 1074 } 1075 for (int i = 0; i < phrases_.size(); i++) { 1076 output.writeMessage(2, phrases_.get(i)); 1077 } 1078 if (java.lang.Float.floatToRawIntBits(boost_) != 0) { 1079 output.writeFloat(4, boost_); 1080 } 1081 getUnknownFields().writeTo(output); 1082 } 1083 1084 @java.lang.Override getSerializedSize()1085 public int getSerializedSize() { 1086 int size = memoizedSize; 1087 if (size != -1) return size; 1088 1089 size = 0; 1090 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1091 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 1092 } 1093 for (int i = 0; i < phrases_.size(); i++) { 1094 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, phrases_.get(i)); 1095 } 1096 if (java.lang.Float.floatToRawIntBits(boost_) != 0) { 1097 size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, boost_); 1098 } 1099 size += getUnknownFields().getSerializedSize(); 1100 memoizedSize = size; 1101 return size; 1102 } 1103 1104 @java.lang.Override equals(final java.lang.Object obj)1105 public boolean equals(final java.lang.Object obj) { 1106 if (obj == this) { 1107 return true; 1108 } 1109 if (!(obj instanceof com.google.cloud.speech.v1p1beta1.PhraseSet)) { 1110 return super.equals(obj); 1111 } 1112 com.google.cloud.speech.v1p1beta1.PhraseSet other = 1113 (com.google.cloud.speech.v1p1beta1.PhraseSet) obj; 1114 1115 if (!getName().equals(other.getName())) return false; 1116 if (!getPhrasesList().equals(other.getPhrasesList())) return false; 1117 if (java.lang.Float.floatToIntBits(getBoost()) 1118 != java.lang.Float.floatToIntBits(other.getBoost())) return false; 1119 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1120 return true; 1121 } 1122 1123 @java.lang.Override hashCode()1124 public int hashCode() { 1125 if (memoizedHashCode != 0) { 1126 return memoizedHashCode; 1127 } 1128 int hash = 41; 1129 hash = (19 * hash) + getDescriptor().hashCode(); 1130 hash = (37 * hash) + NAME_FIELD_NUMBER; 1131 hash = (53 * hash) + getName().hashCode(); 1132 if (getPhrasesCount() > 0) { 1133 hash = (37 * hash) + PHRASES_FIELD_NUMBER; 1134 hash = (53 * hash) + getPhrasesList().hashCode(); 1135 } 1136 hash = (37 * hash) + BOOST_FIELD_NUMBER; 1137 hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); 1138 hash = (29 * hash) + getUnknownFields().hashCode(); 1139 memoizedHashCode = hash; 1140 return hash; 1141 } 1142 parseFrom(java.nio.ByteBuffer data)1143 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom(java.nio.ByteBuffer data) 1144 throws com.google.protobuf.InvalidProtocolBufferException { 1145 return PARSER.parseFrom(data); 1146 } 1147 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1148 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( 1149 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1150 throws com.google.protobuf.InvalidProtocolBufferException { 1151 return PARSER.parseFrom(data, extensionRegistry); 1152 } 1153 parseFrom( com.google.protobuf.ByteString data)1154 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( 1155 com.google.protobuf.ByteString data) 1156 throws com.google.protobuf.InvalidProtocolBufferException { 1157 return PARSER.parseFrom(data); 1158 } 1159 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1160 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( 1161 com.google.protobuf.ByteString data, 1162 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1163 throws com.google.protobuf.InvalidProtocolBufferException { 1164 return PARSER.parseFrom(data, extensionRegistry); 1165 } 1166 parseFrom(byte[] data)1167 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom(byte[] data) 1168 throws com.google.protobuf.InvalidProtocolBufferException { 1169 return PARSER.parseFrom(data); 1170 } 1171 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1172 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( 1173 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1174 throws com.google.protobuf.InvalidProtocolBufferException { 1175 return PARSER.parseFrom(data, extensionRegistry); 1176 } 1177 parseFrom(java.io.InputStream input)1178 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom(java.io.InputStream input) 1179 throws java.io.IOException { 1180 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1181 } 1182 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1183 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( 1184 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1185 throws java.io.IOException { 1186 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1187 PARSER, input, extensionRegistry); 1188 } 1189 parseDelimitedFrom( java.io.InputStream input)1190 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseDelimitedFrom( 1191 java.io.InputStream input) throws java.io.IOException { 1192 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1193 } 1194 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1195 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseDelimitedFrom( 1196 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1197 throws java.io.IOException { 1198 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1199 PARSER, input, extensionRegistry); 1200 } 1201 parseFrom( com.google.protobuf.CodedInputStream input)1202 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( 1203 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1204 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1205 } 1206 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1207 public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( 1208 com.google.protobuf.CodedInputStream input, 1209 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1210 throws java.io.IOException { 1211 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1212 PARSER, input, extensionRegistry); 1213 } 1214 1215 @java.lang.Override newBuilderForType()1216 public Builder newBuilderForType() { 1217 return newBuilder(); 1218 } 1219 newBuilder()1220 public static Builder newBuilder() { 1221 return DEFAULT_INSTANCE.toBuilder(); 1222 } 1223 newBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet prototype)1224 public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet prototype) { 1225 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1226 } 1227 1228 @java.lang.Override toBuilder()1229 public Builder toBuilder() { 1230 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1231 } 1232 1233 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1234 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1235 Builder builder = new Builder(parent); 1236 return builder; 1237 } 1238 /** 1239 * 1240 * 1241 * <pre> 1242 * Provides "hints" to the speech recognizer to favor specific words and phrases 1243 * in the results. 1244 * </pre> 1245 * 1246 * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet} 1247 */ 1248 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1249 implements 1250 // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.PhraseSet) 1251 com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder { getDescriptor()1252 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1253 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 1254 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; 1255 } 1256 1257 @java.lang.Override 1258 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1259 internalGetFieldAccessorTable() { 1260 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 1261 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable 1262 .ensureFieldAccessorsInitialized( 1263 com.google.cloud.speech.v1p1beta1.PhraseSet.class, 1264 com.google.cloud.speech.v1p1beta1.PhraseSet.Builder.class); 1265 } 1266 1267 // Construct using com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder() Builder()1268 private Builder() {} 1269 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1270 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1271 super(parent); 1272 } 1273 1274 @java.lang.Override clear()1275 public Builder clear() { 1276 super.clear(); 1277 bitField0_ = 0; 1278 name_ = ""; 1279 if (phrasesBuilder_ == null) { 1280 phrases_ = java.util.Collections.emptyList(); 1281 } else { 1282 phrases_ = null; 1283 phrasesBuilder_.clear(); 1284 } 1285 bitField0_ = (bitField0_ & ~0x00000002); 1286 boost_ = 0F; 1287 return this; 1288 } 1289 1290 @java.lang.Override getDescriptorForType()1291 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1292 return com.google.cloud.speech.v1p1beta1.SpeechResourceProto 1293 .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; 1294 } 1295 1296 @java.lang.Override getDefaultInstanceForType()1297 public com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstanceForType() { 1298 return com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance(); 1299 } 1300 1301 @java.lang.Override build()1302 public com.google.cloud.speech.v1p1beta1.PhraseSet build() { 1303 com.google.cloud.speech.v1p1beta1.PhraseSet result = buildPartial(); 1304 if (!result.isInitialized()) { 1305 throw newUninitializedMessageException(result); 1306 } 1307 return result; 1308 } 1309 1310 @java.lang.Override buildPartial()1311 public com.google.cloud.speech.v1p1beta1.PhraseSet buildPartial() { 1312 com.google.cloud.speech.v1p1beta1.PhraseSet result = 1313 new com.google.cloud.speech.v1p1beta1.PhraseSet(this); 1314 buildPartialRepeatedFields(result); 1315 if (bitField0_ != 0) { 1316 buildPartial0(result); 1317 } 1318 onBuilt(); 1319 return result; 1320 } 1321 buildPartialRepeatedFields(com.google.cloud.speech.v1p1beta1.PhraseSet result)1322 private void buildPartialRepeatedFields(com.google.cloud.speech.v1p1beta1.PhraseSet result) { 1323 if (phrasesBuilder_ == null) { 1324 if (((bitField0_ & 0x00000002) != 0)) { 1325 phrases_ = java.util.Collections.unmodifiableList(phrases_); 1326 bitField0_ = (bitField0_ & ~0x00000002); 1327 } 1328 result.phrases_ = phrases_; 1329 } else { 1330 result.phrases_ = phrasesBuilder_.build(); 1331 } 1332 } 1333 buildPartial0(com.google.cloud.speech.v1p1beta1.PhraseSet result)1334 private void buildPartial0(com.google.cloud.speech.v1p1beta1.PhraseSet result) { 1335 int from_bitField0_ = bitField0_; 1336 if (((from_bitField0_ & 0x00000001) != 0)) { 1337 result.name_ = name_; 1338 } 1339 if (((from_bitField0_ & 0x00000004) != 0)) { 1340 result.boost_ = boost_; 1341 } 1342 } 1343 1344 @java.lang.Override clone()1345 public Builder clone() { 1346 return super.clone(); 1347 } 1348 1349 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1350 public Builder setField( 1351 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1352 return super.setField(field, value); 1353 } 1354 1355 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1356 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1357 return super.clearField(field); 1358 } 1359 1360 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1361 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1362 return super.clearOneof(oneof); 1363 } 1364 1365 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1366 public Builder setRepeatedField( 1367 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 1368 return super.setRepeatedField(field, index, value); 1369 } 1370 1371 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1372 public Builder addRepeatedField( 1373 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1374 return super.addRepeatedField(field, value); 1375 } 1376 1377 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1378 public Builder mergeFrom(com.google.protobuf.Message other) { 1379 if (other instanceof com.google.cloud.speech.v1p1beta1.PhraseSet) { 1380 return mergeFrom((com.google.cloud.speech.v1p1beta1.PhraseSet) other); 1381 } else { 1382 super.mergeFrom(other); 1383 return this; 1384 } 1385 } 1386 mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet other)1387 public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet other) { 1388 if (other == com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()) return this; 1389 if (!other.getName().isEmpty()) { 1390 name_ = other.name_; 1391 bitField0_ |= 0x00000001; 1392 onChanged(); 1393 } 1394 if (phrasesBuilder_ == null) { 1395 if (!other.phrases_.isEmpty()) { 1396 if (phrases_.isEmpty()) { 1397 phrases_ = other.phrases_; 1398 bitField0_ = (bitField0_ & ~0x00000002); 1399 } else { 1400 ensurePhrasesIsMutable(); 1401 phrases_.addAll(other.phrases_); 1402 } 1403 onChanged(); 1404 } 1405 } else { 1406 if (!other.phrases_.isEmpty()) { 1407 if (phrasesBuilder_.isEmpty()) { 1408 phrasesBuilder_.dispose(); 1409 phrasesBuilder_ = null; 1410 phrases_ = other.phrases_; 1411 bitField0_ = (bitField0_ & ~0x00000002); 1412 phrasesBuilder_ = 1413 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 1414 ? getPhrasesFieldBuilder() 1415 : null; 1416 } else { 1417 phrasesBuilder_.addAllMessages(other.phrases_); 1418 } 1419 } 1420 } 1421 if (other.getBoost() != 0F) { 1422 setBoost(other.getBoost()); 1423 } 1424 this.mergeUnknownFields(other.getUnknownFields()); 1425 onChanged(); 1426 return this; 1427 } 1428 1429 @java.lang.Override isInitialized()1430 public final boolean isInitialized() { 1431 return true; 1432 } 1433 1434 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1435 public Builder mergeFrom( 1436 com.google.protobuf.CodedInputStream input, 1437 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1438 throws java.io.IOException { 1439 if (extensionRegistry == null) { 1440 throw new java.lang.NullPointerException(); 1441 } 1442 try { 1443 boolean done = false; 1444 while (!done) { 1445 int tag = input.readTag(); 1446 switch (tag) { 1447 case 0: 1448 done = true; 1449 break; 1450 case 10: 1451 { 1452 name_ = input.readStringRequireUtf8(); 1453 bitField0_ |= 0x00000001; 1454 break; 1455 } // case 10 1456 case 18: 1457 { 1458 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase m = 1459 input.readMessage( 1460 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.parser(), 1461 extensionRegistry); 1462 if (phrasesBuilder_ == null) { 1463 ensurePhrasesIsMutable(); 1464 phrases_.add(m); 1465 } else { 1466 phrasesBuilder_.addMessage(m); 1467 } 1468 break; 1469 } // case 18 1470 case 37: 1471 { 1472 boost_ = input.readFloat(); 1473 bitField0_ |= 0x00000004; 1474 break; 1475 } // case 37 1476 default: 1477 { 1478 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1479 done = true; // was an endgroup tag 1480 } 1481 break; 1482 } // default: 1483 } // switch (tag) 1484 } // while (!done) 1485 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1486 throw e.unwrapIOException(); 1487 } finally { 1488 onChanged(); 1489 } // finally 1490 return this; 1491 } 1492 1493 private int bitField0_; 1494 1495 private java.lang.Object name_ = ""; 1496 /** 1497 * 1498 * 1499 * <pre> 1500 * The resource name of the phrase set. 1501 * </pre> 1502 * 1503 * <code>string name = 1;</code> 1504 * 1505 * @return The name. 1506 */ getName()1507 public java.lang.String getName() { 1508 java.lang.Object ref = name_; 1509 if (!(ref instanceof java.lang.String)) { 1510 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1511 java.lang.String s = bs.toStringUtf8(); 1512 name_ = s; 1513 return s; 1514 } else { 1515 return (java.lang.String) ref; 1516 } 1517 } 1518 /** 1519 * 1520 * 1521 * <pre> 1522 * The resource name of the phrase set. 1523 * </pre> 1524 * 1525 * <code>string name = 1;</code> 1526 * 1527 * @return The bytes for name. 1528 */ getNameBytes()1529 public com.google.protobuf.ByteString getNameBytes() { 1530 java.lang.Object ref = name_; 1531 if (ref instanceof String) { 1532 com.google.protobuf.ByteString b = 1533 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1534 name_ = b; 1535 return b; 1536 } else { 1537 return (com.google.protobuf.ByteString) ref; 1538 } 1539 } 1540 /** 1541 * 1542 * 1543 * <pre> 1544 * The resource name of the phrase set. 1545 * </pre> 1546 * 1547 * <code>string name = 1;</code> 1548 * 1549 * @param value The name to set. 1550 * @return This builder for chaining. 1551 */ setName(java.lang.String value)1552 public Builder setName(java.lang.String value) { 1553 if (value == null) { 1554 throw new NullPointerException(); 1555 } 1556 name_ = value; 1557 bitField0_ |= 0x00000001; 1558 onChanged(); 1559 return this; 1560 } 1561 /** 1562 * 1563 * 1564 * <pre> 1565 * The resource name of the phrase set. 1566 * </pre> 1567 * 1568 * <code>string name = 1;</code> 1569 * 1570 * @return This builder for chaining. 1571 */ clearName()1572 public Builder clearName() { 1573 name_ = getDefaultInstance().getName(); 1574 bitField0_ = (bitField0_ & ~0x00000001); 1575 onChanged(); 1576 return this; 1577 } 1578 /** 1579 * 1580 * 1581 * <pre> 1582 * The resource name of the phrase set. 1583 * </pre> 1584 * 1585 * <code>string name = 1;</code> 1586 * 1587 * @param value The bytes for name to set. 1588 * @return This builder for chaining. 1589 */ setNameBytes(com.google.protobuf.ByteString value)1590 public Builder setNameBytes(com.google.protobuf.ByteString value) { 1591 if (value == null) { 1592 throw new NullPointerException(); 1593 } 1594 checkByteStringIsUtf8(value); 1595 name_ = value; 1596 bitField0_ |= 0x00000001; 1597 onChanged(); 1598 return this; 1599 } 1600 1601 private java.util.List<com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase> phrases_ = 1602 java.util.Collections.emptyList(); 1603 ensurePhrasesIsMutable()1604 private void ensurePhrasesIsMutable() { 1605 if (!((bitField0_ & 0x00000002) != 0)) { 1606 phrases_ = 1607 new java.util.ArrayList<com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase>(phrases_); 1608 bitField0_ |= 0x00000002; 1609 } 1610 } 1611 1612 private com.google.protobuf.RepeatedFieldBuilderV3< 1613 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, 1614 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, 1615 com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> 1616 phrasesBuilder_; 1617 1618 /** 1619 * 1620 * 1621 * <pre> 1622 * A list of word and phrases. 1623 * </pre> 1624 * 1625 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1626 */ getPhrasesList()1627 public java.util.List<com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase> getPhrasesList() { 1628 if (phrasesBuilder_ == null) { 1629 return java.util.Collections.unmodifiableList(phrases_); 1630 } else { 1631 return phrasesBuilder_.getMessageList(); 1632 } 1633 } 1634 /** 1635 * 1636 * 1637 * <pre> 1638 * A list of word and phrases. 1639 * </pre> 1640 * 1641 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1642 */ getPhrasesCount()1643 public int getPhrasesCount() { 1644 if (phrasesBuilder_ == null) { 1645 return phrases_.size(); 1646 } else { 1647 return phrasesBuilder_.getCount(); 1648 } 1649 } 1650 /** 1651 * 1652 * 1653 * <pre> 1654 * A list of word and phrases. 1655 * </pre> 1656 * 1657 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1658 */ getPhrases(int index)1659 public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index) { 1660 if (phrasesBuilder_ == null) { 1661 return phrases_.get(index); 1662 } else { 1663 return phrasesBuilder_.getMessage(index); 1664 } 1665 } 1666 /** 1667 * 1668 * 1669 * <pre> 1670 * A list of word and phrases. 1671 * </pre> 1672 * 1673 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1674 */ setPhrases(int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value)1675 public Builder setPhrases(int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { 1676 if (phrasesBuilder_ == null) { 1677 if (value == null) { 1678 throw new NullPointerException(); 1679 } 1680 ensurePhrasesIsMutable(); 1681 phrases_.set(index, value); 1682 onChanged(); 1683 } else { 1684 phrasesBuilder_.setMessage(index, value); 1685 } 1686 return this; 1687 } 1688 /** 1689 * 1690 * 1691 * <pre> 1692 * A list of word and phrases. 1693 * </pre> 1694 * 1695 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1696 */ setPhrases( int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue)1697 public Builder setPhrases( 1698 int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { 1699 if (phrasesBuilder_ == null) { 1700 ensurePhrasesIsMutable(); 1701 phrases_.set(index, builderForValue.build()); 1702 onChanged(); 1703 } else { 1704 phrasesBuilder_.setMessage(index, builderForValue.build()); 1705 } 1706 return this; 1707 } 1708 /** 1709 * 1710 * 1711 * <pre> 1712 * A list of word and phrases. 1713 * </pre> 1714 * 1715 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1716 */ addPhrases(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value)1717 public Builder addPhrases(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { 1718 if (phrasesBuilder_ == null) { 1719 if (value == null) { 1720 throw new NullPointerException(); 1721 } 1722 ensurePhrasesIsMutable(); 1723 phrases_.add(value); 1724 onChanged(); 1725 } else { 1726 phrasesBuilder_.addMessage(value); 1727 } 1728 return this; 1729 } 1730 /** 1731 * 1732 * 1733 * <pre> 1734 * A list of word and phrases. 1735 * </pre> 1736 * 1737 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1738 */ addPhrases(int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value)1739 public Builder addPhrases(int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { 1740 if (phrasesBuilder_ == null) { 1741 if (value == null) { 1742 throw new NullPointerException(); 1743 } 1744 ensurePhrasesIsMutable(); 1745 phrases_.add(index, value); 1746 onChanged(); 1747 } else { 1748 phrasesBuilder_.addMessage(index, value); 1749 } 1750 return this; 1751 } 1752 /** 1753 * 1754 * 1755 * <pre> 1756 * A list of word and phrases. 1757 * </pre> 1758 * 1759 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1760 */ addPhrases( com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue)1761 public Builder addPhrases( 1762 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { 1763 if (phrasesBuilder_ == null) { 1764 ensurePhrasesIsMutable(); 1765 phrases_.add(builderForValue.build()); 1766 onChanged(); 1767 } else { 1768 phrasesBuilder_.addMessage(builderForValue.build()); 1769 } 1770 return this; 1771 } 1772 /** 1773 * 1774 * 1775 * <pre> 1776 * A list of word and phrases. 1777 * </pre> 1778 * 1779 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1780 */ addPhrases( int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue)1781 public Builder addPhrases( 1782 int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { 1783 if (phrasesBuilder_ == null) { 1784 ensurePhrasesIsMutable(); 1785 phrases_.add(index, builderForValue.build()); 1786 onChanged(); 1787 } else { 1788 phrasesBuilder_.addMessage(index, builderForValue.build()); 1789 } 1790 return this; 1791 } 1792 /** 1793 * 1794 * 1795 * <pre> 1796 * A list of word and phrases. 1797 * </pre> 1798 * 1799 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1800 */ addAllPhrases( java.lang.Iterable<? extends com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase> values)1801 public Builder addAllPhrases( 1802 java.lang.Iterable<? extends com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase> values) { 1803 if (phrasesBuilder_ == null) { 1804 ensurePhrasesIsMutable(); 1805 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phrases_); 1806 onChanged(); 1807 } else { 1808 phrasesBuilder_.addAllMessages(values); 1809 } 1810 return this; 1811 } 1812 /** 1813 * 1814 * 1815 * <pre> 1816 * A list of word and phrases. 1817 * </pre> 1818 * 1819 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1820 */ clearPhrases()1821 public Builder clearPhrases() { 1822 if (phrasesBuilder_ == null) { 1823 phrases_ = java.util.Collections.emptyList(); 1824 bitField0_ = (bitField0_ & ~0x00000002); 1825 onChanged(); 1826 } else { 1827 phrasesBuilder_.clear(); 1828 } 1829 return this; 1830 } 1831 /** 1832 * 1833 * 1834 * <pre> 1835 * A list of word and phrases. 1836 * </pre> 1837 * 1838 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1839 */ removePhrases(int index)1840 public Builder removePhrases(int index) { 1841 if (phrasesBuilder_ == null) { 1842 ensurePhrasesIsMutable(); 1843 phrases_.remove(index); 1844 onChanged(); 1845 } else { 1846 phrasesBuilder_.remove(index); 1847 } 1848 return this; 1849 } 1850 /** 1851 * 1852 * 1853 * <pre> 1854 * A list of word and phrases. 1855 * </pre> 1856 * 1857 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1858 */ getPhrasesBuilder(int index)1859 public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder getPhrasesBuilder(int index) { 1860 return getPhrasesFieldBuilder().getBuilder(index); 1861 } 1862 /** 1863 * 1864 * 1865 * <pre> 1866 * A list of word and phrases. 1867 * </pre> 1868 * 1869 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1870 */ getPhrasesOrBuilder( int index)1871 public com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( 1872 int index) { 1873 if (phrasesBuilder_ == null) { 1874 return phrases_.get(index); 1875 } else { 1876 return phrasesBuilder_.getMessageOrBuilder(index); 1877 } 1878 } 1879 /** 1880 * 1881 * 1882 * <pre> 1883 * A list of word and phrases. 1884 * </pre> 1885 * 1886 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1887 */ 1888 public java.util.List<? extends com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> getPhrasesOrBuilderList()1889 getPhrasesOrBuilderList() { 1890 if (phrasesBuilder_ != null) { 1891 return phrasesBuilder_.getMessageOrBuilderList(); 1892 } else { 1893 return java.util.Collections.unmodifiableList(phrases_); 1894 } 1895 } 1896 /** 1897 * 1898 * 1899 * <pre> 1900 * A list of word and phrases. 1901 * </pre> 1902 * 1903 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1904 */ addPhrasesBuilder()1905 public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder addPhrasesBuilder() { 1906 return getPhrasesFieldBuilder() 1907 .addBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()); 1908 } 1909 /** 1910 * 1911 * 1912 * <pre> 1913 * A list of word and phrases. 1914 * </pre> 1915 * 1916 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1917 */ addPhrasesBuilder(int index)1918 public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder addPhrasesBuilder(int index) { 1919 return getPhrasesFieldBuilder() 1920 .addBuilder( 1921 index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()); 1922 } 1923 /** 1924 * 1925 * 1926 * <pre> 1927 * A list of word and phrases. 1928 * </pre> 1929 * 1930 * <code>repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2;</code> 1931 */ 1932 public java.util.List<com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder> getPhrasesBuilderList()1933 getPhrasesBuilderList() { 1934 return getPhrasesFieldBuilder().getBuilderList(); 1935 } 1936 1937 private com.google.protobuf.RepeatedFieldBuilderV3< 1938 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, 1939 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, 1940 com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> getPhrasesFieldBuilder()1941 getPhrasesFieldBuilder() { 1942 if (phrasesBuilder_ == null) { 1943 phrasesBuilder_ = 1944 new com.google.protobuf.RepeatedFieldBuilderV3< 1945 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, 1946 com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, 1947 com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder>( 1948 phrases_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); 1949 phrases_ = null; 1950 } 1951 return phrasesBuilder_; 1952 } 1953 1954 private float boost_; 1955 /** 1956 * 1957 * 1958 * <pre> 1959 * Hint Boost. Positive value will increase the probability that a specific 1960 * phrase will be recognized over other similar sounding phrases. The higher 1961 * the boost, the higher the chance of false positive recognition as well. 1962 * Negative boost values would correspond to anti-biasing. Anti-biasing is not 1963 * enabled, so negative boost will simply be ignored. Though `boost` can 1964 * accept a wide range of positive values, most use cases are best served with 1965 * values between 0 (exclusive) and 20. We recommend using a binary search 1966 * approach to finding the optimal value for your use case as well as adding 1967 * phrases both with and without boost to your requests. 1968 * </pre> 1969 * 1970 * <code>float boost = 4;</code> 1971 * 1972 * @return The boost. 1973 */ 1974 @java.lang.Override getBoost()1975 public float getBoost() { 1976 return boost_; 1977 } 1978 /** 1979 * 1980 * 1981 * <pre> 1982 * Hint Boost. Positive value will increase the probability that a specific 1983 * phrase will be recognized over other similar sounding phrases. The higher 1984 * the boost, the higher the chance of false positive recognition as well. 1985 * Negative boost values would correspond to anti-biasing. Anti-biasing is not 1986 * enabled, so negative boost will simply be ignored. Though `boost` can 1987 * accept a wide range of positive values, most use cases are best served with 1988 * values between 0 (exclusive) and 20. We recommend using a binary search 1989 * approach to finding the optimal value for your use case as well as adding 1990 * phrases both with and without boost to your requests. 1991 * </pre> 1992 * 1993 * <code>float boost = 4;</code> 1994 * 1995 * @param value The boost to set. 1996 * @return This builder for chaining. 1997 */ setBoost(float value)1998 public Builder setBoost(float value) { 1999 2000 boost_ = value; 2001 bitField0_ |= 0x00000004; 2002 onChanged(); 2003 return this; 2004 } 2005 /** 2006 * 2007 * 2008 * <pre> 2009 * Hint Boost. Positive value will increase the probability that a specific 2010 * phrase will be recognized over other similar sounding phrases. The higher 2011 * the boost, the higher the chance of false positive recognition as well. 2012 * Negative boost values would correspond to anti-biasing. Anti-biasing is not 2013 * enabled, so negative boost will simply be ignored. Though `boost` can 2014 * accept a wide range of positive values, most use cases are best served with 2015 * values between 0 (exclusive) and 20. We recommend using a binary search 2016 * approach to finding the optimal value for your use case as well as adding 2017 * phrases both with and without boost to your requests. 2018 * </pre> 2019 * 2020 * <code>float boost = 4;</code> 2021 * 2022 * @return This builder for chaining. 2023 */ clearBoost()2024 public Builder clearBoost() { 2025 bitField0_ = (bitField0_ & ~0x00000004); 2026 boost_ = 0F; 2027 onChanged(); 2028 return this; 2029 } 2030 2031 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2032 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2033 return super.setUnknownFields(unknownFields); 2034 } 2035 2036 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2037 public final Builder mergeUnknownFields( 2038 final com.google.protobuf.UnknownFieldSet unknownFields) { 2039 return super.mergeUnknownFields(unknownFields); 2040 } 2041 2042 // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.PhraseSet) 2043 } 2044 2045 // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.PhraseSet) 2046 private static final com.google.cloud.speech.v1p1beta1.PhraseSet DEFAULT_INSTANCE; 2047 2048 static { 2049 DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.PhraseSet(); 2050 } 2051 getDefaultInstance()2052 public static com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstance() { 2053 return DEFAULT_INSTANCE; 2054 } 2055 2056 private static final com.google.protobuf.Parser<PhraseSet> PARSER = 2057 new com.google.protobuf.AbstractParser<PhraseSet>() { 2058 @java.lang.Override 2059 public PhraseSet parsePartialFrom( 2060 com.google.protobuf.CodedInputStream input, 2061 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2062 throws com.google.protobuf.InvalidProtocolBufferException { 2063 Builder builder = newBuilder(); 2064 try { 2065 builder.mergeFrom(input, extensionRegistry); 2066 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2067 throw e.setUnfinishedMessage(builder.buildPartial()); 2068 } catch (com.google.protobuf.UninitializedMessageException e) { 2069 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 2070 } catch (java.io.IOException e) { 2071 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2072 .setUnfinishedMessage(builder.buildPartial()); 2073 } 2074 return builder.buildPartial(); 2075 } 2076 }; 2077 parser()2078 public static com.google.protobuf.Parser<PhraseSet> parser() { 2079 return PARSER; 2080 } 2081 2082 @java.lang.Override getParserForType()2083 public com.google.protobuf.Parser<PhraseSet> getParserForType() { 2084 return PARSER; 2085 } 2086 2087 @java.lang.Override getDefaultInstanceForType()2088 public com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstanceForType() { 2089 return DEFAULT_INSTANCE; 2090 } 2091 } 2092