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