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