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/talent/v4/common.proto 18 19 package com.google.cloud.talent.v4; 20 21 /** 22 * 23 * 24 * <pre> 25 * Spell check result. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.talent.v4.SpellingCorrection} 29 */ 30 public final class SpellingCorrection extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.talent.v4.SpellingCorrection) 33 SpellingCorrectionOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use SpellingCorrection.newBuilder() to construct. SpellingCorrection(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private SpellingCorrection(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 SpellingCorrection()40 private SpellingCorrection() { 41 correctedText_ = ""; 42 correctedHtml_ = ""; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new SpellingCorrection(); 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.talent.v4.CommonProto 58 .internal_static_google_cloud_talent_v4_SpellingCorrection_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.cloud.talent.v4.CommonProto 65 .internal_static_google_cloud_talent_v4_SpellingCorrection_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.cloud.talent.v4.SpellingCorrection.class, 68 com.google.cloud.talent.v4.SpellingCorrection.Builder.class); 69 } 70 71 public static final int CORRECTED_FIELD_NUMBER = 1; 72 private boolean corrected_ = false; 73 /** 74 * 75 * 76 * <pre> 77 * Indicates if the query was corrected by the spell checker. 78 * </pre> 79 * 80 * <code>bool corrected = 1;</code> 81 * 82 * @return The corrected. 83 */ 84 @java.lang.Override getCorrected()85 public boolean getCorrected() { 86 return corrected_; 87 } 88 89 public static final int CORRECTED_TEXT_FIELD_NUMBER = 2; 90 91 @SuppressWarnings("serial") 92 private volatile java.lang.Object correctedText_ = ""; 93 /** 94 * 95 * 96 * <pre> 97 * Correction output consisting of the corrected keyword string. 98 * </pre> 99 * 100 * <code>string corrected_text = 2;</code> 101 * 102 * @return The correctedText. 103 */ 104 @java.lang.Override getCorrectedText()105 public java.lang.String getCorrectedText() { 106 java.lang.Object ref = correctedText_; 107 if (ref instanceof java.lang.String) { 108 return (java.lang.String) ref; 109 } else { 110 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 111 java.lang.String s = bs.toStringUtf8(); 112 correctedText_ = s; 113 return s; 114 } 115 } 116 /** 117 * 118 * 119 * <pre> 120 * Correction output consisting of the corrected keyword string. 121 * </pre> 122 * 123 * <code>string corrected_text = 2;</code> 124 * 125 * @return The bytes for correctedText. 126 */ 127 @java.lang.Override getCorrectedTextBytes()128 public com.google.protobuf.ByteString getCorrectedTextBytes() { 129 java.lang.Object ref = correctedText_; 130 if (ref instanceof java.lang.String) { 131 com.google.protobuf.ByteString b = 132 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 133 correctedText_ = b; 134 return b; 135 } else { 136 return (com.google.protobuf.ByteString) ref; 137 } 138 } 139 140 public static final int CORRECTED_HTML_FIELD_NUMBER = 3; 141 142 @SuppressWarnings("serial") 143 private volatile java.lang.Object correctedHtml_ = ""; 144 /** 145 * 146 * 147 * <pre> 148 * Corrected output with html tags to highlight the corrected words. 149 * Corrected words are called out with the "<b><i>...</i></b>" html tags. 150 * For example, the user input query is "software enginear", where the second 151 * word, "enginear," is incorrect. It should be "engineer". When spelling 152 * correction is enabled, this value is 153 * "software <b><i>engineer</i></b>". 154 * </pre> 155 * 156 * <code>string corrected_html = 3;</code> 157 * 158 * @return The correctedHtml. 159 */ 160 @java.lang.Override getCorrectedHtml()161 public java.lang.String getCorrectedHtml() { 162 java.lang.Object ref = correctedHtml_; 163 if (ref instanceof java.lang.String) { 164 return (java.lang.String) ref; 165 } else { 166 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 167 java.lang.String s = bs.toStringUtf8(); 168 correctedHtml_ = s; 169 return s; 170 } 171 } 172 /** 173 * 174 * 175 * <pre> 176 * Corrected output with html tags to highlight the corrected words. 177 * Corrected words are called out with the "<b><i>...</i></b>" html tags. 178 * For example, the user input query is "software enginear", where the second 179 * word, "enginear," is incorrect. It should be "engineer". When spelling 180 * correction is enabled, this value is 181 * "software <b><i>engineer</i></b>". 182 * </pre> 183 * 184 * <code>string corrected_html = 3;</code> 185 * 186 * @return The bytes for correctedHtml. 187 */ 188 @java.lang.Override getCorrectedHtmlBytes()189 public com.google.protobuf.ByteString getCorrectedHtmlBytes() { 190 java.lang.Object ref = correctedHtml_; 191 if (ref instanceof java.lang.String) { 192 com.google.protobuf.ByteString b = 193 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 194 correctedHtml_ = b; 195 return b; 196 } else { 197 return (com.google.protobuf.ByteString) ref; 198 } 199 } 200 201 private byte memoizedIsInitialized = -1; 202 203 @java.lang.Override isInitialized()204 public final boolean isInitialized() { 205 byte isInitialized = memoizedIsInitialized; 206 if (isInitialized == 1) return true; 207 if (isInitialized == 0) return false; 208 209 memoizedIsInitialized = 1; 210 return true; 211 } 212 213 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)214 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 215 if (corrected_ != false) { 216 output.writeBool(1, corrected_); 217 } 218 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedText_)) { 219 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, correctedText_); 220 } 221 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedHtml_)) { 222 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, correctedHtml_); 223 } 224 getUnknownFields().writeTo(output); 225 } 226 227 @java.lang.Override getSerializedSize()228 public int getSerializedSize() { 229 int size = memoizedSize; 230 if (size != -1) return size; 231 232 size = 0; 233 if (corrected_ != false) { 234 size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, corrected_); 235 } 236 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedText_)) { 237 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, correctedText_); 238 } 239 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedHtml_)) { 240 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, correctedHtml_); 241 } 242 size += getUnknownFields().getSerializedSize(); 243 memoizedSize = size; 244 return size; 245 } 246 247 @java.lang.Override equals(final java.lang.Object obj)248 public boolean equals(final java.lang.Object obj) { 249 if (obj == this) { 250 return true; 251 } 252 if (!(obj instanceof com.google.cloud.talent.v4.SpellingCorrection)) { 253 return super.equals(obj); 254 } 255 com.google.cloud.talent.v4.SpellingCorrection other = 256 (com.google.cloud.talent.v4.SpellingCorrection) obj; 257 258 if (getCorrected() != other.getCorrected()) return false; 259 if (!getCorrectedText().equals(other.getCorrectedText())) return false; 260 if (!getCorrectedHtml().equals(other.getCorrectedHtml())) return false; 261 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 262 return true; 263 } 264 265 @java.lang.Override hashCode()266 public int hashCode() { 267 if (memoizedHashCode != 0) { 268 return memoizedHashCode; 269 } 270 int hash = 41; 271 hash = (19 * hash) + getDescriptor().hashCode(); 272 hash = (37 * hash) + CORRECTED_FIELD_NUMBER; 273 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCorrected()); 274 hash = (37 * hash) + CORRECTED_TEXT_FIELD_NUMBER; 275 hash = (53 * hash) + getCorrectedText().hashCode(); 276 hash = (37 * hash) + CORRECTED_HTML_FIELD_NUMBER; 277 hash = (53 * hash) + getCorrectedHtml().hashCode(); 278 hash = (29 * hash) + getUnknownFields().hashCode(); 279 memoizedHashCode = hash; 280 return hash; 281 } 282 parseFrom(java.nio.ByteBuffer data)283 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom(java.nio.ByteBuffer data) 284 throws com.google.protobuf.InvalidProtocolBufferException { 285 return PARSER.parseFrom(data); 286 } 287 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)288 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom( 289 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 290 throws com.google.protobuf.InvalidProtocolBufferException { 291 return PARSER.parseFrom(data, extensionRegistry); 292 } 293 parseFrom( com.google.protobuf.ByteString data)294 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom( 295 com.google.protobuf.ByteString data) 296 throws com.google.protobuf.InvalidProtocolBufferException { 297 return PARSER.parseFrom(data); 298 } 299 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)300 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom( 301 com.google.protobuf.ByteString data, 302 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 303 throws com.google.protobuf.InvalidProtocolBufferException { 304 return PARSER.parseFrom(data, extensionRegistry); 305 } 306 parseFrom(byte[] data)307 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom(byte[] data) 308 throws com.google.protobuf.InvalidProtocolBufferException { 309 return PARSER.parseFrom(data); 310 } 311 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)312 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom( 313 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 314 throws com.google.protobuf.InvalidProtocolBufferException { 315 return PARSER.parseFrom(data, extensionRegistry); 316 } 317 parseFrom(java.io.InputStream input)318 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom(java.io.InputStream input) 319 throws java.io.IOException { 320 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 321 } 322 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)323 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom( 324 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 325 throws java.io.IOException { 326 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 327 PARSER, input, extensionRegistry); 328 } 329 parseDelimitedFrom( java.io.InputStream input)330 public static com.google.cloud.talent.v4.SpellingCorrection parseDelimitedFrom( 331 java.io.InputStream input) throws java.io.IOException { 332 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 333 } 334 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)335 public static com.google.cloud.talent.v4.SpellingCorrection parseDelimitedFrom( 336 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 337 throws java.io.IOException { 338 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 339 PARSER, input, extensionRegistry); 340 } 341 parseFrom( com.google.protobuf.CodedInputStream input)342 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom( 343 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 344 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 345 } 346 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)347 public static com.google.cloud.talent.v4.SpellingCorrection parseFrom( 348 com.google.protobuf.CodedInputStream input, 349 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 350 throws java.io.IOException { 351 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 352 PARSER, input, extensionRegistry); 353 } 354 355 @java.lang.Override newBuilderForType()356 public Builder newBuilderForType() { 357 return newBuilder(); 358 } 359 newBuilder()360 public static Builder newBuilder() { 361 return DEFAULT_INSTANCE.toBuilder(); 362 } 363 newBuilder(com.google.cloud.talent.v4.SpellingCorrection prototype)364 public static Builder newBuilder(com.google.cloud.talent.v4.SpellingCorrection prototype) { 365 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 366 } 367 368 @java.lang.Override toBuilder()369 public Builder toBuilder() { 370 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 371 } 372 373 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)374 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 375 Builder builder = new Builder(parent); 376 return builder; 377 } 378 /** 379 * 380 * 381 * <pre> 382 * Spell check result. 383 * </pre> 384 * 385 * Protobuf type {@code google.cloud.talent.v4.SpellingCorrection} 386 */ 387 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 388 implements 389 // @@protoc_insertion_point(builder_implements:google.cloud.talent.v4.SpellingCorrection) 390 com.google.cloud.talent.v4.SpellingCorrectionOrBuilder { getDescriptor()391 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 392 return com.google.cloud.talent.v4.CommonProto 393 .internal_static_google_cloud_talent_v4_SpellingCorrection_descriptor; 394 } 395 396 @java.lang.Override 397 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()398 internalGetFieldAccessorTable() { 399 return com.google.cloud.talent.v4.CommonProto 400 .internal_static_google_cloud_talent_v4_SpellingCorrection_fieldAccessorTable 401 .ensureFieldAccessorsInitialized( 402 com.google.cloud.talent.v4.SpellingCorrection.class, 403 com.google.cloud.talent.v4.SpellingCorrection.Builder.class); 404 } 405 406 // Construct using com.google.cloud.talent.v4.SpellingCorrection.newBuilder() Builder()407 private Builder() {} 408 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)409 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 410 super(parent); 411 } 412 413 @java.lang.Override clear()414 public Builder clear() { 415 super.clear(); 416 bitField0_ = 0; 417 corrected_ = false; 418 correctedText_ = ""; 419 correctedHtml_ = ""; 420 return this; 421 } 422 423 @java.lang.Override getDescriptorForType()424 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 425 return com.google.cloud.talent.v4.CommonProto 426 .internal_static_google_cloud_talent_v4_SpellingCorrection_descriptor; 427 } 428 429 @java.lang.Override getDefaultInstanceForType()430 public com.google.cloud.talent.v4.SpellingCorrection getDefaultInstanceForType() { 431 return com.google.cloud.talent.v4.SpellingCorrection.getDefaultInstance(); 432 } 433 434 @java.lang.Override build()435 public com.google.cloud.talent.v4.SpellingCorrection build() { 436 com.google.cloud.talent.v4.SpellingCorrection result = buildPartial(); 437 if (!result.isInitialized()) { 438 throw newUninitializedMessageException(result); 439 } 440 return result; 441 } 442 443 @java.lang.Override buildPartial()444 public com.google.cloud.talent.v4.SpellingCorrection buildPartial() { 445 com.google.cloud.talent.v4.SpellingCorrection result = 446 new com.google.cloud.talent.v4.SpellingCorrection(this); 447 if (bitField0_ != 0) { 448 buildPartial0(result); 449 } 450 onBuilt(); 451 return result; 452 } 453 buildPartial0(com.google.cloud.talent.v4.SpellingCorrection result)454 private void buildPartial0(com.google.cloud.talent.v4.SpellingCorrection result) { 455 int from_bitField0_ = bitField0_; 456 if (((from_bitField0_ & 0x00000001) != 0)) { 457 result.corrected_ = corrected_; 458 } 459 if (((from_bitField0_ & 0x00000002) != 0)) { 460 result.correctedText_ = correctedText_; 461 } 462 if (((from_bitField0_ & 0x00000004) != 0)) { 463 result.correctedHtml_ = correctedHtml_; 464 } 465 } 466 467 @java.lang.Override clone()468 public Builder clone() { 469 return super.clone(); 470 } 471 472 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)473 public Builder setField( 474 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 475 return super.setField(field, value); 476 } 477 478 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)479 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 480 return super.clearField(field); 481 } 482 483 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)484 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 485 return super.clearOneof(oneof); 486 } 487 488 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)489 public Builder setRepeatedField( 490 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 491 return super.setRepeatedField(field, index, value); 492 } 493 494 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)495 public Builder addRepeatedField( 496 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 497 return super.addRepeatedField(field, value); 498 } 499 500 @java.lang.Override mergeFrom(com.google.protobuf.Message other)501 public Builder mergeFrom(com.google.protobuf.Message other) { 502 if (other instanceof com.google.cloud.talent.v4.SpellingCorrection) { 503 return mergeFrom((com.google.cloud.talent.v4.SpellingCorrection) other); 504 } else { 505 super.mergeFrom(other); 506 return this; 507 } 508 } 509 mergeFrom(com.google.cloud.talent.v4.SpellingCorrection other)510 public Builder mergeFrom(com.google.cloud.talent.v4.SpellingCorrection other) { 511 if (other == com.google.cloud.talent.v4.SpellingCorrection.getDefaultInstance()) return this; 512 if (other.getCorrected() != false) { 513 setCorrected(other.getCorrected()); 514 } 515 if (!other.getCorrectedText().isEmpty()) { 516 correctedText_ = other.correctedText_; 517 bitField0_ |= 0x00000002; 518 onChanged(); 519 } 520 if (!other.getCorrectedHtml().isEmpty()) { 521 correctedHtml_ = other.correctedHtml_; 522 bitField0_ |= 0x00000004; 523 onChanged(); 524 } 525 this.mergeUnknownFields(other.getUnknownFields()); 526 onChanged(); 527 return this; 528 } 529 530 @java.lang.Override isInitialized()531 public final boolean isInitialized() { 532 return true; 533 } 534 535 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)536 public Builder mergeFrom( 537 com.google.protobuf.CodedInputStream input, 538 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 539 throws java.io.IOException { 540 if (extensionRegistry == null) { 541 throw new java.lang.NullPointerException(); 542 } 543 try { 544 boolean done = false; 545 while (!done) { 546 int tag = input.readTag(); 547 switch (tag) { 548 case 0: 549 done = true; 550 break; 551 case 8: 552 { 553 corrected_ = input.readBool(); 554 bitField0_ |= 0x00000001; 555 break; 556 } // case 8 557 case 18: 558 { 559 correctedText_ = input.readStringRequireUtf8(); 560 bitField0_ |= 0x00000002; 561 break; 562 } // case 18 563 case 26: 564 { 565 correctedHtml_ = input.readStringRequireUtf8(); 566 bitField0_ |= 0x00000004; 567 break; 568 } // case 26 569 default: 570 { 571 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 572 done = true; // was an endgroup tag 573 } 574 break; 575 } // default: 576 } // switch (tag) 577 } // while (!done) 578 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 579 throw e.unwrapIOException(); 580 } finally { 581 onChanged(); 582 } // finally 583 return this; 584 } 585 586 private int bitField0_; 587 588 private boolean corrected_; 589 /** 590 * 591 * 592 * <pre> 593 * Indicates if the query was corrected by the spell checker. 594 * </pre> 595 * 596 * <code>bool corrected = 1;</code> 597 * 598 * @return The corrected. 599 */ 600 @java.lang.Override getCorrected()601 public boolean getCorrected() { 602 return corrected_; 603 } 604 /** 605 * 606 * 607 * <pre> 608 * Indicates if the query was corrected by the spell checker. 609 * </pre> 610 * 611 * <code>bool corrected = 1;</code> 612 * 613 * @param value The corrected to set. 614 * @return This builder for chaining. 615 */ setCorrected(boolean value)616 public Builder setCorrected(boolean value) { 617 618 corrected_ = value; 619 bitField0_ |= 0x00000001; 620 onChanged(); 621 return this; 622 } 623 /** 624 * 625 * 626 * <pre> 627 * Indicates if the query was corrected by the spell checker. 628 * </pre> 629 * 630 * <code>bool corrected = 1;</code> 631 * 632 * @return This builder for chaining. 633 */ clearCorrected()634 public Builder clearCorrected() { 635 bitField0_ = (bitField0_ & ~0x00000001); 636 corrected_ = false; 637 onChanged(); 638 return this; 639 } 640 641 private java.lang.Object correctedText_ = ""; 642 /** 643 * 644 * 645 * <pre> 646 * Correction output consisting of the corrected keyword string. 647 * </pre> 648 * 649 * <code>string corrected_text = 2;</code> 650 * 651 * @return The correctedText. 652 */ getCorrectedText()653 public java.lang.String getCorrectedText() { 654 java.lang.Object ref = correctedText_; 655 if (!(ref instanceof java.lang.String)) { 656 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 657 java.lang.String s = bs.toStringUtf8(); 658 correctedText_ = s; 659 return s; 660 } else { 661 return (java.lang.String) ref; 662 } 663 } 664 /** 665 * 666 * 667 * <pre> 668 * Correction output consisting of the corrected keyword string. 669 * </pre> 670 * 671 * <code>string corrected_text = 2;</code> 672 * 673 * @return The bytes for correctedText. 674 */ getCorrectedTextBytes()675 public com.google.protobuf.ByteString getCorrectedTextBytes() { 676 java.lang.Object ref = correctedText_; 677 if (ref instanceof String) { 678 com.google.protobuf.ByteString b = 679 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 680 correctedText_ = b; 681 return b; 682 } else { 683 return (com.google.protobuf.ByteString) ref; 684 } 685 } 686 /** 687 * 688 * 689 * <pre> 690 * Correction output consisting of the corrected keyword string. 691 * </pre> 692 * 693 * <code>string corrected_text = 2;</code> 694 * 695 * @param value The correctedText to set. 696 * @return This builder for chaining. 697 */ setCorrectedText(java.lang.String value)698 public Builder setCorrectedText(java.lang.String value) { 699 if (value == null) { 700 throw new NullPointerException(); 701 } 702 correctedText_ = value; 703 bitField0_ |= 0x00000002; 704 onChanged(); 705 return this; 706 } 707 /** 708 * 709 * 710 * <pre> 711 * Correction output consisting of the corrected keyword string. 712 * </pre> 713 * 714 * <code>string corrected_text = 2;</code> 715 * 716 * @return This builder for chaining. 717 */ clearCorrectedText()718 public Builder clearCorrectedText() { 719 correctedText_ = getDefaultInstance().getCorrectedText(); 720 bitField0_ = (bitField0_ & ~0x00000002); 721 onChanged(); 722 return this; 723 } 724 /** 725 * 726 * 727 * <pre> 728 * Correction output consisting of the corrected keyword string. 729 * </pre> 730 * 731 * <code>string corrected_text = 2;</code> 732 * 733 * @param value The bytes for correctedText to set. 734 * @return This builder for chaining. 735 */ setCorrectedTextBytes(com.google.protobuf.ByteString value)736 public Builder setCorrectedTextBytes(com.google.protobuf.ByteString value) { 737 if (value == null) { 738 throw new NullPointerException(); 739 } 740 checkByteStringIsUtf8(value); 741 correctedText_ = value; 742 bitField0_ |= 0x00000002; 743 onChanged(); 744 return this; 745 } 746 747 private java.lang.Object correctedHtml_ = ""; 748 /** 749 * 750 * 751 * <pre> 752 * Corrected output with html tags to highlight the corrected words. 753 * Corrected words are called out with the "<b><i>...</i></b>" html tags. 754 * For example, the user input query is "software enginear", where the second 755 * word, "enginear," is incorrect. It should be "engineer". When spelling 756 * correction is enabled, this value is 757 * "software <b><i>engineer</i></b>". 758 * </pre> 759 * 760 * <code>string corrected_html = 3;</code> 761 * 762 * @return The correctedHtml. 763 */ getCorrectedHtml()764 public java.lang.String getCorrectedHtml() { 765 java.lang.Object ref = correctedHtml_; 766 if (!(ref instanceof java.lang.String)) { 767 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 768 java.lang.String s = bs.toStringUtf8(); 769 correctedHtml_ = s; 770 return s; 771 } else { 772 return (java.lang.String) ref; 773 } 774 } 775 /** 776 * 777 * 778 * <pre> 779 * Corrected output with html tags to highlight the corrected words. 780 * Corrected words are called out with the "<b><i>...</i></b>" html tags. 781 * For example, the user input query is "software enginear", where the second 782 * word, "enginear," is incorrect. It should be "engineer". When spelling 783 * correction is enabled, this value is 784 * "software <b><i>engineer</i></b>". 785 * </pre> 786 * 787 * <code>string corrected_html = 3;</code> 788 * 789 * @return The bytes for correctedHtml. 790 */ getCorrectedHtmlBytes()791 public com.google.protobuf.ByteString getCorrectedHtmlBytes() { 792 java.lang.Object ref = correctedHtml_; 793 if (ref instanceof String) { 794 com.google.protobuf.ByteString b = 795 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 796 correctedHtml_ = b; 797 return b; 798 } else { 799 return (com.google.protobuf.ByteString) ref; 800 } 801 } 802 /** 803 * 804 * 805 * <pre> 806 * Corrected output with html tags to highlight the corrected words. 807 * Corrected words are called out with the "<b><i>...</i></b>" html tags. 808 * For example, the user input query is "software enginear", where the second 809 * word, "enginear," is incorrect. It should be "engineer". When spelling 810 * correction is enabled, this value is 811 * "software <b><i>engineer</i></b>". 812 * </pre> 813 * 814 * <code>string corrected_html = 3;</code> 815 * 816 * @param value The correctedHtml to set. 817 * @return This builder for chaining. 818 */ setCorrectedHtml(java.lang.String value)819 public Builder setCorrectedHtml(java.lang.String value) { 820 if (value == null) { 821 throw new NullPointerException(); 822 } 823 correctedHtml_ = value; 824 bitField0_ |= 0x00000004; 825 onChanged(); 826 return this; 827 } 828 /** 829 * 830 * 831 * <pre> 832 * Corrected output with html tags to highlight the corrected words. 833 * Corrected words are called out with the "<b><i>...</i></b>" html tags. 834 * For example, the user input query is "software enginear", where the second 835 * word, "enginear," is incorrect. It should be "engineer". When spelling 836 * correction is enabled, this value is 837 * "software <b><i>engineer</i></b>". 838 * </pre> 839 * 840 * <code>string corrected_html = 3;</code> 841 * 842 * @return This builder for chaining. 843 */ clearCorrectedHtml()844 public Builder clearCorrectedHtml() { 845 correctedHtml_ = getDefaultInstance().getCorrectedHtml(); 846 bitField0_ = (bitField0_ & ~0x00000004); 847 onChanged(); 848 return this; 849 } 850 /** 851 * 852 * 853 * <pre> 854 * Corrected output with html tags to highlight the corrected words. 855 * Corrected words are called out with the "<b><i>...</i></b>" html tags. 856 * For example, the user input query is "software enginear", where the second 857 * word, "enginear," is incorrect. It should be "engineer". When spelling 858 * correction is enabled, this value is 859 * "software <b><i>engineer</i></b>". 860 * </pre> 861 * 862 * <code>string corrected_html = 3;</code> 863 * 864 * @param value The bytes for correctedHtml to set. 865 * @return This builder for chaining. 866 */ setCorrectedHtmlBytes(com.google.protobuf.ByteString value)867 public Builder setCorrectedHtmlBytes(com.google.protobuf.ByteString value) { 868 if (value == null) { 869 throw new NullPointerException(); 870 } 871 checkByteStringIsUtf8(value); 872 correctedHtml_ = value; 873 bitField0_ |= 0x00000004; 874 onChanged(); 875 return this; 876 } 877 878 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)879 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 880 return super.setUnknownFields(unknownFields); 881 } 882 883 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)884 public final Builder mergeUnknownFields( 885 final com.google.protobuf.UnknownFieldSet unknownFields) { 886 return super.mergeUnknownFields(unknownFields); 887 } 888 889 // @@protoc_insertion_point(builder_scope:google.cloud.talent.v4.SpellingCorrection) 890 } 891 892 // @@protoc_insertion_point(class_scope:google.cloud.talent.v4.SpellingCorrection) 893 private static final com.google.cloud.talent.v4.SpellingCorrection DEFAULT_INSTANCE; 894 895 static { 896 DEFAULT_INSTANCE = new com.google.cloud.talent.v4.SpellingCorrection(); 897 } 898 getDefaultInstance()899 public static com.google.cloud.talent.v4.SpellingCorrection getDefaultInstance() { 900 return DEFAULT_INSTANCE; 901 } 902 903 private static final com.google.protobuf.Parser<SpellingCorrection> PARSER = 904 new com.google.protobuf.AbstractParser<SpellingCorrection>() { 905 @java.lang.Override 906 public SpellingCorrection parsePartialFrom( 907 com.google.protobuf.CodedInputStream input, 908 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 909 throws com.google.protobuf.InvalidProtocolBufferException { 910 Builder builder = newBuilder(); 911 try { 912 builder.mergeFrom(input, extensionRegistry); 913 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 914 throw e.setUnfinishedMessage(builder.buildPartial()); 915 } catch (com.google.protobuf.UninitializedMessageException e) { 916 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 917 } catch (java.io.IOException e) { 918 throw new com.google.protobuf.InvalidProtocolBufferException(e) 919 .setUnfinishedMessage(builder.buildPartial()); 920 } 921 return builder.buildPartial(); 922 } 923 }; 924 parser()925 public static com.google.protobuf.Parser<SpellingCorrection> parser() { 926 return PARSER; 927 } 928 929 @java.lang.Override getParserForType()930 public com.google.protobuf.Parser<SpellingCorrection> getParserForType() { 931 return PARSER; 932 } 933 934 @java.lang.Override getDefaultInstanceForType()935 public com.google.cloud.talent.v4.SpellingCorrection getDefaultInstanceForType() { 936 return DEFAULT_INSTANCE; 937 } 938 } 939