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 request message for the text annotation API, which can perform multiple 26 * analysis types (sentiment, entities, and syntax) in one call. 27 * </pre> 28 * 29 * Protobuf type {@code google.cloud.language.v1.AnnotateTextRequest} 30 */ 31 public final class AnnotateTextRequest extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnnotateTextRequest) 34 AnnotateTextRequestOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use AnnotateTextRequest.newBuilder() to construct. AnnotateTextRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private AnnotateTextRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 AnnotateTextRequest()41 private AnnotateTextRequest() { 42 encodingType_ = 0; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new AnnotateTextRequest(); 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.language.v1.LanguageServiceProto 58 .internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.cloud.language.v1.LanguageServiceProto 65 .internal_static_google_cloud_language_v1_AnnotateTextRequest_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.cloud.language.v1.AnnotateTextRequest.class, 68 com.google.cloud.language.v1.AnnotateTextRequest.Builder.class); 69 } 70 71 public interface FeaturesOrBuilder 72 extends 73 // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.AnnotateTextRequest.Features) 74 com.google.protobuf.MessageOrBuilder { 75 76 /** 77 * 78 * 79 * <pre> 80 * Extract syntax information. 81 * </pre> 82 * 83 * <code>bool extract_syntax = 1;</code> 84 * 85 * @return The extractSyntax. 86 */ getExtractSyntax()87 boolean getExtractSyntax(); 88 89 /** 90 * 91 * 92 * <pre> 93 * Extract entities. 94 * </pre> 95 * 96 * <code>bool extract_entities = 2;</code> 97 * 98 * @return The extractEntities. 99 */ getExtractEntities()100 boolean getExtractEntities(); 101 102 /** 103 * 104 * 105 * <pre> 106 * Extract document-level sentiment. 107 * </pre> 108 * 109 * <code>bool extract_document_sentiment = 3;</code> 110 * 111 * @return The extractDocumentSentiment. 112 */ getExtractDocumentSentiment()113 boolean getExtractDocumentSentiment(); 114 115 /** 116 * 117 * 118 * <pre> 119 * Extract entities and their associated sentiment. 120 * </pre> 121 * 122 * <code>bool extract_entity_sentiment = 4;</code> 123 * 124 * @return The extractEntitySentiment. 125 */ getExtractEntitySentiment()126 boolean getExtractEntitySentiment(); 127 128 /** 129 * 130 * 131 * <pre> 132 * Classify the full document into categories. 133 * </pre> 134 * 135 * <code>bool classify_text = 6;</code> 136 * 137 * @return The classifyText. 138 */ getClassifyText()139 boolean getClassifyText(); 140 141 /** 142 * 143 * 144 * <pre> 145 * The model options to use for classification. Defaults to v1 options 146 * if not specified. Only used if `classify_text` is set to true. 147 * </pre> 148 * 149 * <code>.google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 150 * </code> 151 * 152 * @return Whether the classificationModelOptions field is set. 153 */ hasClassificationModelOptions()154 boolean hasClassificationModelOptions(); 155 /** 156 * 157 * 158 * <pre> 159 * The model options to use for classification. Defaults to v1 options 160 * if not specified. Only used if `classify_text` is set to true. 161 * </pre> 162 * 163 * <code>.google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 164 * </code> 165 * 166 * @return The classificationModelOptions. 167 */ getClassificationModelOptions()168 com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions(); 169 /** 170 * 171 * 172 * <pre> 173 * The model options to use for classification. Defaults to v1 options 174 * if not specified. Only used if `classify_text` is set to true. 175 * </pre> 176 * 177 * <code>.google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 178 * </code> 179 */ 180 com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder getClassificationModelOptionsOrBuilder()181 getClassificationModelOptionsOrBuilder(); 182 } 183 /** 184 * 185 * 186 * <pre> 187 * All available features for sentiment, syntax, and semantic analysis. 188 * Setting each one to true will enable that specific analysis for the input. 189 * </pre> 190 * 191 * Protobuf type {@code google.cloud.language.v1.AnnotateTextRequest.Features} 192 */ 193 public static final class Features extends com.google.protobuf.GeneratedMessageV3 194 implements 195 // @@protoc_insertion_point(message_implements:google.cloud.language.v1.AnnotateTextRequest.Features) 196 FeaturesOrBuilder { 197 private static final long serialVersionUID = 0L; 198 // Use Features.newBuilder() to construct. Features(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)199 private Features(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 200 super(builder); 201 } 202 Features()203 private Features() {} 204 205 @java.lang.Override 206 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)207 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 208 return new Features(); 209 } 210 211 @java.lang.Override getUnknownFields()212 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 213 return this.unknownFields; 214 } 215 getDescriptor()216 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 217 return com.google.cloud.language.v1.LanguageServiceProto 218 .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_descriptor; 219 } 220 221 @java.lang.Override 222 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()223 internalGetFieldAccessorTable() { 224 return com.google.cloud.language.v1.LanguageServiceProto 225 .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_fieldAccessorTable 226 .ensureFieldAccessorsInitialized( 227 com.google.cloud.language.v1.AnnotateTextRequest.Features.class, 228 com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder.class); 229 } 230 231 public static final int EXTRACT_SYNTAX_FIELD_NUMBER = 1; 232 private boolean extractSyntax_ = false; 233 /** 234 * 235 * 236 * <pre> 237 * Extract syntax information. 238 * </pre> 239 * 240 * <code>bool extract_syntax = 1;</code> 241 * 242 * @return The extractSyntax. 243 */ 244 @java.lang.Override getExtractSyntax()245 public boolean getExtractSyntax() { 246 return extractSyntax_; 247 } 248 249 public static final int EXTRACT_ENTITIES_FIELD_NUMBER = 2; 250 private boolean extractEntities_ = false; 251 /** 252 * 253 * 254 * <pre> 255 * Extract entities. 256 * </pre> 257 * 258 * <code>bool extract_entities = 2;</code> 259 * 260 * @return The extractEntities. 261 */ 262 @java.lang.Override getExtractEntities()263 public boolean getExtractEntities() { 264 return extractEntities_; 265 } 266 267 public static final int EXTRACT_DOCUMENT_SENTIMENT_FIELD_NUMBER = 3; 268 private boolean extractDocumentSentiment_ = false; 269 /** 270 * 271 * 272 * <pre> 273 * Extract document-level sentiment. 274 * </pre> 275 * 276 * <code>bool extract_document_sentiment = 3;</code> 277 * 278 * @return The extractDocumentSentiment. 279 */ 280 @java.lang.Override getExtractDocumentSentiment()281 public boolean getExtractDocumentSentiment() { 282 return extractDocumentSentiment_; 283 } 284 285 public static final int EXTRACT_ENTITY_SENTIMENT_FIELD_NUMBER = 4; 286 private boolean extractEntitySentiment_ = false; 287 /** 288 * 289 * 290 * <pre> 291 * Extract entities and their associated sentiment. 292 * </pre> 293 * 294 * <code>bool extract_entity_sentiment = 4;</code> 295 * 296 * @return The extractEntitySentiment. 297 */ 298 @java.lang.Override getExtractEntitySentiment()299 public boolean getExtractEntitySentiment() { 300 return extractEntitySentiment_; 301 } 302 303 public static final int CLASSIFY_TEXT_FIELD_NUMBER = 6; 304 private boolean classifyText_ = false; 305 /** 306 * 307 * 308 * <pre> 309 * Classify the full document into categories. 310 * </pre> 311 * 312 * <code>bool classify_text = 6;</code> 313 * 314 * @return The classifyText. 315 */ 316 @java.lang.Override getClassifyText()317 public boolean getClassifyText() { 318 return classifyText_; 319 } 320 321 public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 10; 322 private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; 323 /** 324 * 325 * 326 * <pre> 327 * The model options to use for classification. Defaults to v1 options 328 * if not specified. Only used if `classify_text` is set to true. 329 * </pre> 330 * 331 * <code>.google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 332 * </code> 333 * 334 * @return Whether the classificationModelOptions field is set. 335 */ 336 @java.lang.Override hasClassificationModelOptions()337 public boolean hasClassificationModelOptions() { 338 return classificationModelOptions_ != null; 339 } 340 /** 341 * 342 * 343 * <pre> 344 * The model options to use for classification. Defaults to v1 options 345 * if not specified. Only used if `classify_text` is set to true. 346 * </pre> 347 * 348 * <code>.google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 349 * </code> 350 * 351 * @return The classificationModelOptions. 352 */ 353 @java.lang.Override getClassificationModelOptions()354 public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { 355 return classificationModelOptions_ == null 356 ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() 357 : classificationModelOptions_; 358 } 359 /** 360 * 361 * 362 * <pre> 363 * The model options to use for classification. Defaults to v1 options 364 * if not specified. Only used if `classify_text` is set to true. 365 * </pre> 366 * 367 * <code>.google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 368 * </code> 369 */ 370 @java.lang.Override 371 public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder getClassificationModelOptionsOrBuilder()372 getClassificationModelOptionsOrBuilder() { 373 return classificationModelOptions_ == null 374 ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() 375 : classificationModelOptions_; 376 } 377 378 private byte memoizedIsInitialized = -1; 379 380 @java.lang.Override isInitialized()381 public final boolean isInitialized() { 382 byte isInitialized = memoizedIsInitialized; 383 if (isInitialized == 1) return true; 384 if (isInitialized == 0) return false; 385 386 memoizedIsInitialized = 1; 387 return true; 388 } 389 390 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)391 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 392 if (extractSyntax_ != false) { 393 output.writeBool(1, extractSyntax_); 394 } 395 if (extractEntities_ != false) { 396 output.writeBool(2, extractEntities_); 397 } 398 if (extractDocumentSentiment_ != false) { 399 output.writeBool(3, extractDocumentSentiment_); 400 } 401 if (extractEntitySentiment_ != false) { 402 output.writeBool(4, extractEntitySentiment_); 403 } 404 if (classifyText_ != false) { 405 output.writeBool(6, classifyText_); 406 } 407 if (classificationModelOptions_ != null) { 408 output.writeMessage(10, getClassificationModelOptions()); 409 } 410 getUnknownFields().writeTo(output); 411 } 412 413 @java.lang.Override getSerializedSize()414 public int getSerializedSize() { 415 int size = memoizedSize; 416 if (size != -1) return size; 417 418 size = 0; 419 if (extractSyntax_ != false) { 420 size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, extractSyntax_); 421 } 422 if (extractEntities_ != false) { 423 size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, extractEntities_); 424 } 425 if (extractDocumentSentiment_ != false) { 426 size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, extractDocumentSentiment_); 427 } 428 if (extractEntitySentiment_ != false) { 429 size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, extractEntitySentiment_); 430 } 431 if (classifyText_ != false) { 432 size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, classifyText_); 433 } 434 if (classificationModelOptions_ != null) { 435 size += 436 com.google.protobuf.CodedOutputStream.computeMessageSize( 437 10, getClassificationModelOptions()); 438 } 439 size += getUnknownFields().getSerializedSize(); 440 memoizedSize = size; 441 return size; 442 } 443 444 @java.lang.Override equals(final java.lang.Object obj)445 public boolean equals(final java.lang.Object obj) { 446 if (obj == this) { 447 return true; 448 } 449 if (!(obj instanceof com.google.cloud.language.v1.AnnotateTextRequest.Features)) { 450 return super.equals(obj); 451 } 452 com.google.cloud.language.v1.AnnotateTextRequest.Features other = 453 (com.google.cloud.language.v1.AnnotateTextRequest.Features) obj; 454 455 if (getExtractSyntax() != other.getExtractSyntax()) return false; 456 if (getExtractEntities() != other.getExtractEntities()) return false; 457 if (getExtractDocumentSentiment() != other.getExtractDocumentSentiment()) return false; 458 if (getExtractEntitySentiment() != other.getExtractEntitySentiment()) return false; 459 if (getClassifyText() != other.getClassifyText()) return false; 460 if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; 461 if (hasClassificationModelOptions()) { 462 if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) 463 return false; 464 } 465 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 466 return true; 467 } 468 469 @java.lang.Override hashCode()470 public int hashCode() { 471 if (memoizedHashCode != 0) { 472 return memoizedHashCode; 473 } 474 int hash = 41; 475 hash = (19 * hash) + getDescriptor().hashCode(); 476 hash = (37 * hash) + EXTRACT_SYNTAX_FIELD_NUMBER; 477 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractSyntax()); 478 hash = (37 * hash) + EXTRACT_ENTITIES_FIELD_NUMBER; 479 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractEntities()); 480 hash = (37 * hash) + EXTRACT_DOCUMENT_SENTIMENT_FIELD_NUMBER; 481 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractDocumentSentiment()); 482 hash = (37 * hash) + EXTRACT_ENTITY_SENTIMENT_FIELD_NUMBER; 483 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractEntitySentiment()); 484 hash = (37 * hash) + CLASSIFY_TEXT_FIELD_NUMBER; 485 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClassifyText()); 486 if (hasClassificationModelOptions()) { 487 hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; 488 hash = (53 * hash) + getClassificationModelOptions().hashCode(); 489 } 490 hash = (29 * hash) + getUnknownFields().hashCode(); 491 memoizedHashCode = hash; 492 return hash; 493 } 494 parseFrom( java.nio.ByteBuffer data)495 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( 496 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 497 return PARSER.parseFrom(data); 498 } 499 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)500 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( 501 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 502 throws com.google.protobuf.InvalidProtocolBufferException { 503 return PARSER.parseFrom(data, extensionRegistry); 504 } 505 parseFrom( com.google.protobuf.ByteString data)506 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( 507 com.google.protobuf.ByteString data) 508 throws com.google.protobuf.InvalidProtocolBufferException { 509 return PARSER.parseFrom(data); 510 } 511 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)512 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( 513 com.google.protobuf.ByteString data, 514 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 515 throws com.google.protobuf.InvalidProtocolBufferException { 516 return PARSER.parseFrom(data, extensionRegistry); 517 } 518 parseFrom(byte[] data)519 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom(byte[] data) 520 throws com.google.protobuf.InvalidProtocolBufferException { 521 return PARSER.parseFrom(data); 522 } 523 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)524 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( 525 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 526 throws com.google.protobuf.InvalidProtocolBufferException { 527 return PARSER.parseFrom(data, extensionRegistry); 528 } 529 parseFrom( java.io.InputStream input)530 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( 531 java.io.InputStream input) throws java.io.IOException { 532 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 533 } 534 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)535 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( 536 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 537 throws java.io.IOException { 538 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 539 PARSER, input, extensionRegistry); 540 } 541 parseDelimitedFrom( java.io.InputStream input)542 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseDelimitedFrom( 543 java.io.InputStream input) throws java.io.IOException { 544 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 545 } 546 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)547 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseDelimitedFrom( 548 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 549 throws java.io.IOException { 550 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 551 PARSER, input, extensionRegistry); 552 } 553 parseFrom( com.google.protobuf.CodedInputStream input)554 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( 555 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 556 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 557 } 558 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)559 public static com.google.cloud.language.v1.AnnotateTextRequest.Features parseFrom( 560 com.google.protobuf.CodedInputStream input, 561 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 562 throws java.io.IOException { 563 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 564 PARSER, input, extensionRegistry); 565 } 566 567 @java.lang.Override newBuilderForType()568 public Builder newBuilderForType() { 569 return newBuilder(); 570 } 571 newBuilder()572 public static Builder newBuilder() { 573 return DEFAULT_INSTANCE.toBuilder(); 574 } 575 newBuilder( com.google.cloud.language.v1.AnnotateTextRequest.Features prototype)576 public static Builder newBuilder( 577 com.google.cloud.language.v1.AnnotateTextRequest.Features prototype) { 578 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 579 } 580 581 @java.lang.Override toBuilder()582 public Builder toBuilder() { 583 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 584 } 585 586 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)587 protected Builder newBuilderForType( 588 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 589 Builder builder = new Builder(parent); 590 return builder; 591 } 592 /** 593 * 594 * 595 * <pre> 596 * All available features for sentiment, syntax, and semantic analysis. 597 * Setting each one to true will enable that specific analysis for the input. 598 * </pre> 599 * 600 * Protobuf type {@code google.cloud.language.v1.AnnotateTextRequest.Features} 601 */ 602 public static final class Builder 603 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 604 implements 605 // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnnotateTextRequest.Features) 606 com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder { getDescriptor()607 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 608 return com.google.cloud.language.v1.LanguageServiceProto 609 .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_descriptor; 610 } 611 612 @java.lang.Override 613 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()614 internalGetFieldAccessorTable() { 615 return com.google.cloud.language.v1.LanguageServiceProto 616 .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_fieldAccessorTable 617 .ensureFieldAccessorsInitialized( 618 com.google.cloud.language.v1.AnnotateTextRequest.Features.class, 619 com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder.class); 620 } 621 622 // Construct using com.google.cloud.language.v1.AnnotateTextRequest.Features.newBuilder() Builder()623 private Builder() {} 624 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)625 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 626 super(parent); 627 } 628 629 @java.lang.Override clear()630 public Builder clear() { 631 super.clear(); 632 bitField0_ = 0; 633 extractSyntax_ = false; 634 extractEntities_ = false; 635 extractDocumentSentiment_ = false; 636 extractEntitySentiment_ = false; 637 classifyText_ = false; 638 classificationModelOptions_ = null; 639 if (classificationModelOptionsBuilder_ != null) { 640 classificationModelOptionsBuilder_.dispose(); 641 classificationModelOptionsBuilder_ = null; 642 } 643 return this; 644 } 645 646 @java.lang.Override getDescriptorForType()647 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 648 return com.google.cloud.language.v1.LanguageServiceProto 649 .internal_static_google_cloud_language_v1_AnnotateTextRequest_Features_descriptor; 650 } 651 652 @java.lang.Override getDefaultInstanceForType()653 public com.google.cloud.language.v1.AnnotateTextRequest.Features getDefaultInstanceForType() { 654 return com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance(); 655 } 656 657 @java.lang.Override build()658 public com.google.cloud.language.v1.AnnotateTextRequest.Features build() { 659 com.google.cloud.language.v1.AnnotateTextRequest.Features result = buildPartial(); 660 if (!result.isInitialized()) { 661 throw newUninitializedMessageException(result); 662 } 663 return result; 664 } 665 666 @java.lang.Override buildPartial()667 public com.google.cloud.language.v1.AnnotateTextRequest.Features buildPartial() { 668 com.google.cloud.language.v1.AnnotateTextRequest.Features result = 669 new com.google.cloud.language.v1.AnnotateTextRequest.Features(this); 670 if (bitField0_ != 0) { 671 buildPartial0(result); 672 } 673 onBuilt(); 674 return result; 675 } 676 buildPartial0(com.google.cloud.language.v1.AnnotateTextRequest.Features result)677 private void buildPartial0(com.google.cloud.language.v1.AnnotateTextRequest.Features result) { 678 int from_bitField0_ = bitField0_; 679 if (((from_bitField0_ & 0x00000001) != 0)) { 680 result.extractSyntax_ = extractSyntax_; 681 } 682 if (((from_bitField0_ & 0x00000002) != 0)) { 683 result.extractEntities_ = extractEntities_; 684 } 685 if (((from_bitField0_ & 0x00000004) != 0)) { 686 result.extractDocumentSentiment_ = extractDocumentSentiment_; 687 } 688 if (((from_bitField0_ & 0x00000008) != 0)) { 689 result.extractEntitySentiment_ = extractEntitySentiment_; 690 } 691 if (((from_bitField0_ & 0x00000010) != 0)) { 692 result.classifyText_ = classifyText_; 693 } 694 if (((from_bitField0_ & 0x00000020) != 0)) { 695 result.classificationModelOptions_ = 696 classificationModelOptionsBuilder_ == null 697 ? classificationModelOptions_ 698 : classificationModelOptionsBuilder_.build(); 699 } 700 } 701 702 @java.lang.Override clone()703 public Builder clone() { 704 return super.clone(); 705 } 706 707 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)708 public Builder setField( 709 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 710 return super.setField(field, value); 711 } 712 713 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)714 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 715 return super.clearField(field); 716 } 717 718 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)719 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 720 return super.clearOneof(oneof); 721 } 722 723 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)724 public Builder setRepeatedField( 725 com.google.protobuf.Descriptors.FieldDescriptor field, 726 int index, 727 java.lang.Object value) { 728 return super.setRepeatedField(field, index, value); 729 } 730 731 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)732 public Builder addRepeatedField( 733 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 734 return super.addRepeatedField(field, value); 735 } 736 737 @java.lang.Override mergeFrom(com.google.protobuf.Message other)738 public Builder mergeFrom(com.google.protobuf.Message other) { 739 if (other instanceof com.google.cloud.language.v1.AnnotateTextRequest.Features) { 740 return mergeFrom((com.google.cloud.language.v1.AnnotateTextRequest.Features) other); 741 } else { 742 super.mergeFrom(other); 743 return this; 744 } 745 } 746 mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest.Features other)747 public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest.Features other) { 748 if (other == com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance()) 749 return this; 750 if (other.getExtractSyntax() != false) { 751 setExtractSyntax(other.getExtractSyntax()); 752 } 753 if (other.getExtractEntities() != false) { 754 setExtractEntities(other.getExtractEntities()); 755 } 756 if (other.getExtractDocumentSentiment() != false) { 757 setExtractDocumentSentiment(other.getExtractDocumentSentiment()); 758 } 759 if (other.getExtractEntitySentiment() != false) { 760 setExtractEntitySentiment(other.getExtractEntitySentiment()); 761 } 762 if (other.getClassifyText() != false) { 763 setClassifyText(other.getClassifyText()); 764 } 765 if (other.hasClassificationModelOptions()) { 766 mergeClassificationModelOptions(other.getClassificationModelOptions()); 767 } 768 this.mergeUnknownFields(other.getUnknownFields()); 769 onChanged(); 770 return this; 771 } 772 773 @java.lang.Override isInitialized()774 public final boolean isInitialized() { 775 return true; 776 } 777 778 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)779 public Builder mergeFrom( 780 com.google.protobuf.CodedInputStream input, 781 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 782 throws java.io.IOException { 783 if (extensionRegistry == null) { 784 throw new java.lang.NullPointerException(); 785 } 786 try { 787 boolean done = false; 788 while (!done) { 789 int tag = input.readTag(); 790 switch (tag) { 791 case 0: 792 done = true; 793 break; 794 case 8: 795 { 796 extractSyntax_ = input.readBool(); 797 bitField0_ |= 0x00000001; 798 break; 799 } // case 8 800 case 16: 801 { 802 extractEntities_ = input.readBool(); 803 bitField0_ |= 0x00000002; 804 break; 805 } // case 16 806 case 24: 807 { 808 extractDocumentSentiment_ = input.readBool(); 809 bitField0_ |= 0x00000004; 810 break; 811 } // case 24 812 case 32: 813 { 814 extractEntitySentiment_ = input.readBool(); 815 bitField0_ |= 0x00000008; 816 break; 817 } // case 32 818 case 48: 819 { 820 classifyText_ = input.readBool(); 821 bitField0_ |= 0x00000010; 822 break; 823 } // case 48 824 case 82: 825 { 826 input.readMessage( 827 getClassificationModelOptionsFieldBuilder().getBuilder(), extensionRegistry); 828 bitField0_ |= 0x00000020; 829 break; 830 } // case 82 831 default: 832 { 833 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 834 done = true; // was an endgroup tag 835 } 836 break; 837 } // default: 838 } // switch (tag) 839 } // while (!done) 840 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 841 throw e.unwrapIOException(); 842 } finally { 843 onChanged(); 844 } // finally 845 return this; 846 } 847 848 private int bitField0_; 849 850 private boolean extractSyntax_; 851 /** 852 * 853 * 854 * <pre> 855 * Extract syntax information. 856 * </pre> 857 * 858 * <code>bool extract_syntax = 1;</code> 859 * 860 * @return The extractSyntax. 861 */ 862 @java.lang.Override getExtractSyntax()863 public boolean getExtractSyntax() { 864 return extractSyntax_; 865 } 866 /** 867 * 868 * 869 * <pre> 870 * Extract syntax information. 871 * </pre> 872 * 873 * <code>bool extract_syntax = 1;</code> 874 * 875 * @param value The extractSyntax to set. 876 * @return This builder for chaining. 877 */ setExtractSyntax(boolean value)878 public Builder setExtractSyntax(boolean value) { 879 880 extractSyntax_ = value; 881 bitField0_ |= 0x00000001; 882 onChanged(); 883 return this; 884 } 885 /** 886 * 887 * 888 * <pre> 889 * Extract syntax information. 890 * </pre> 891 * 892 * <code>bool extract_syntax = 1;</code> 893 * 894 * @return This builder for chaining. 895 */ clearExtractSyntax()896 public Builder clearExtractSyntax() { 897 bitField0_ = (bitField0_ & ~0x00000001); 898 extractSyntax_ = false; 899 onChanged(); 900 return this; 901 } 902 903 private boolean extractEntities_; 904 /** 905 * 906 * 907 * <pre> 908 * Extract entities. 909 * </pre> 910 * 911 * <code>bool extract_entities = 2;</code> 912 * 913 * @return The extractEntities. 914 */ 915 @java.lang.Override getExtractEntities()916 public boolean getExtractEntities() { 917 return extractEntities_; 918 } 919 /** 920 * 921 * 922 * <pre> 923 * Extract entities. 924 * </pre> 925 * 926 * <code>bool extract_entities = 2;</code> 927 * 928 * @param value The extractEntities to set. 929 * @return This builder for chaining. 930 */ setExtractEntities(boolean value)931 public Builder setExtractEntities(boolean value) { 932 933 extractEntities_ = value; 934 bitField0_ |= 0x00000002; 935 onChanged(); 936 return this; 937 } 938 /** 939 * 940 * 941 * <pre> 942 * Extract entities. 943 * </pre> 944 * 945 * <code>bool extract_entities = 2;</code> 946 * 947 * @return This builder for chaining. 948 */ clearExtractEntities()949 public Builder clearExtractEntities() { 950 bitField0_ = (bitField0_ & ~0x00000002); 951 extractEntities_ = false; 952 onChanged(); 953 return this; 954 } 955 956 private boolean extractDocumentSentiment_; 957 /** 958 * 959 * 960 * <pre> 961 * Extract document-level sentiment. 962 * </pre> 963 * 964 * <code>bool extract_document_sentiment = 3;</code> 965 * 966 * @return The extractDocumentSentiment. 967 */ 968 @java.lang.Override getExtractDocumentSentiment()969 public boolean getExtractDocumentSentiment() { 970 return extractDocumentSentiment_; 971 } 972 /** 973 * 974 * 975 * <pre> 976 * Extract document-level sentiment. 977 * </pre> 978 * 979 * <code>bool extract_document_sentiment = 3;</code> 980 * 981 * @param value The extractDocumentSentiment to set. 982 * @return This builder for chaining. 983 */ setExtractDocumentSentiment(boolean value)984 public Builder setExtractDocumentSentiment(boolean value) { 985 986 extractDocumentSentiment_ = value; 987 bitField0_ |= 0x00000004; 988 onChanged(); 989 return this; 990 } 991 /** 992 * 993 * 994 * <pre> 995 * Extract document-level sentiment. 996 * </pre> 997 * 998 * <code>bool extract_document_sentiment = 3;</code> 999 * 1000 * @return This builder for chaining. 1001 */ clearExtractDocumentSentiment()1002 public Builder clearExtractDocumentSentiment() { 1003 bitField0_ = (bitField0_ & ~0x00000004); 1004 extractDocumentSentiment_ = false; 1005 onChanged(); 1006 return this; 1007 } 1008 1009 private boolean extractEntitySentiment_; 1010 /** 1011 * 1012 * 1013 * <pre> 1014 * Extract entities and their associated sentiment. 1015 * </pre> 1016 * 1017 * <code>bool extract_entity_sentiment = 4;</code> 1018 * 1019 * @return The extractEntitySentiment. 1020 */ 1021 @java.lang.Override getExtractEntitySentiment()1022 public boolean getExtractEntitySentiment() { 1023 return extractEntitySentiment_; 1024 } 1025 /** 1026 * 1027 * 1028 * <pre> 1029 * Extract entities and their associated sentiment. 1030 * </pre> 1031 * 1032 * <code>bool extract_entity_sentiment = 4;</code> 1033 * 1034 * @param value The extractEntitySentiment to set. 1035 * @return This builder for chaining. 1036 */ setExtractEntitySentiment(boolean value)1037 public Builder setExtractEntitySentiment(boolean value) { 1038 1039 extractEntitySentiment_ = value; 1040 bitField0_ |= 0x00000008; 1041 onChanged(); 1042 return this; 1043 } 1044 /** 1045 * 1046 * 1047 * <pre> 1048 * Extract entities and their associated sentiment. 1049 * </pre> 1050 * 1051 * <code>bool extract_entity_sentiment = 4;</code> 1052 * 1053 * @return This builder for chaining. 1054 */ clearExtractEntitySentiment()1055 public Builder clearExtractEntitySentiment() { 1056 bitField0_ = (bitField0_ & ~0x00000008); 1057 extractEntitySentiment_ = false; 1058 onChanged(); 1059 return this; 1060 } 1061 1062 private boolean classifyText_; 1063 /** 1064 * 1065 * 1066 * <pre> 1067 * Classify the full document into categories. 1068 * </pre> 1069 * 1070 * <code>bool classify_text = 6;</code> 1071 * 1072 * @return The classifyText. 1073 */ 1074 @java.lang.Override getClassifyText()1075 public boolean getClassifyText() { 1076 return classifyText_; 1077 } 1078 /** 1079 * 1080 * 1081 * <pre> 1082 * Classify the full document into categories. 1083 * </pre> 1084 * 1085 * <code>bool classify_text = 6;</code> 1086 * 1087 * @param value The classifyText to set. 1088 * @return This builder for chaining. 1089 */ setClassifyText(boolean value)1090 public Builder setClassifyText(boolean value) { 1091 1092 classifyText_ = value; 1093 bitField0_ |= 0x00000010; 1094 onChanged(); 1095 return this; 1096 } 1097 /** 1098 * 1099 * 1100 * <pre> 1101 * Classify the full document into categories. 1102 * </pre> 1103 * 1104 * <code>bool classify_text = 6;</code> 1105 * 1106 * @return This builder for chaining. 1107 */ clearClassifyText()1108 public Builder clearClassifyText() { 1109 bitField0_ = (bitField0_ & ~0x00000010); 1110 classifyText_ = false; 1111 onChanged(); 1112 return this; 1113 } 1114 1115 private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; 1116 private com.google.protobuf.SingleFieldBuilderV3< 1117 com.google.cloud.language.v1.ClassificationModelOptions, 1118 com.google.cloud.language.v1.ClassificationModelOptions.Builder, 1119 com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> 1120 classificationModelOptionsBuilder_; 1121 /** 1122 * 1123 * 1124 * <pre> 1125 * The model options to use for classification. Defaults to v1 options 1126 * if not specified. Only used if `classify_text` is set to true. 1127 * </pre> 1128 * 1129 * <code> 1130 * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 1131 * </code> 1132 * 1133 * @return Whether the classificationModelOptions field is set. 1134 */ hasClassificationModelOptions()1135 public boolean hasClassificationModelOptions() { 1136 return ((bitField0_ & 0x00000020) != 0); 1137 } 1138 /** 1139 * 1140 * 1141 * <pre> 1142 * The model options to use for classification. Defaults to v1 options 1143 * if not specified. Only used if `classify_text` is set to true. 1144 * </pre> 1145 * 1146 * <code> 1147 * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 1148 * </code> 1149 * 1150 * @return The classificationModelOptions. 1151 */ 1152 public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions()1153 getClassificationModelOptions() { 1154 if (classificationModelOptionsBuilder_ == null) { 1155 return classificationModelOptions_ == null 1156 ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() 1157 : classificationModelOptions_; 1158 } else { 1159 return classificationModelOptionsBuilder_.getMessage(); 1160 } 1161 } 1162 /** 1163 * 1164 * 1165 * <pre> 1166 * The model options to use for classification. Defaults to v1 options 1167 * if not specified. Only used if `classify_text` is set to true. 1168 * </pre> 1169 * 1170 * <code> 1171 * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 1172 * </code> 1173 */ setClassificationModelOptions( com.google.cloud.language.v1.ClassificationModelOptions value)1174 public Builder setClassificationModelOptions( 1175 com.google.cloud.language.v1.ClassificationModelOptions value) { 1176 if (classificationModelOptionsBuilder_ == null) { 1177 if (value == null) { 1178 throw new NullPointerException(); 1179 } 1180 classificationModelOptions_ = value; 1181 } else { 1182 classificationModelOptionsBuilder_.setMessage(value); 1183 } 1184 bitField0_ |= 0x00000020; 1185 onChanged(); 1186 return this; 1187 } 1188 /** 1189 * 1190 * 1191 * <pre> 1192 * The model options to use for classification. Defaults to v1 options 1193 * if not specified. Only used if `classify_text` is set to true. 1194 * </pre> 1195 * 1196 * <code> 1197 * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 1198 * </code> 1199 */ setClassificationModelOptions( com.google.cloud.language.v1.ClassificationModelOptions.Builder builderForValue)1200 public Builder setClassificationModelOptions( 1201 com.google.cloud.language.v1.ClassificationModelOptions.Builder builderForValue) { 1202 if (classificationModelOptionsBuilder_ == null) { 1203 classificationModelOptions_ = builderForValue.build(); 1204 } else { 1205 classificationModelOptionsBuilder_.setMessage(builderForValue.build()); 1206 } 1207 bitField0_ |= 0x00000020; 1208 onChanged(); 1209 return this; 1210 } 1211 /** 1212 * 1213 * 1214 * <pre> 1215 * The model options to use for classification. Defaults to v1 options 1216 * if not specified. Only used if `classify_text` is set to true. 1217 * </pre> 1218 * 1219 * <code> 1220 * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 1221 * </code> 1222 */ mergeClassificationModelOptions( com.google.cloud.language.v1.ClassificationModelOptions value)1223 public Builder mergeClassificationModelOptions( 1224 com.google.cloud.language.v1.ClassificationModelOptions value) { 1225 if (classificationModelOptionsBuilder_ == null) { 1226 if (((bitField0_ & 0x00000020) != 0) 1227 && classificationModelOptions_ != null 1228 && classificationModelOptions_ 1229 != com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance()) { 1230 getClassificationModelOptionsBuilder().mergeFrom(value); 1231 } else { 1232 classificationModelOptions_ = value; 1233 } 1234 } else { 1235 classificationModelOptionsBuilder_.mergeFrom(value); 1236 } 1237 bitField0_ |= 0x00000020; 1238 onChanged(); 1239 return this; 1240 } 1241 /** 1242 * 1243 * 1244 * <pre> 1245 * The model options to use for classification. Defaults to v1 options 1246 * if not specified. Only used if `classify_text` is set to true. 1247 * </pre> 1248 * 1249 * <code> 1250 * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 1251 * </code> 1252 */ clearClassificationModelOptions()1253 public Builder clearClassificationModelOptions() { 1254 bitField0_ = (bitField0_ & ~0x00000020); 1255 classificationModelOptions_ = null; 1256 if (classificationModelOptionsBuilder_ != null) { 1257 classificationModelOptionsBuilder_.dispose(); 1258 classificationModelOptionsBuilder_ = null; 1259 } 1260 onChanged(); 1261 return this; 1262 } 1263 /** 1264 * 1265 * 1266 * <pre> 1267 * The model options to use for classification. Defaults to v1 options 1268 * if not specified. Only used if `classify_text` is set to true. 1269 * </pre> 1270 * 1271 * <code> 1272 * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 1273 * </code> 1274 */ 1275 public com.google.cloud.language.v1.ClassificationModelOptions.Builder getClassificationModelOptionsBuilder()1276 getClassificationModelOptionsBuilder() { 1277 bitField0_ |= 0x00000020; 1278 onChanged(); 1279 return getClassificationModelOptionsFieldBuilder().getBuilder(); 1280 } 1281 /** 1282 * 1283 * 1284 * <pre> 1285 * The model options to use for classification. Defaults to v1 options 1286 * if not specified. Only used if `classify_text` is set to true. 1287 * </pre> 1288 * 1289 * <code> 1290 * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 1291 * </code> 1292 */ 1293 public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder getClassificationModelOptionsOrBuilder()1294 getClassificationModelOptionsOrBuilder() { 1295 if (classificationModelOptionsBuilder_ != null) { 1296 return classificationModelOptionsBuilder_.getMessageOrBuilder(); 1297 } else { 1298 return classificationModelOptions_ == null 1299 ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() 1300 : classificationModelOptions_; 1301 } 1302 } 1303 /** 1304 * 1305 * 1306 * <pre> 1307 * The model options to use for classification. Defaults to v1 options 1308 * if not specified. Only used if `classify_text` is set to true. 1309 * </pre> 1310 * 1311 * <code> 1312 * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; 1313 * </code> 1314 */ 1315 private com.google.protobuf.SingleFieldBuilderV3< 1316 com.google.cloud.language.v1.ClassificationModelOptions, 1317 com.google.cloud.language.v1.ClassificationModelOptions.Builder, 1318 com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> getClassificationModelOptionsFieldBuilder()1319 getClassificationModelOptionsFieldBuilder() { 1320 if (classificationModelOptionsBuilder_ == null) { 1321 classificationModelOptionsBuilder_ = 1322 new com.google.protobuf.SingleFieldBuilderV3< 1323 com.google.cloud.language.v1.ClassificationModelOptions, 1324 com.google.cloud.language.v1.ClassificationModelOptions.Builder, 1325 com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder>( 1326 getClassificationModelOptions(), getParentForChildren(), isClean()); 1327 classificationModelOptions_ = null; 1328 } 1329 return classificationModelOptionsBuilder_; 1330 } 1331 1332 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1333 public final Builder setUnknownFields( 1334 final com.google.protobuf.UnknownFieldSet unknownFields) { 1335 return super.setUnknownFields(unknownFields); 1336 } 1337 1338 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1339 public final Builder mergeUnknownFields( 1340 final com.google.protobuf.UnknownFieldSet unknownFields) { 1341 return super.mergeUnknownFields(unknownFields); 1342 } 1343 1344 // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.AnnotateTextRequest.Features) 1345 } 1346 1347 // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnnotateTextRequest.Features) 1348 private static final com.google.cloud.language.v1.AnnotateTextRequest.Features DEFAULT_INSTANCE; 1349 1350 static { 1351 DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnnotateTextRequest.Features(); 1352 } 1353 getDefaultInstance()1354 public static com.google.cloud.language.v1.AnnotateTextRequest.Features getDefaultInstance() { 1355 return DEFAULT_INSTANCE; 1356 } 1357 1358 private static final com.google.protobuf.Parser<Features> PARSER = 1359 new com.google.protobuf.AbstractParser<Features>() { 1360 @java.lang.Override 1361 public Features parsePartialFrom( 1362 com.google.protobuf.CodedInputStream input, 1363 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1364 throws com.google.protobuf.InvalidProtocolBufferException { 1365 Builder builder = newBuilder(); 1366 try { 1367 builder.mergeFrom(input, extensionRegistry); 1368 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1369 throw e.setUnfinishedMessage(builder.buildPartial()); 1370 } catch (com.google.protobuf.UninitializedMessageException e) { 1371 throw e.asInvalidProtocolBufferException() 1372 .setUnfinishedMessage(builder.buildPartial()); 1373 } catch (java.io.IOException e) { 1374 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1375 .setUnfinishedMessage(builder.buildPartial()); 1376 } 1377 return builder.buildPartial(); 1378 } 1379 }; 1380 parser()1381 public static com.google.protobuf.Parser<Features> parser() { 1382 return PARSER; 1383 } 1384 1385 @java.lang.Override getParserForType()1386 public com.google.protobuf.Parser<Features> getParserForType() { 1387 return PARSER; 1388 } 1389 1390 @java.lang.Override getDefaultInstanceForType()1391 public com.google.cloud.language.v1.AnnotateTextRequest.Features getDefaultInstanceForType() { 1392 return DEFAULT_INSTANCE; 1393 } 1394 } 1395 1396 public static final int DOCUMENT_FIELD_NUMBER = 1; 1397 private com.google.cloud.language.v1.Document document_; 1398 /** 1399 * 1400 * 1401 * <pre> 1402 * Required. Input document. 1403 * </pre> 1404 * 1405 * <code> 1406 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 1407 * </code> 1408 * 1409 * @return Whether the document field is set. 1410 */ 1411 @java.lang.Override hasDocument()1412 public boolean hasDocument() { 1413 return document_ != null; 1414 } 1415 /** 1416 * 1417 * 1418 * <pre> 1419 * Required. Input document. 1420 * </pre> 1421 * 1422 * <code> 1423 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 1424 * </code> 1425 * 1426 * @return The document. 1427 */ 1428 @java.lang.Override getDocument()1429 public com.google.cloud.language.v1.Document getDocument() { 1430 return document_ == null 1431 ? com.google.cloud.language.v1.Document.getDefaultInstance() 1432 : document_; 1433 } 1434 /** 1435 * 1436 * 1437 * <pre> 1438 * Required. Input document. 1439 * </pre> 1440 * 1441 * <code> 1442 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 1443 * </code> 1444 */ 1445 @java.lang.Override getDocumentOrBuilder()1446 public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { 1447 return document_ == null 1448 ? com.google.cloud.language.v1.Document.getDefaultInstance() 1449 : document_; 1450 } 1451 1452 public static final int FEATURES_FIELD_NUMBER = 2; 1453 private com.google.cloud.language.v1.AnnotateTextRequest.Features features_; 1454 /** 1455 * 1456 * 1457 * <pre> 1458 * Required. The enabled features. 1459 * </pre> 1460 * 1461 * <code> 1462 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 1463 * </code> 1464 * 1465 * @return Whether the features field is set. 1466 */ 1467 @java.lang.Override hasFeatures()1468 public boolean hasFeatures() { 1469 return features_ != null; 1470 } 1471 /** 1472 * 1473 * 1474 * <pre> 1475 * Required. The enabled features. 1476 * </pre> 1477 * 1478 * <code> 1479 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 1480 * </code> 1481 * 1482 * @return The features. 1483 */ 1484 @java.lang.Override getFeatures()1485 public com.google.cloud.language.v1.AnnotateTextRequest.Features getFeatures() { 1486 return features_ == null 1487 ? com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance() 1488 : features_; 1489 } 1490 /** 1491 * 1492 * 1493 * <pre> 1494 * Required. The enabled features. 1495 * </pre> 1496 * 1497 * <code> 1498 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 1499 * </code> 1500 */ 1501 @java.lang.Override getFeaturesOrBuilder()1502 public com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder getFeaturesOrBuilder() { 1503 return features_ == null 1504 ? com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance() 1505 : features_; 1506 } 1507 1508 public static final int ENCODING_TYPE_FIELD_NUMBER = 3; 1509 private int encodingType_ = 0; 1510 /** 1511 * 1512 * 1513 * <pre> 1514 * The encoding type used by the API to calculate offsets. 1515 * </pre> 1516 * 1517 * <code>.google.cloud.language.v1.EncodingType encoding_type = 3;</code> 1518 * 1519 * @return The enum numeric value on the wire for encodingType. 1520 */ 1521 @java.lang.Override getEncodingTypeValue()1522 public int getEncodingTypeValue() { 1523 return encodingType_; 1524 } 1525 /** 1526 * 1527 * 1528 * <pre> 1529 * The encoding type used by the API to calculate offsets. 1530 * </pre> 1531 * 1532 * <code>.google.cloud.language.v1.EncodingType encoding_type = 3;</code> 1533 * 1534 * @return The encodingType. 1535 */ 1536 @java.lang.Override getEncodingType()1537 public com.google.cloud.language.v1.EncodingType getEncodingType() { 1538 com.google.cloud.language.v1.EncodingType result = 1539 com.google.cloud.language.v1.EncodingType.forNumber(encodingType_); 1540 return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; 1541 } 1542 1543 private byte memoizedIsInitialized = -1; 1544 1545 @java.lang.Override isInitialized()1546 public final boolean isInitialized() { 1547 byte isInitialized = memoizedIsInitialized; 1548 if (isInitialized == 1) return true; 1549 if (isInitialized == 0) return false; 1550 1551 memoizedIsInitialized = 1; 1552 return true; 1553 } 1554 1555 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1556 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1557 if (document_ != null) { 1558 output.writeMessage(1, getDocument()); 1559 } 1560 if (features_ != null) { 1561 output.writeMessage(2, getFeatures()); 1562 } 1563 if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { 1564 output.writeEnum(3, encodingType_); 1565 } 1566 getUnknownFields().writeTo(output); 1567 } 1568 1569 @java.lang.Override getSerializedSize()1570 public int getSerializedSize() { 1571 int size = memoizedSize; 1572 if (size != -1) return size; 1573 1574 size = 0; 1575 if (document_ != null) { 1576 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); 1577 } 1578 if (features_ != null) { 1579 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFeatures()); 1580 } 1581 if (encodingType_ != com.google.cloud.language.v1.EncodingType.NONE.getNumber()) { 1582 size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, encodingType_); 1583 } 1584 size += getUnknownFields().getSerializedSize(); 1585 memoizedSize = size; 1586 return size; 1587 } 1588 1589 @java.lang.Override equals(final java.lang.Object obj)1590 public boolean equals(final java.lang.Object obj) { 1591 if (obj == this) { 1592 return true; 1593 } 1594 if (!(obj instanceof com.google.cloud.language.v1.AnnotateTextRequest)) { 1595 return super.equals(obj); 1596 } 1597 com.google.cloud.language.v1.AnnotateTextRequest other = 1598 (com.google.cloud.language.v1.AnnotateTextRequest) obj; 1599 1600 if (hasDocument() != other.hasDocument()) return false; 1601 if (hasDocument()) { 1602 if (!getDocument().equals(other.getDocument())) return false; 1603 } 1604 if (hasFeatures() != other.hasFeatures()) return false; 1605 if (hasFeatures()) { 1606 if (!getFeatures().equals(other.getFeatures())) return false; 1607 } 1608 if (encodingType_ != other.encodingType_) return false; 1609 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1610 return true; 1611 } 1612 1613 @java.lang.Override hashCode()1614 public int hashCode() { 1615 if (memoizedHashCode != 0) { 1616 return memoizedHashCode; 1617 } 1618 int hash = 41; 1619 hash = (19 * hash) + getDescriptor().hashCode(); 1620 if (hasDocument()) { 1621 hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; 1622 hash = (53 * hash) + getDocument().hashCode(); 1623 } 1624 if (hasFeatures()) { 1625 hash = (37 * hash) + FEATURES_FIELD_NUMBER; 1626 hash = (53 * hash) + getFeatures().hashCode(); 1627 } 1628 hash = (37 * hash) + ENCODING_TYPE_FIELD_NUMBER; 1629 hash = (53 * hash) + encodingType_; 1630 hash = (29 * hash) + getUnknownFields().hashCode(); 1631 memoizedHashCode = hash; 1632 return hash; 1633 } 1634 parseFrom(java.nio.ByteBuffer data)1635 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom(java.nio.ByteBuffer data) 1636 throws com.google.protobuf.InvalidProtocolBufferException { 1637 return PARSER.parseFrom(data); 1638 } 1639 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1640 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( 1641 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1642 throws com.google.protobuf.InvalidProtocolBufferException { 1643 return PARSER.parseFrom(data, extensionRegistry); 1644 } 1645 parseFrom( com.google.protobuf.ByteString data)1646 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( 1647 com.google.protobuf.ByteString data) 1648 throws com.google.protobuf.InvalidProtocolBufferException { 1649 return PARSER.parseFrom(data); 1650 } 1651 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1652 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( 1653 com.google.protobuf.ByteString data, 1654 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1655 throws com.google.protobuf.InvalidProtocolBufferException { 1656 return PARSER.parseFrom(data, extensionRegistry); 1657 } 1658 parseFrom(byte[] data)1659 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom(byte[] data) 1660 throws com.google.protobuf.InvalidProtocolBufferException { 1661 return PARSER.parseFrom(data); 1662 } 1663 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1664 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( 1665 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1666 throws com.google.protobuf.InvalidProtocolBufferException { 1667 return PARSER.parseFrom(data, extensionRegistry); 1668 } 1669 parseFrom( java.io.InputStream input)1670 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( 1671 java.io.InputStream input) throws java.io.IOException { 1672 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1673 } 1674 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1675 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( 1676 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1677 throws java.io.IOException { 1678 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1679 PARSER, input, extensionRegistry); 1680 } 1681 parseDelimitedFrom( java.io.InputStream input)1682 public static com.google.cloud.language.v1.AnnotateTextRequest parseDelimitedFrom( 1683 java.io.InputStream input) throws java.io.IOException { 1684 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1685 } 1686 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1687 public static com.google.cloud.language.v1.AnnotateTextRequest parseDelimitedFrom( 1688 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1689 throws java.io.IOException { 1690 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1691 PARSER, input, extensionRegistry); 1692 } 1693 parseFrom( com.google.protobuf.CodedInputStream input)1694 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( 1695 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1696 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1697 } 1698 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1699 public static com.google.cloud.language.v1.AnnotateTextRequest parseFrom( 1700 com.google.protobuf.CodedInputStream input, 1701 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1702 throws java.io.IOException { 1703 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1704 PARSER, input, extensionRegistry); 1705 } 1706 1707 @java.lang.Override newBuilderForType()1708 public Builder newBuilderForType() { 1709 return newBuilder(); 1710 } 1711 newBuilder()1712 public static Builder newBuilder() { 1713 return DEFAULT_INSTANCE.toBuilder(); 1714 } 1715 newBuilder(com.google.cloud.language.v1.AnnotateTextRequest prototype)1716 public static Builder newBuilder(com.google.cloud.language.v1.AnnotateTextRequest prototype) { 1717 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1718 } 1719 1720 @java.lang.Override toBuilder()1721 public Builder toBuilder() { 1722 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1723 } 1724 1725 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1726 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1727 Builder builder = new Builder(parent); 1728 return builder; 1729 } 1730 /** 1731 * 1732 * 1733 * <pre> 1734 * The request message for the text annotation API, which can perform multiple 1735 * analysis types (sentiment, entities, and syntax) in one call. 1736 * </pre> 1737 * 1738 * Protobuf type {@code google.cloud.language.v1.AnnotateTextRequest} 1739 */ 1740 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1741 implements 1742 // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.AnnotateTextRequest) 1743 com.google.cloud.language.v1.AnnotateTextRequestOrBuilder { getDescriptor()1744 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1745 return com.google.cloud.language.v1.LanguageServiceProto 1746 .internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor; 1747 } 1748 1749 @java.lang.Override 1750 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1751 internalGetFieldAccessorTable() { 1752 return com.google.cloud.language.v1.LanguageServiceProto 1753 .internal_static_google_cloud_language_v1_AnnotateTextRequest_fieldAccessorTable 1754 .ensureFieldAccessorsInitialized( 1755 com.google.cloud.language.v1.AnnotateTextRequest.class, 1756 com.google.cloud.language.v1.AnnotateTextRequest.Builder.class); 1757 } 1758 1759 // Construct using com.google.cloud.language.v1.AnnotateTextRequest.newBuilder() Builder()1760 private Builder() {} 1761 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1762 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1763 super(parent); 1764 } 1765 1766 @java.lang.Override clear()1767 public Builder clear() { 1768 super.clear(); 1769 bitField0_ = 0; 1770 document_ = null; 1771 if (documentBuilder_ != null) { 1772 documentBuilder_.dispose(); 1773 documentBuilder_ = null; 1774 } 1775 features_ = null; 1776 if (featuresBuilder_ != null) { 1777 featuresBuilder_.dispose(); 1778 featuresBuilder_ = null; 1779 } 1780 encodingType_ = 0; 1781 return this; 1782 } 1783 1784 @java.lang.Override getDescriptorForType()1785 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1786 return com.google.cloud.language.v1.LanguageServiceProto 1787 .internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor; 1788 } 1789 1790 @java.lang.Override getDefaultInstanceForType()1791 public com.google.cloud.language.v1.AnnotateTextRequest getDefaultInstanceForType() { 1792 return com.google.cloud.language.v1.AnnotateTextRequest.getDefaultInstance(); 1793 } 1794 1795 @java.lang.Override build()1796 public com.google.cloud.language.v1.AnnotateTextRequest build() { 1797 com.google.cloud.language.v1.AnnotateTextRequest result = buildPartial(); 1798 if (!result.isInitialized()) { 1799 throw newUninitializedMessageException(result); 1800 } 1801 return result; 1802 } 1803 1804 @java.lang.Override buildPartial()1805 public com.google.cloud.language.v1.AnnotateTextRequest buildPartial() { 1806 com.google.cloud.language.v1.AnnotateTextRequest result = 1807 new com.google.cloud.language.v1.AnnotateTextRequest(this); 1808 if (bitField0_ != 0) { 1809 buildPartial0(result); 1810 } 1811 onBuilt(); 1812 return result; 1813 } 1814 buildPartial0(com.google.cloud.language.v1.AnnotateTextRequest result)1815 private void buildPartial0(com.google.cloud.language.v1.AnnotateTextRequest result) { 1816 int from_bitField0_ = bitField0_; 1817 if (((from_bitField0_ & 0x00000001) != 0)) { 1818 result.document_ = documentBuilder_ == null ? document_ : documentBuilder_.build(); 1819 } 1820 if (((from_bitField0_ & 0x00000002) != 0)) { 1821 result.features_ = featuresBuilder_ == null ? features_ : featuresBuilder_.build(); 1822 } 1823 if (((from_bitField0_ & 0x00000004) != 0)) { 1824 result.encodingType_ = encodingType_; 1825 } 1826 } 1827 1828 @java.lang.Override clone()1829 public Builder clone() { 1830 return super.clone(); 1831 } 1832 1833 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1834 public Builder setField( 1835 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1836 return super.setField(field, value); 1837 } 1838 1839 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1840 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1841 return super.clearField(field); 1842 } 1843 1844 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1845 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1846 return super.clearOneof(oneof); 1847 } 1848 1849 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1850 public Builder setRepeatedField( 1851 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 1852 return super.setRepeatedField(field, index, value); 1853 } 1854 1855 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1856 public Builder addRepeatedField( 1857 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1858 return super.addRepeatedField(field, value); 1859 } 1860 1861 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1862 public Builder mergeFrom(com.google.protobuf.Message other) { 1863 if (other instanceof com.google.cloud.language.v1.AnnotateTextRequest) { 1864 return mergeFrom((com.google.cloud.language.v1.AnnotateTextRequest) other); 1865 } else { 1866 super.mergeFrom(other); 1867 return this; 1868 } 1869 } 1870 mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest other)1871 public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest other) { 1872 if (other == com.google.cloud.language.v1.AnnotateTextRequest.getDefaultInstance()) 1873 return this; 1874 if (other.hasDocument()) { 1875 mergeDocument(other.getDocument()); 1876 } 1877 if (other.hasFeatures()) { 1878 mergeFeatures(other.getFeatures()); 1879 } 1880 if (other.encodingType_ != 0) { 1881 setEncodingTypeValue(other.getEncodingTypeValue()); 1882 } 1883 this.mergeUnknownFields(other.getUnknownFields()); 1884 onChanged(); 1885 return this; 1886 } 1887 1888 @java.lang.Override isInitialized()1889 public final boolean isInitialized() { 1890 return true; 1891 } 1892 1893 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1894 public Builder mergeFrom( 1895 com.google.protobuf.CodedInputStream input, 1896 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1897 throws java.io.IOException { 1898 if (extensionRegistry == null) { 1899 throw new java.lang.NullPointerException(); 1900 } 1901 try { 1902 boolean done = false; 1903 while (!done) { 1904 int tag = input.readTag(); 1905 switch (tag) { 1906 case 0: 1907 done = true; 1908 break; 1909 case 10: 1910 { 1911 input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); 1912 bitField0_ |= 0x00000001; 1913 break; 1914 } // case 10 1915 case 18: 1916 { 1917 input.readMessage(getFeaturesFieldBuilder().getBuilder(), extensionRegistry); 1918 bitField0_ |= 0x00000002; 1919 break; 1920 } // case 18 1921 case 24: 1922 { 1923 encodingType_ = input.readEnum(); 1924 bitField0_ |= 0x00000004; 1925 break; 1926 } // case 24 1927 default: 1928 { 1929 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1930 done = true; // was an endgroup tag 1931 } 1932 break; 1933 } // default: 1934 } // switch (tag) 1935 } // while (!done) 1936 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1937 throw e.unwrapIOException(); 1938 } finally { 1939 onChanged(); 1940 } // finally 1941 return this; 1942 } 1943 1944 private int bitField0_; 1945 1946 private com.google.cloud.language.v1.Document document_; 1947 private com.google.protobuf.SingleFieldBuilderV3< 1948 com.google.cloud.language.v1.Document, 1949 com.google.cloud.language.v1.Document.Builder, 1950 com.google.cloud.language.v1.DocumentOrBuilder> 1951 documentBuilder_; 1952 /** 1953 * 1954 * 1955 * <pre> 1956 * Required. Input document. 1957 * </pre> 1958 * 1959 * <code> 1960 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 1961 * </code> 1962 * 1963 * @return Whether the document field is set. 1964 */ hasDocument()1965 public boolean hasDocument() { 1966 return ((bitField0_ & 0x00000001) != 0); 1967 } 1968 /** 1969 * 1970 * 1971 * <pre> 1972 * Required. Input document. 1973 * </pre> 1974 * 1975 * <code> 1976 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 1977 * </code> 1978 * 1979 * @return The document. 1980 */ getDocument()1981 public com.google.cloud.language.v1.Document getDocument() { 1982 if (documentBuilder_ == null) { 1983 return document_ == null 1984 ? com.google.cloud.language.v1.Document.getDefaultInstance() 1985 : document_; 1986 } else { 1987 return documentBuilder_.getMessage(); 1988 } 1989 } 1990 /** 1991 * 1992 * 1993 * <pre> 1994 * Required. Input document. 1995 * </pre> 1996 * 1997 * <code> 1998 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 1999 * </code> 2000 */ setDocument(com.google.cloud.language.v1.Document value)2001 public Builder setDocument(com.google.cloud.language.v1.Document value) { 2002 if (documentBuilder_ == null) { 2003 if (value == null) { 2004 throw new NullPointerException(); 2005 } 2006 document_ = value; 2007 } else { 2008 documentBuilder_.setMessage(value); 2009 } 2010 bitField0_ |= 0x00000001; 2011 onChanged(); 2012 return this; 2013 } 2014 /** 2015 * 2016 * 2017 * <pre> 2018 * Required. Input document. 2019 * </pre> 2020 * 2021 * <code> 2022 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 2023 * </code> 2024 */ setDocument(com.google.cloud.language.v1.Document.Builder builderForValue)2025 public Builder setDocument(com.google.cloud.language.v1.Document.Builder builderForValue) { 2026 if (documentBuilder_ == null) { 2027 document_ = builderForValue.build(); 2028 } else { 2029 documentBuilder_.setMessage(builderForValue.build()); 2030 } 2031 bitField0_ |= 0x00000001; 2032 onChanged(); 2033 return this; 2034 } 2035 /** 2036 * 2037 * 2038 * <pre> 2039 * Required. Input document. 2040 * </pre> 2041 * 2042 * <code> 2043 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 2044 * </code> 2045 */ mergeDocument(com.google.cloud.language.v1.Document value)2046 public Builder mergeDocument(com.google.cloud.language.v1.Document value) { 2047 if (documentBuilder_ == null) { 2048 if (((bitField0_ & 0x00000001) != 0) 2049 && document_ != null 2050 && document_ != com.google.cloud.language.v1.Document.getDefaultInstance()) { 2051 getDocumentBuilder().mergeFrom(value); 2052 } else { 2053 document_ = value; 2054 } 2055 } else { 2056 documentBuilder_.mergeFrom(value); 2057 } 2058 bitField0_ |= 0x00000001; 2059 onChanged(); 2060 return this; 2061 } 2062 /** 2063 * 2064 * 2065 * <pre> 2066 * Required. Input document. 2067 * </pre> 2068 * 2069 * <code> 2070 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 2071 * </code> 2072 */ clearDocument()2073 public Builder clearDocument() { 2074 bitField0_ = (bitField0_ & ~0x00000001); 2075 document_ = null; 2076 if (documentBuilder_ != null) { 2077 documentBuilder_.dispose(); 2078 documentBuilder_ = null; 2079 } 2080 onChanged(); 2081 return this; 2082 } 2083 /** 2084 * 2085 * 2086 * <pre> 2087 * Required. Input document. 2088 * </pre> 2089 * 2090 * <code> 2091 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 2092 * </code> 2093 */ getDocumentBuilder()2094 public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { 2095 bitField0_ |= 0x00000001; 2096 onChanged(); 2097 return getDocumentFieldBuilder().getBuilder(); 2098 } 2099 /** 2100 * 2101 * 2102 * <pre> 2103 * Required. Input document. 2104 * </pre> 2105 * 2106 * <code> 2107 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 2108 * </code> 2109 */ getDocumentOrBuilder()2110 public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { 2111 if (documentBuilder_ != null) { 2112 return documentBuilder_.getMessageOrBuilder(); 2113 } else { 2114 return document_ == null 2115 ? com.google.cloud.language.v1.Document.getDefaultInstance() 2116 : document_; 2117 } 2118 } 2119 /** 2120 * 2121 * 2122 * <pre> 2123 * Required. Input document. 2124 * </pre> 2125 * 2126 * <code> 2127 * .google.cloud.language.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; 2128 * </code> 2129 */ 2130 private com.google.protobuf.SingleFieldBuilderV3< 2131 com.google.cloud.language.v1.Document, 2132 com.google.cloud.language.v1.Document.Builder, 2133 com.google.cloud.language.v1.DocumentOrBuilder> getDocumentFieldBuilder()2134 getDocumentFieldBuilder() { 2135 if (documentBuilder_ == null) { 2136 documentBuilder_ = 2137 new com.google.protobuf.SingleFieldBuilderV3< 2138 com.google.cloud.language.v1.Document, 2139 com.google.cloud.language.v1.Document.Builder, 2140 com.google.cloud.language.v1.DocumentOrBuilder>( 2141 getDocument(), getParentForChildren(), isClean()); 2142 document_ = null; 2143 } 2144 return documentBuilder_; 2145 } 2146 2147 private com.google.cloud.language.v1.AnnotateTextRequest.Features features_; 2148 private com.google.protobuf.SingleFieldBuilderV3< 2149 com.google.cloud.language.v1.AnnotateTextRequest.Features, 2150 com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder, 2151 com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder> 2152 featuresBuilder_; 2153 /** 2154 * 2155 * 2156 * <pre> 2157 * Required. The enabled features. 2158 * </pre> 2159 * 2160 * <code> 2161 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 2162 * </code> 2163 * 2164 * @return Whether the features field is set. 2165 */ hasFeatures()2166 public boolean hasFeatures() { 2167 return ((bitField0_ & 0x00000002) != 0); 2168 } 2169 /** 2170 * 2171 * 2172 * <pre> 2173 * Required. The enabled features. 2174 * </pre> 2175 * 2176 * <code> 2177 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 2178 * </code> 2179 * 2180 * @return The features. 2181 */ getFeatures()2182 public com.google.cloud.language.v1.AnnotateTextRequest.Features getFeatures() { 2183 if (featuresBuilder_ == null) { 2184 return features_ == null 2185 ? com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance() 2186 : features_; 2187 } else { 2188 return featuresBuilder_.getMessage(); 2189 } 2190 } 2191 /** 2192 * 2193 * 2194 * <pre> 2195 * Required. The enabled features. 2196 * </pre> 2197 * 2198 * <code> 2199 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 2200 * </code> 2201 */ setFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Features value)2202 public Builder setFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Features value) { 2203 if (featuresBuilder_ == null) { 2204 if (value == null) { 2205 throw new NullPointerException(); 2206 } 2207 features_ = value; 2208 } else { 2209 featuresBuilder_.setMessage(value); 2210 } 2211 bitField0_ |= 0x00000002; 2212 onChanged(); 2213 return this; 2214 } 2215 /** 2216 * 2217 * 2218 * <pre> 2219 * Required. The enabled features. 2220 * </pre> 2221 * 2222 * <code> 2223 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 2224 * </code> 2225 */ setFeatures( com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder builderForValue)2226 public Builder setFeatures( 2227 com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder builderForValue) { 2228 if (featuresBuilder_ == null) { 2229 features_ = builderForValue.build(); 2230 } else { 2231 featuresBuilder_.setMessage(builderForValue.build()); 2232 } 2233 bitField0_ |= 0x00000002; 2234 onChanged(); 2235 return this; 2236 } 2237 /** 2238 * 2239 * 2240 * <pre> 2241 * Required. The enabled features. 2242 * </pre> 2243 * 2244 * <code> 2245 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 2246 * </code> 2247 */ mergeFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Features value)2248 public Builder mergeFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Features value) { 2249 if (featuresBuilder_ == null) { 2250 if (((bitField0_ & 0x00000002) != 0) 2251 && features_ != null 2252 && features_ 2253 != com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance()) { 2254 getFeaturesBuilder().mergeFrom(value); 2255 } else { 2256 features_ = value; 2257 } 2258 } else { 2259 featuresBuilder_.mergeFrom(value); 2260 } 2261 bitField0_ |= 0x00000002; 2262 onChanged(); 2263 return this; 2264 } 2265 /** 2266 * 2267 * 2268 * <pre> 2269 * Required. The enabled features. 2270 * </pre> 2271 * 2272 * <code> 2273 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 2274 * </code> 2275 */ clearFeatures()2276 public Builder clearFeatures() { 2277 bitField0_ = (bitField0_ & ~0x00000002); 2278 features_ = null; 2279 if (featuresBuilder_ != null) { 2280 featuresBuilder_.dispose(); 2281 featuresBuilder_ = null; 2282 } 2283 onChanged(); 2284 return this; 2285 } 2286 /** 2287 * 2288 * 2289 * <pre> 2290 * Required. The enabled features. 2291 * </pre> 2292 * 2293 * <code> 2294 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 2295 * </code> 2296 */ getFeaturesBuilder()2297 public com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder getFeaturesBuilder() { 2298 bitField0_ |= 0x00000002; 2299 onChanged(); 2300 return getFeaturesFieldBuilder().getBuilder(); 2301 } 2302 /** 2303 * 2304 * 2305 * <pre> 2306 * Required. The enabled features. 2307 * </pre> 2308 * 2309 * <code> 2310 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 2311 * </code> 2312 */ 2313 public com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder getFeaturesOrBuilder()2314 getFeaturesOrBuilder() { 2315 if (featuresBuilder_ != null) { 2316 return featuresBuilder_.getMessageOrBuilder(); 2317 } else { 2318 return features_ == null 2319 ? com.google.cloud.language.v1.AnnotateTextRequest.Features.getDefaultInstance() 2320 : features_; 2321 } 2322 } 2323 /** 2324 * 2325 * 2326 * <pre> 2327 * Required. The enabled features. 2328 * </pre> 2329 * 2330 * <code> 2331 * .google.cloud.language.v1.AnnotateTextRequest.Features features = 2 [(.google.api.field_behavior) = REQUIRED]; 2332 * </code> 2333 */ 2334 private com.google.protobuf.SingleFieldBuilderV3< 2335 com.google.cloud.language.v1.AnnotateTextRequest.Features, 2336 com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder, 2337 com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder> getFeaturesFieldBuilder()2338 getFeaturesFieldBuilder() { 2339 if (featuresBuilder_ == null) { 2340 featuresBuilder_ = 2341 new com.google.protobuf.SingleFieldBuilderV3< 2342 com.google.cloud.language.v1.AnnotateTextRequest.Features, 2343 com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder, 2344 com.google.cloud.language.v1.AnnotateTextRequest.FeaturesOrBuilder>( 2345 getFeatures(), getParentForChildren(), isClean()); 2346 features_ = null; 2347 } 2348 return featuresBuilder_; 2349 } 2350 2351 private int encodingType_ = 0; 2352 /** 2353 * 2354 * 2355 * <pre> 2356 * The encoding type used by the API to calculate offsets. 2357 * </pre> 2358 * 2359 * <code>.google.cloud.language.v1.EncodingType encoding_type = 3;</code> 2360 * 2361 * @return The enum numeric value on the wire for encodingType. 2362 */ 2363 @java.lang.Override getEncodingTypeValue()2364 public int getEncodingTypeValue() { 2365 return encodingType_; 2366 } 2367 /** 2368 * 2369 * 2370 * <pre> 2371 * The encoding type used by the API to calculate offsets. 2372 * </pre> 2373 * 2374 * <code>.google.cloud.language.v1.EncodingType encoding_type = 3;</code> 2375 * 2376 * @param value The enum numeric value on the wire for encodingType to set. 2377 * @return This builder for chaining. 2378 */ setEncodingTypeValue(int value)2379 public Builder setEncodingTypeValue(int value) { 2380 encodingType_ = value; 2381 bitField0_ |= 0x00000004; 2382 onChanged(); 2383 return this; 2384 } 2385 /** 2386 * 2387 * 2388 * <pre> 2389 * The encoding type used by the API to calculate offsets. 2390 * </pre> 2391 * 2392 * <code>.google.cloud.language.v1.EncodingType encoding_type = 3;</code> 2393 * 2394 * @return The encodingType. 2395 */ 2396 @java.lang.Override getEncodingType()2397 public com.google.cloud.language.v1.EncodingType getEncodingType() { 2398 com.google.cloud.language.v1.EncodingType result = 2399 com.google.cloud.language.v1.EncodingType.forNumber(encodingType_); 2400 return result == null ? com.google.cloud.language.v1.EncodingType.UNRECOGNIZED : result; 2401 } 2402 /** 2403 * 2404 * 2405 * <pre> 2406 * The encoding type used by the API to calculate offsets. 2407 * </pre> 2408 * 2409 * <code>.google.cloud.language.v1.EncodingType encoding_type = 3;</code> 2410 * 2411 * @param value The encodingType to set. 2412 * @return This builder for chaining. 2413 */ setEncodingType(com.google.cloud.language.v1.EncodingType value)2414 public Builder setEncodingType(com.google.cloud.language.v1.EncodingType value) { 2415 if (value == null) { 2416 throw new NullPointerException(); 2417 } 2418 bitField0_ |= 0x00000004; 2419 encodingType_ = value.getNumber(); 2420 onChanged(); 2421 return this; 2422 } 2423 /** 2424 * 2425 * 2426 * <pre> 2427 * The encoding type used by the API to calculate offsets. 2428 * </pre> 2429 * 2430 * <code>.google.cloud.language.v1.EncodingType encoding_type = 3;</code> 2431 * 2432 * @return This builder for chaining. 2433 */ clearEncodingType()2434 public Builder clearEncodingType() { 2435 bitField0_ = (bitField0_ & ~0x00000004); 2436 encodingType_ = 0; 2437 onChanged(); 2438 return this; 2439 } 2440 2441 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2442 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2443 return super.setUnknownFields(unknownFields); 2444 } 2445 2446 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2447 public final Builder mergeUnknownFields( 2448 final com.google.protobuf.UnknownFieldSet unknownFields) { 2449 return super.mergeUnknownFields(unknownFields); 2450 } 2451 2452 // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.AnnotateTextRequest) 2453 } 2454 2455 // @@protoc_insertion_point(class_scope:google.cloud.language.v1.AnnotateTextRequest) 2456 private static final com.google.cloud.language.v1.AnnotateTextRequest DEFAULT_INSTANCE; 2457 2458 static { 2459 DEFAULT_INSTANCE = new com.google.cloud.language.v1.AnnotateTextRequest(); 2460 } 2461 getDefaultInstance()2462 public static com.google.cloud.language.v1.AnnotateTextRequest getDefaultInstance() { 2463 return DEFAULT_INSTANCE; 2464 } 2465 2466 private static final com.google.protobuf.Parser<AnnotateTextRequest> PARSER = 2467 new com.google.protobuf.AbstractParser<AnnotateTextRequest>() { 2468 @java.lang.Override 2469 public AnnotateTextRequest parsePartialFrom( 2470 com.google.protobuf.CodedInputStream input, 2471 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2472 throws com.google.protobuf.InvalidProtocolBufferException { 2473 Builder builder = newBuilder(); 2474 try { 2475 builder.mergeFrom(input, extensionRegistry); 2476 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2477 throw e.setUnfinishedMessage(builder.buildPartial()); 2478 } catch (com.google.protobuf.UninitializedMessageException e) { 2479 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 2480 } catch (java.io.IOException e) { 2481 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2482 .setUnfinishedMessage(builder.buildPartial()); 2483 } 2484 return builder.buildPartial(); 2485 } 2486 }; 2487 parser()2488 public static com.google.protobuf.Parser<AnnotateTextRequest> parser() { 2489 return PARSER; 2490 } 2491 2492 @java.lang.Override getParserForType()2493 public com.google.protobuf.Parser<AnnotateTextRequest> getParserForType() { 2494 return PARSER; 2495 } 2496 2497 @java.lang.Override getDefaultInstanceForType()2498 public com.google.cloud.language.v1.AnnotateTextRequest getDefaultInstanceForType() { 2499 return DEFAULT_INSTANCE; 2500 } 2501 } 2502