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/automl/v1/data_items.proto 18 19 package com.google.cloud.automl.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A structured text document e.g. a PDF. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.automl.v1.Document} 29 */ 30 public final class Document extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.Document) 33 DocumentOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use Document.newBuilder() to construct. Document(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private Document(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 Document()40 private Document() { 41 layout_ = java.util.Collections.emptyList(); 42 } 43 44 @java.lang.Override 45 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)46 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 47 return new Document(); 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.automl.v1.DataItems 57 .internal_static_google_cloud_automl_v1_Document_descriptor; 58 } 59 60 @java.lang.Override 61 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()62 internalGetFieldAccessorTable() { 63 return com.google.cloud.automl.v1.DataItems 64 .internal_static_google_cloud_automl_v1_Document_fieldAccessorTable 65 .ensureFieldAccessorsInitialized( 66 com.google.cloud.automl.v1.Document.class, 67 com.google.cloud.automl.v1.Document.Builder.class); 68 } 69 70 public interface LayoutOrBuilder 71 extends 72 // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.Document.Layout) 73 com.google.protobuf.MessageOrBuilder { 74 75 /** 76 * 77 * 78 * <pre> 79 * Text Segment that represents a segment in 80 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 81 * </pre> 82 * 83 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 84 * 85 * @return Whether the textSegment field is set. 86 */ hasTextSegment()87 boolean hasTextSegment(); 88 /** 89 * 90 * 91 * <pre> 92 * Text Segment that represents a segment in 93 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 94 * </pre> 95 * 96 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 97 * 98 * @return The textSegment. 99 */ getTextSegment()100 com.google.cloud.automl.v1.TextSegment getTextSegment(); 101 /** 102 * 103 * 104 * <pre> 105 * Text Segment that represents a segment in 106 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 107 * </pre> 108 * 109 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 110 */ getTextSegmentOrBuilder()111 com.google.cloud.automl.v1.TextSegmentOrBuilder getTextSegmentOrBuilder(); 112 113 /** 114 * 115 * 116 * <pre> 117 * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts 118 * from 1. 119 * </pre> 120 * 121 * <code>int32 page_number = 2;</code> 122 * 123 * @return The pageNumber. 124 */ getPageNumber()125 int getPageNumber(); 126 127 /** 128 * 129 * 130 * <pre> 131 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 132 * Contains exactly 4 133 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 134 * and they are connected by edges in the order provided, which will 135 * represent a rectangle parallel to the frame. The 136 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 137 * relative to the page. 138 * Coordinates are based on top-left as point (0,0). 139 * </pre> 140 * 141 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 142 * 143 * @return Whether the boundingPoly field is set. 144 */ hasBoundingPoly()145 boolean hasBoundingPoly(); 146 /** 147 * 148 * 149 * <pre> 150 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 151 * Contains exactly 4 152 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 153 * and they are connected by edges in the order provided, which will 154 * represent a rectangle parallel to the frame. The 155 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 156 * relative to the page. 157 * Coordinates are based on top-left as point (0,0). 158 * </pre> 159 * 160 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 161 * 162 * @return The boundingPoly. 163 */ getBoundingPoly()164 com.google.cloud.automl.v1.BoundingPoly getBoundingPoly(); 165 /** 166 * 167 * 168 * <pre> 169 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 170 * Contains exactly 4 171 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 172 * and they are connected by edges in the order provided, which will 173 * represent a rectangle parallel to the frame. The 174 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 175 * relative to the page. 176 * Coordinates are based on top-left as point (0,0). 177 * </pre> 178 * 179 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 180 */ getBoundingPolyOrBuilder()181 com.google.cloud.automl.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); 182 183 /** 184 * 185 * 186 * <pre> 187 * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. 188 * </pre> 189 * 190 * <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> 191 * 192 * @return The enum numeric value on the wire for textSegmentType. 193 */ getTextSegmentTypeValue()194 int getTextSegmentTypeValue(); 195 /** 196 * 197 * 198 * <pre> 199 * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. 200 * </pre> 201 * 202 * <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> 203 * 204 * @return The textSegmentType. 205 */ getTextSegmentType()206 com.google.cloud.automl.v1.Document.Layout.TextSegmentType getTextSegmentType(); 207 } 208 /** 209 * 210 * 211 * <pre> 212 * Describes the layout information of a [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the document. 213 * </pre> 214 * 215 * Protobuf type {@code google.cloud.automl.v1.Document.Layout} 216 */ 217 public static final class Layout extends com.google.protobuf.GeneratedMessageV3 218 implements 219 // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.Document.Layout) 220 LayoutOrBuilder { 221 private static final long serialVersionUID = 0L; 222 // Use Layout.newBuilder() to construct. Layout(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)223 private Layout(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 224 super(builder); 225 } 226 Layout()227 private Layout() { 228 textSegmentType_ = 0; 229 } 230 231 @java.lang.Override 232 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)233 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 234 return new Layout(); 235 } 236 237 @java.lang.Override getUnknownFields()238 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 239 return this.unknownFields; 240 } 241 getDescriptor()242 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 243 return com.google.cloud.automl.v1.DataItems 244 .internal_static_google_cloud_automl_v1_Document_Layout_descriptor; 245 } 246 247 @java.lang.Override 248 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()249 internalGetFieldAccessorTable() { 250 return com.google.cloud.automl.v1.DataItems 251 .internal_static_google_cloud_automl_v1_Document_Layout_fieldAccessorTable 252 .ensureFieldAccessorsInitialized( 253 com.google.cloud.automl.v1.Document.Layout.class, 254 com.google.cloud.automl.v1.Document.Layout.Builder.class); 255 } 256 257 /** 258 * 259 * 260 * <pre> 261 * The type of TextSegment in the context of the original document. 262 * </pre> 263 * 264 * Protobuf enum {@code google.cloud.automl.v1.Document.Layout.TextSegmentType} 265 */ 266 public enum TextSegmentType implements com.google.protobuf.ProtocolMessageEnum { 267 /** 268 * 269 * 270 * <pre> 271 * Should not be used. 272 * </pre> 273 * 274 * <code>TEXT_SEGMENT_TYPE_UNSPECIFIED = 0;</code> 275 */ 276 TEXT_SEGMENT_TYPE_UNSPECIFIED(0), 277 /** 278 * 279 * 280 * <pre> 281 * The text segment is a token. e.g. word. 282 * </pre> 283 * 284 * <code>TOKEN = 1;</code> 285 */ 286 TOKEN(1), 287 /** 288 * 289 * 290 * <pre> 291 * The text segment is a paragraph. 292 * </pre> 293 * 294 * <code>PARAGRAPH = 2;</code> 295 */ 296 PARAGRAPH(2), 297 /** 298 * 299 * 300 * <pre> 301 * The text segment is a form field. 302 * </pre> 303 * 304 * <code>FORM_FIELD = 3;</code> 305 */ 306 FORM_FIELD(3), 307 /** 308 * 309 * 310 * <pre> 311 * The text segment is the name part of a form field. It will be treated 312 * as child of another FORM_FIELD TextSegment if its span is subspan of 313 * another TextSegment with type FORM_FIELD. 314 * </pre> 315 * 316 * <code>FORM_FIELD_NAME = 4;</code> 317 */ 318 FORM_FIELD_NAME(4), 319 /** 320 * 321 * 322 * <pre> 323 * The text segment is the text content part of a form field. It will be 324 * treated as child of another FORM_FIELD TextSegment if its span is 325 * subspan of another TextSegment with type FORM_FIELD. 326 * </pre> 327 * 328 * <code>FORM_FIELD_CONTENTS = 5;</code> 329 */ 330 FORM_FIELD_CONTENTS(5), 331 /** 332 * 333 * 334 * <pre> 335 * The text segment is a whole table, including headers, and all rows. 336 * </pre> 337 * 338 * <code>TABLE = 6;</code> 339 */ 340 TABLE(6), 341 /** 342 * 343 * 344 * <pre> 345 * The text segment is a table's headers. It will be treated as child of 346 * another TABLE TextSegment if its span is subspan of another TextSegment 347 * with type TABLE. 348 * </pre> 349 * 350 * <code>TABLE_HEADER = 7;</code> 351 */ 352 TABLE_HEADER(7), 353 /** 354 * 355 * 356 * <pre> 357 * The text segment is a row in table. It will be treated as child of 358 * another TABLE TextSegment if its span is subspan of another TextSegment 359 * with type TABLE. 360 * </pre> 361 * 362 * <code>TABLE_ROW = 8;</code> 363 */ 364 TABLE_ROW(8), 365 /** 366 * 367 * 368 * <pre> 369 * The text segment is a cell in table. It will be treated as child of 370 * another TABLE_ROW TextSegment if its span is subspan of another 371 * TextSegment with type TABLE_ROW. 372 * </pre> 373 * 374 * <code>TABLE_CELL = 9;</code> 375 */ 376 TABLE_CELL(9), 377 UNRECOGNIZED(-1), 378 ; 379 380 /** 381 * 382 * 383 * <pre> 384 * Should not be used. 385 * </pre> 386 * 387 * <code>TEXT_SEGMENT_TYPE_UNSPECIFIED = 0;</code> 388 */ 389 public static final int TEXT_SEGMENT_TYPE_UNSPECIFIED_VALUE = 0; 390 /** 391 * 392 * 393 * <pre> 394 * The text segment is a token. e.g. word. 395 * </pre> 396 * 397 * <code>TOKEN = 1;</code> 398 */ 399 public static final int TOKEN_VALUE = 1; 400 /** 401 * 402 * 403 * <pre> 404 * The text segment is a paragraph. 405 * </pre> 406 * 407 * <code>PARAGRAPH = 2;</code> 408 */ 409 public static final int PARAGRAPH_VALUE = 2; 410 /** 411 * 412 * 413 * <pre> 414 * The text segment is a form field. 415 * </pre> 416 * 417 * <code>FORM_FIELD = 3;</code> 418 */ 419 public static final int FORM_FIELD_VALUE = 3; 420 /** 421 * 422 * 423 * <pre> 424 * The text segment is the name part of a form field. It will be treated 425 * as child of another FORM_FIELD TextSegment if its span is subspan of 426 * another TextSegment with type FORM_FIELD. 427 * </pre> 428 * 429 * <code>FORM_FIELD_NAME = 4;</code> 430 */ 431 public static final int FORM_FIELD_NAME_VALUE = 4; 432 /** 433 * 434 * 435 * <pre> 436 * The text segment is the text content part of a form field. It will be 437 * treated as child of another FORM_FIELD TextSegment if its span is 438 * subspan of another TextSegment with type FORM_FIELD. 439 * </pre> 440 * 441 * <code>FORM_FIELD_CONTENTS = 5;</code> 442 */ 443 public static final int FORM_FIELD_CONTENTS_VALUE = 5; 444 /** 445 * 446 * 447 * <pre> 448 * The text segment is a whole table, including headers, and all rows. 449 * </pre> 450 * 451 * <code>TABLE = 6;</code> 452 */ 453 public static final int TABLE_VALUE = 6; 454 /** 455 * 456 * 457 * <pre> 458 * The text segment is a table's headers. It will be treated as child of 459 * another TABLE TextSegment if its span is subspan of another TextSegment 460 * with type TABLE. 461 * </pre> 462 * 463 * <code>TABLE_HEADER = 7;</code> 464 */ 465 public static final int TABLE_HEADER_VALUE = 7; 466 /** 467 * 468 * 469 * <pre> 470 * The text segment is a row in table. It will be treated as child of 471 * another TABLE TextSegment if its span is subspan of another TextSegment 472 * with type TABLE. 473 * </pre> 474 * 475 * <code>TABLE_ROW = 8;</code> 476 */ 477 public static final int TABLE_ROW_VALUE = 8; 478 /** 479 * 480 * 481 * <pre> 482 * The text segment is a cell in table. It will be treated as child of 483 * another TABLE_ROW TextSegment if its span is subspan of another 484 * TextSegment with type TABLE_ROW. 485 * </pre> 486 * 487 * <code>TABLE_CELL = 9;</code> 488 */ 489 public static final int TABLE_CELL_VALUE = 9; 490 getNumber()491 public final int getNumber() { 492 if (this == UNRECOGNIZED) { 493 throw new java.lang.IllegalArgumentException( 494 "Can't get the number of an unknown enum value."); 495 } 496 return value; 497 } 498 499 /** 500 * @param value The numeric wire value of the corresponding enum entry. 501 * @return The enum associated with the given numeric wire value. 502 * @deprecated Use {@link #forNumber(int)} instead. 503 */ 504 @java.lang.Deprecated valueOf(int value)505 public static TextSegmentType valueOf(int value) { 506 return forNumber(value); 507 } 508 509 /** 510 * @param value The numeric wire value of the corresponding enum entry. 511 * @return The enum associated with the given numeric wire value. 512 */ forNumber(int value)513 public static TextSegmentType forNumber(int value) { 514 switch (value) { 515 case 0: 516 return TEXT_SEGMENT_TYPE_UNSPECIFIED; 517 case 1: 518 return TOKEN; 519 case 2: 520 return PARAGRAPH; 521 case 3: 522 return FORM_FIELD; 523 case 4: 524 return FORM_FIELD_NAME; 525 case 5: 526 return FORM_FIELD_CONTENTS; 527 case 6: 528 return TABLE; 529 case 7: 530 return TABLE_HEADER; 531 case 8: 532 return TABLE_ROW; 533 case 9: 534 return TABLE_CELL; 535 default: 536 return null; 537 } 538 } 539 540 public static com.google.protobuf.Internal.EnumLiteMap<TextSegmentType> internalGetValueMap()541 internalGetValueMap() { 542 return internalValueMap; 543 } 544 545 private static final com.google.protobuf.Internal.EnumLiteMap<TextSegmentType> 546 internalValueMap = 547 new com.google.protobuf.Internal.EnumLiteMap<TextSegmentType>() { 548 public TextSegmentType findValueByNumber(int number) { 549 return TextSegmentType.forNumber(number); 550 } 551 }; 552 getValueDescriptor()553 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 554 if (this == UNRECOGNIZED) { 555 throw new java.lang.IllegalStateException( 556 "Can't get the descriptor of an unrecognized enum value."); 557 } 558 return getDescriptor().getValues().get(ordinal()); 559 } 560 getDescriptorForType()561 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 562 return getDescriptor(); 563 } 564 getDescriptor()565 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 566 return com.google.cloud.automl.v1.Document.Layout.getDescriptor().getEnumTypes().get(0); 567 } 568 569 private static final TextSegmentType[] VALUES = values(); 570 valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc)571 public static TextSegmentType valueOf( 572 com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 573 if (desc.getType() != getDescriptor()) { 574 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 575 } 576 if (desc.getIndex() == -1) { 577 return UNRECOGNIZED; 578 } 579 return VALUES[desc.getIndex()]; 580 } 581 582 private final int value; 583 TextSegmentType(int value)584 private TextSegmentType(int value) { 585 this.value = value; 586 } 587 588 // @@protoc_insertion_point(enum_scope:google.cloud.automl.v1.Document.Layout.TextSegmentType) 589 } 590 591 public static final int TEXT_SEGMENT_FIELD_NUMBER = 1; 592 private com.google.cloud.automl.v1.TextSegment textSegment_; 593 /** 594 * 595 * 596 * <pre> 597 * Text Segment that represents a segment in 598 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 599 * </pre> 600 * 601 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 602 * 603 * @return Whether the textSegment field is set. 604 */ 605 @java.lang.Override hasTextSegment()606 public boolean hasTextSegment() { 607 return textSegment_ != null; 608 } 609 /** 610 * 611 * 612 * <pre> 613 * Text Segment that represents a segment in 614 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 615 * </pre> 616 * 617 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 618 * 619 * @return The textSegment. 620 */ 621 @java.lang.Override getTextSegment()622 public com.google.cloud.automl.v1.TextSegment getTextSegment() { 623 return textSegment_ == null 624 ? com.google.cloud.automl.v1.TextSegment.getDefaultInstance() 625 : textSegment_; 626 } 627 /** 628 * 629 * 630 * <pre> 631 * Text Segment that represents a segment in 632 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 633 * </pre> 634 * 635 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 636 */ 637 @java.lang.Override getTextSegmentOrBuilder()638 public com.google.cloud.automl.v1.TextSegmentOrBuilder getTextSegmentOrBuilder() { 639 return textSegment_ == null 640 ? com.google.cloud.automl.v1.TextSegment.getDefaultInstance() 641 : textSegment_; 642 } 643 644 public static final int PAGE_NUMBER_FIELD_NUMBER = 2; 645 private int pageNumber_ = 0; 646 /** 647 * 648 * 649 * <pre> 650 * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts 651 * from 1. 652 * </pre> 653 * 654 * <code>int32 page_number = 2;</code> 655 * 656 * @return The pageNumber. 657 */ 658 @java.lang.Override getPageNumber()659 public int getPageNumber() { 660 return pageNumber_; 661 } 662 663 public static final int BOUNDING_POLY_FIELD_NUMBER = 3; 664 private com.google.cloud.automl.v1.BoundingPoly boundingPoly_; 665 /** 666 * 667 * 668 * <pre> 669 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 670 * Contains exactly 4 671 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 672 * and they are connected by edges in the order provided, which will 673 * represent a rectangle parallel to the frame. The 674 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 675 * relative to the page. 676 * Coordinates are based on top-left as point (0,0). 677 * </pre> 678 * 679 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 680 * 681 * @return Whether the boundingPoly field is set. 682 */ 683 @java.lang.Override hasBoundingPoly()684 public boolean hasBoundingPoly() { 685 return boundingPoly_ != null; 686 } 687 /** 688 * 689 * 690 * <pre> 691 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 692 * Contains exactly 4 693 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 694 * and they are connected by edges in the order provided, which will 695 * represent a rectangle parallel to the frame. The 696 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 697 * relative to the page. 698 * Coordinates are based on top-left as point (0,0). 699 * </pre> 700 * 701 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 702 * 703 * @return The boundingPoly. 704 */ 705 @java.lang.Override getBoundingPoly()706 public com.google.cloud.automl.v1.BoundingPoly getBoundingPoly() { 707 return boundingPoly_ == null 708 ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() 709 : boundingPoly_; 710 } 711 /** 712 * 713 * 714 * <pre> 715 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 716 * Contains exactly 4 717 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 718 * and they are connected by edges in the order provided, which will 719 * represent a rectangle parallel to the frame. The 720 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 721 * relative to the page. 722 * Coordinates are based on top-left as point (0,0). 723 * </pre> 724 * 725 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 726 */ 727 @java.lang.Override getBoundingPolyOrBuilder()728 public com.google.cloud.automl.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { 729 return boundingPoly_ == null 730 ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() 731 : boundingPoly_; 732 } 733 734 public static final int TEXT_SEGMENT_TYPE_FIELD_NUMBER = 4; 735 private int textSegmentType_ = 0; 736 /** 737 * 738 * 739 * <pre> 740 * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. 741 * </pre> 742 * 743 * <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> 744 * 745 * @return The enum numeric value on the wire for textSegmentType. 746 */ 747 @java.lang.Override getTextSegmentTypeValue()748 public int getTextSegmentTypeValue() { 749 return textSegmentType_; 750 } 751 /** 752 * 753 * 754 * <pre> 755 * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. 756 * </pre> 757 * 758 * <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> 759 * 760 * @return The textSegmentType. 761 */ 762 @java.lang.Override getTextSegmentType()763 public com.google.cloud.automl.v1.Document.Layout.TextSegmentType getTextSegmentType() { 764 com.google.cloud.automl.v1.Document.Layout.TextSegmentType result = 765 com.google.cloud.automl.v1.Document.Layout.TextSegmentType.forNumber(textSegmentType_); 766 return result == null 767 ? com.google.cloud.automl.v1.Document.Layout.TextSegmentType.UNRECOGNIZED 768 : result; 769 } 770 771 private byte memoizedIsInitialized = -1; 772 773 @java.lang.Override isInitialized()774 public final boolean isInitialized() { 775 byte isInitialized = memoizedIsInitialized; 776 if (isInitialized == 1) return true; 777 if (isInitialized == 0) return false; 778 779 memoizedIsInitialized = 1; 780 return true; 781 } 782 783 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)784 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 785 if (textSegment_ != null) { 786 output.writeMessage(1, getTextSegment()); 787 } 788 if (pageNumber_ != 0) { 789 output.writeInt32(2, pageNumber_); 790 } 791 if (boundingPoly_ != null) { 792 output.writeMessage(3, getBoundingPoly()); 793 } 794 if (textSegmentType_ 795 != com.google.cloud.automl.v1.Document.Layout.TextSegmentType 796 .TEXT_SEGMENT_TYPE_UNSPECIFIED 797 .getNumber()) { 798 output.writeEnum(4, textSegmentType_); 799 } 800 getUnknownFields().writeTo(output); 801 } 802 803 @java.lang.Override getSerializedSize()804 public int getSerializedSize() { 805 int size = memoizedSize; 806 if (size != -1) return size; 807 808 size = 0; 809 if (textSegment_ != null) { 810 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTextSegment()); 811 } 812 if (pageNumber_ != 0) { 813 size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageNumber_); 814 } 815 if (boundingPoly_ != null) { 816 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBoundingPoly()); 817 } 818 if (textSegmentType_ 819 != com.google.cloud.automl.v1.Document.Layout.TextSegmentType 820 .TEXT_SEGMENT_TYPE_UNSPECIFIED 821 .getNumber()) { 822 size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, textSegmentType_); 823 } 824 size += getUnknownFields().getSerializedSize(); 825 memoizedSize = size; 826 return size; 827 } 828 829 @java.lang.Override equals(final java.lang.Object obj)830 public boolean equals(final java.lang.Object obj) { 831 if (obj == this) { 832 return true; 833 } 834 if (!(obj instanceof com.google.cloud.automl.v1.Document.Layout)) { 835 return super.equals(obj); 836 } 837 com.google.cloud.automl.v1.Document.Layout other = 838 (com.google.cloud.automl.v1.Document.Layout) obj; 839 840 if (hasTextSegment() != other.hasTextSegment()) return false; 841 if (hasTextSegment()) { 842 if (!getTextSegment().equals(other.getTextSegment())) return false; 843 } 844 if (getPageNumber() != other.getPageNumber()) return false; 845 if (hasBoundingPoly() != other.hasBoundingPoly()) return false; 846 if (hasBoundingPoly()) { 847 if (!getBoundingPoly().equals(other.getBoundingPoly())) return false; 848 } 849 if (textSegmentType_ != other.textSegmentType_) return false; 850 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 851 return true; 852 } 853 854 @java.lang.Override hashCode()855 public int hashCode() { 856 if (memoizedHashCode != 0) { 857 return memoizedHashCode; 858 } 859 int hash = 41; 860 hash = (19 * hash) + getDescriptor().hashCode(); 861 if (hasTextSegment()) { 862 hash = (37 * hash) + TEXT_SEGMENT_FIELD_NUMBER; 863 hash = (53 * hash) + getTextSegment().hashCode(); 864 } 865 hash = (37 * hash) + PAGE_NUMBER_FIELD_NUMBER; 866 hash = (53 * hash) + getPageNumber(); 867 if (hasBoundingPoly()) { 868 hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; 869 hash = (53 * hash) + getBoundingPoly().hashCode(); 870 } 871 hash = (37 * hash) + TEXT_SEGMENT_TYPE_FIELD_NUMBER; 872 hash = (53 * hash) + textSegmentType_; 873 hash = (29 * hash) + getUnknownFields().hashCode(); 874 memoizedHashCode = hash; 875 return hash; 876 } 877 parseFrom(java.nio.ByteBuffer data)878 public static com.google.cloud.automl.v1.Document.Layout parseFrom(java.nio.ByteBuffer data) 879 throws com.google.protobuf.InvalidProtocolBufferException { 880 return PARSER.parseFrom(data); 881 } 882 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)883 public static com.google.cloud.automl.v1.Document.Layout parseFrom( 884 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 885 throws com.google.protobuf.InvalidProtocolBufferException { 886 return PARSER.parseFrom(data, extensionRegistry); 887 } 888 parseFrom( com.google.protobuf.ByteString data)889 public static com.google.cloud.automl.v1.Document.Layout parseFrom( 890 com.google.protobuf.ByteString data) 891 throws com.google.protobuf.InvalidProtocolBufferException { 892 return PARSER.parseFrom(data); 893 } 894 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)895 public static com.google.cloud.automl.v1.Document.Layout parseFrom( 896 com.google.protobuf.ByteString data, 897 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 898 throws com.google.protobuf.InvalidProtocolBufferException { 899 return PARSER.parseFrom(data, extensionRegistry); 900 } 901 parseFrom(byte[] data)902 public static com.google.cloud.automl.v1.Document.Layout parseFrom(byte[] data) 903 throws com.google.protobuf.InvalidProtocolBufferException { 904 return PARSER.parseFrom(data); 905 } 906 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)907 public static com.google.cloud.automl.v1.Document.Layout parseFrom( 908 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 909 throws com.google.protobuf.InvalidProtocolBufferException { 910 return PARSER.parseFrom(data, extensionRegistry); 911 } 912 parseFrom(java.io.InputStream input)913 public static com.google.cloud.automl.v1.Document.Layout parseFrom(java.io.InputStream input) 914 throws java.io.IOException { 915 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 916 } 917 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)918 public static com.google.cloud.automl.v1.Document.Layout parseFrom( 919 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 920 throws java.io.IOException { 921 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 922 PARSER, input, extensionRegistry); 923 } 924 parseDelimitedFrom( java.io.InputStream input)925 public static com.google.cloud.automl.v1.Document.Layout parseDelimitedFrom( 926 java.io.InputStream input) throws java.io.IOException { 927 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 928 } 929 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)930 public static com.google.cloud.automl.v1.Document.Layout parseDelimitedFrom( 931 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 932 throws java.io.IOException { 933 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 934 PARSER, input, extensionRegistry); 935 } 936 parseFrom( com.google.protobuf.CodedInputStream input)937 public static com.google.cloud.automl.v1.Document.Layout parseFrom( 938 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 939 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 940 } 941 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)942 public static com.google.cloud.automl.v1.Document.Layout parseFrom( 943 com.google.protobuf.CodedInputStream input, 944 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 945 throws java.io.IOException { 946 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 947 PARSER, input, extensionRegistry); 948 } 949 950 @java.lang.Override newBuilderForType()951 public Builder newBuilderForType() { 952 return newBuilder(); 953 } 954 newBuilder()955 public static Builder newBuilder() { 956 return DEFAULT_INSTANCE.toBuilder(); 957 } 958 newBuilder(com.google.cloud.automl.v1.Document.Layout prototype)959 public static Builder newBuilder(com.google.cloud.automl.v1.Document.Layout prototype) { 960 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 961 } 962 963 @java.lang.Override toBuilder()964 public Builder toBuilder() { 965 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 966 } 967 968 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)969 protected Builder newBuilderForType( 970 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 971 Builder builder = new Builder(parent); 972 return builder; 973 } 974 /** 975 * 976 * 977 * <pre> 978 * Describes the layout information of a [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the document. 979 * </pre> 980 * 981 * Protobuf type {@code google.cloud.automl.v1.Document.Layout} 982 */ 983 public static final class Builder 984 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 985 implements 986 // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.Document.Layout) 987 com.google.cloud.automl.v1.Document.LayoutOrBuilder { getDescriptor()988 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 989 return com.google.cloud.automl.v1.DataItems 990 .internal_static_google_cloud_automl_v1_Document_Layout_descriptor; 991 } 992 993 @java.lang.Override 994 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()995 internalGetFieldAccessorTable() { 996 return com.google.cloud.automl.v1.DataItems 997 .internal_static_google_cloud_automl_v1_Document_Layout_fieldAccessorTable 998 .ensureFieldAccessorsInitialized( 999 com.google.cloud.automl.v1.Document.Layout.class, 1000 com.google.cloud.automl.v1.Document.Layout.Builder.class); 1001 } 1002 1003 // Construct using com.google.cloud.automl.v1.Document.Layout.newBuilder() Builder()1004 private Builder() {} 1005 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1006 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1007 super(parent); 1008 } 1009 1010 @java.lang.Override clear()1011 public Builder clear() { 1012 super.clear(); 1013 bitField0_ = 0; 1014 textSegment_ = null; 1015 if (textSegmentBuilder_ != null) { 1016 textSegmentBuilder_.dispose(); 1017 textSegmentBuilder_ = null; 1018 } 1019 pageNumber_ = 0; 1020 boundingPoly_ = null; 1021 if (boundingPolyBuilder_ != null) { 1022 boundingPolyBuilder_.dispose(); 1023 boundingPolyBuilder_ = null; 1024 } 1025 textSegmentType_ = 0; 1026 return this; 1027 } 1028 1029 @java.lang.Override getDescriptorForType()1030 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1031 return com.google.cloud.automl.v1.DataItems 1032 .internal_static_google_cloud_automl_v1_Document_Layout_descriptor; 1033 } 1034 1035 @java.lang.Override getDefaultInstanceForType()1036 public com.google.cloud.automl.v1.Document.Layout getDefaultInstanceForType() { 1037 return com.google.cloud.automl.v1.Document.Layout.getDefaultInstance(); 1038 } 1039 1040 @java.lang.Override build()1041 public com.google.cloud.automl.v1.Document.Layout build() { 1042 com.google.cloud.automl.v1.Document.Layout result = buildPartial(); 1043 if (!result.isInitialized()) { 1044 throw newUninitializedMessageException(result); 1045 } 1046 return result; 1047 } 1048 1049 @java.lang.Override buildPartial()1050 public com.google.cloud.automl.v1.Document.Layout buildPartial() { 1051 com.google.cloud.automl.v1.Document.Layout result = 1052 new com.google.cloud.automl.v1.Document.Layout(this); 1053 if (bitField0_ != 0) { 1054 buildPartial0(result); 1055 } 1056 onBuilt(); 1057 return result; 1058 } 1059 buildPartial0(com.google.cloud.automl.v1.Document.Layout result)1060 private void buildPartial0(com.google.cloud.automl.v1.Document.Layout result) { 1061 int from_bitField0_ = bitField0_; 1062 if (((from_bitField0_ & 0x00000001) != 0)) { 1063 result.textSegment_ = 1064 textSegmentBuilder_ == null ? textSegment_ : textSegmentBuilder_.build(); 1065 } 1066 if (((from_bitField0_ & 0x00000002) != 0)) { 1067 result.pageNumber_ = pageNumber_; 1068 } 1069 if (((from_bitField0_ & 0x00000004) != 0)) { 1070 result.boundingPoly_ = 1071 boundingPolyBuilder_ == null ? boundingPoly_ : boundingPolyBuilder_.build(); 1072 } 1073 if (((from_bitField0_ & 0x00000008) != 0)) { 1074 result.textSegmentType_ = textSegmentType_; 1075 } 1076 } 1077 1078 @java.lang.Override clone()1079 public Builder clone() { 1080 return super.clone(); 1081 } 1082 1083 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1084 public Builder setField( 1085 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1086 return super.setField(field, value); 1087 } 1088 1089 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1090 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1091 return super.clearField(field); 1092 } 1093 1094 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1095 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1096 return super.clearOneof(oneof); 1097 } 1098 1099 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1100 public Builder setRepeatedField( 1101 com.google.protobuf.Descriptors.FieldDescriptor field, 1102 int index, 1103 java.lang.Object value) { 1104 return super.setRepeatedField(field, index, value); 1105 } 1106 1107 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1108 public Builder addRepeatedField( 1109 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1110 return super.addRepeatedField(field, value); 1111 } 1112 1113 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1114 public Builder mergeFrom(com.google.protobuf.Message other) { 1115 if (other instanceof com.google.cloud.automl.v1.Document.Layout) { 1116 return mergeFrom((com.google.cloud.automl.v1.Document.Layout) other); 1117 } else { 1118 super.mergeFrom(other); 1119 return this; 1120 } 1121 } 1122 mergeFrom(com.google.cloud.automl.v1.Document.Layout other)1123 public Builder mergeFrom(com.google.cloud.automl.v1.Document.Layout other) { 1124 if (other == com.google.cloud.automl.v1.Document.Layout.getDefaultInstance()) return this; 1125 if (other.hasTextSegment()) { 1126 mergeTextSegment(other.getTextSegment()); 1127 } 1128 if (other.getPageNumber() != 0) { 1129 setPageNumber(other.getPageNumber()); 1130 } 1131 if (other.hasBoundingPoly()) { 1132 mergeBoundingPoly(other.getBoundingPoly()); 1133 } 1134 if (other.textSegmentType_ != 0) { 1135 setTextSegmentTypeValue(other.getTextSegmentTypeValue()); 1136 } 1137 this.mergeUnknownFields(other.getUnknownFields()); 1138 onChanged(); 1139 return this; 1140 } 1141 1142 @java.lang.Override isInitialized()1143 public final boolean isInitialized() { 1144 return true; 1145 } 1146 1147 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1148 public Builder mergeFrom( 1149 com.google.protobuf.CodedInputStream input, 1150 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1151 throws java.io.IOException { 1152 if (extensionRegistry == null) { 1153 throw new java.lang.NullPointerException(); 1154 } 1155 try { 1156 boolean done = false; 1157 while (!done) { 1158 int tag = input.readTag(); 1159 switch (tag) { 1160 case 0: 1161 done = true; 1162 break; 1163 case 10: 1164 { 1165 input.readMessage(getTextSegmentFieldBuilder().getBuilder(), extensionRegistry); 1166 bitField0_ |= 0x00000001; 1167 break; 1168 } // case 10 1169 case 16: 1170 { 1171 pageNumber_ = input.readInt32(); 1172 bitField0_ |= 0x00000002; 1173 break; 1174 } // case 16 1175 case 26: 1176 { 1177 input.readMessage(getBoundingPolyFieldBuilder().getBuilder(), extensionRegistry); 1178 bitField0_ |= 0x00000004; 1179 break; 1180 } // case 26 1181 case 32: 1182 { 1183 textSegmentType_ = input.readEnum(); 1184 bitField0_ |= 0x00000008; 1185 break; 1186 } // case 32 1187 default: 1188 { 1189 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1190 done = true; // was an endgroup tag 1191 } 1192 break; 1193 } // default: 1194 } // switch (tag) 1195 } // while (!done) 1196 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1197 throw e.unwrapIOException(); 1198 } finally { 1199 onChanged(); 1200 } // finally 1201 return this; 1202 } 1203 1204 private int bitField0_; 1205 1206 private com.google.cloud.automl.v1.TextSegment textSegment_; 1207 private com.google.protobuf.SingleFieldBuilderV3< 1208 com.google.cloud.automl.v1.TextSegment, 1209 com.google.cloud.automl.v1.TextSegment.Builder, 1210 com.google.cloud.automl.v1.TextSegmentOrBuilder> 1211 textSegmentBuilder_; 1212 /** 1213 * 1214 * 1215 * <pre> 1216 * Text Segment that represents a segment in 1217 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 1218 * </pre> 1219 * 1220 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 1221 * 1222 * @return Whether the textSegment field is set. 1223 */ hasTextSegment()1224 public boolean hasTextSegment() { 1225 return ((bitField0_ & 0x00000001) != 0); 1226 } 1227 /** 1228 * 1229 * 1230 * <pre> 1231 * Text Segment that represents a segment in 1232 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 1233 * </pre> 1234 * 1235 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 1236 * 1237 * @return The textSegment. 1238 */ getTextSegment()1239 public com.google.cloud.automl.v1.TextSegment getTextSegment() { 1240 if (textSegmentBuilder_ == null) { 1241 return textSegment_ == null 1242 ? com.google.cloud.automl.v1.TextSegment.getDefaultInstance() 1243 : textSegment_; 1244 } else { 1245 return textSegmentBuilder_.getMessage(); 1246 } 1247 } 1248 /** 1249 * 1250 * 1251 * <pre> 1252 * Text Segment that represents a segment in 1253 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 1254 * </pre> 1255 * 1256 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 1257 */ setTextSegment(com.google.cloud.automl.v1.TextSegment value)1258 public Builder setTextSegment(com.google.cloud.automl.v1.TextSegment value) { 1259 if (textSegmentBuilder_ == null) { 1260 if (value == null) { 1261 throw new NullPointerException(); 1262 } 1263 textSegment_ = value; 1264 } else { 1265 textSegmentBuilder_.setMessage(value); 1266 } 1267 bitField0_ |= 0x00000001; 1268 onChanged(); 1269 return this; 1270 } 1271 /** 1272 * 1273 * 1274 * <pre> 1275 * Text Segment that represents a segment in 1276 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 1277 * </pre> 1278 * 1279 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 1280 */ setTextSegment( com.google.cloud.automl.v1.TextSegment.Builder builderForValue)1281 public Builder setTextSegment( 1282 com.google.cloud.automl.v1.TextSegment.Builder builderForValue) { 1283 if (textSegmentBuilder_ == null) { 1284 textSegment_ = builderForValue.build(); 1285 } else { 1286 textSegmentBuilder_.setMessage(builderForValue.build()); 1287 } 1288 bitField0_ |= 0x00000001; 1289 onChanged(); 1290 return this; 1291 } 1292 /** 1293 * 1294 * 1295 * <pre> 1296 * Text Segment that represents a segment in 1297 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 1298 * </pre> 1299 * 1300 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 1301 */ mergeTextSegment(com.google.cloud.automl.v1.TextSegment value)1302 public Builder mergeTextSegment(com.google.cloud.automl.v1.TextSegment value) { 1303 if (textSegmentBuilder_ == null) { 1304 if (((bitField0_ & 0x00000001) != 0) 1305 && textSegment_ != null 1306 && textSegment_ != com.google.cloud.automl.v1.TextSegment.getDefaultInstance()) { 1307 getTextSegmentBuilder().mergeFrom(value); 1308 } else { 1309 textSegment_ = value; 1310 } 1311 } else { 1312 textSegmentBuilder_.mergeFrom(value); 1313 } 1314 bitField0_ |= 0x00000001; 1315 onChanged(); 1316 return this; 1317 } 1318 /** 1319 * 1320 * 1321 * <pre> 1322 * Text Segment that represents a segment in 1323 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 1324 * </pre> 1325 * 1326 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 1327 */ clearTextSegment()1328 public Builder clearTextSegment() { 1329 bitField0_ = (bitField0_ & ~0x00000001); 1330 textSegment_ = null; 1331 if (textSegmentBuilder_ != null) { 1332 textSegmentBuilder_.dispose(); 1333 textSegmentBuilder_ = null; 1334 } 1335 onChanged(); 1336 return this; 1337 } 1338 /** 1339 * 1340 * 1341 * <pre> 1342 * Text Segment that represents a segment in 1343 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 1344 * </pre> 1345 * 1346 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 1347 */ getTextSegmentBuilder()1348 public com.google.cloud.automl.v1.TextSegment.Builder getTextSegmentBuilder() { 1349 bitField0_ |= 0x00000001; 1350 onChanged(); 1351 return getTextSegmentFieldBuilder().getBuilder(); 1352 } 1353 /** 1354 * 1355 * 1356 * <pre> 1357 * Text Segment that represents a segment in 1358 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 1359 * </pre> 1360 * 1361 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 1362 */ getTextSegmentOrBuilder()1363 public com.google.cloud.automl.v1.TextSegmentOrBuilder getTextSegmentOrBuilder() { 1364 if (textSegmentBuilder_ != null) { 1365 return textSegmentBuilder_.getMessageOrBuilder(); 1366 } else { 1367 return textSegment_ == null 1368 ? com.google.cloud.automl.v1.TextSegment.getDefaultInstance() 1369 : textSegment_; 1370 } 1371 } 1372 /** 1373 * 1374 * 1375 * <pre> 1376 * Text Segment that represents a segment in 1377 * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. 1378 * </pre> 1379 * 1380 * <code>.google.cloud.automl.v1.TextSegment text_segment = 1;</code> 1381 */ 1382 private com.google.protobuf.SingleFieldBuilderV3< 1383 com.google.cloud.automl.v1.TextSegment, 1384 com.google.cloud.automl.v1.TextSegment.Builder, 1385 com.google.cloud.automl.v1.TextSegmentOrBuilder> getTextSegmentFieldBuilder()1386 getTextSegmentFieldBuilder() { 1387 if (textSegmentBuilder_ == null) { 1388 textSegmentBuilder_ = 1389 new com.google.protobuf.SingleFieldBuilderV3< 1390 com.google.cloud.automl.v1.TextSegment, 1391 com.google.cloud.automl.v1.TextSegment.Builder, 1392 com.google.cloud.automl.v1.TextSegmentOrBuilder>( 1393 getTextSegment(), getParentForChildren(), isClean()); 1394 textSegment_ = null; 1395 } 1396 return textSegmentBuilder_; 1397 } 1398 1399 private int pageNumber_; 1400 /** 1401 * 1402 * 1403 * <pre> 1404 * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts 1405 * from 1. 1406 * </pre> 1407 * 1408 * <code>int32 page_number = 2;</code> 1409 * 1410 * @return The pageNumber. 1411 */ 1412 @java.lang.Override getPageNumber()1413 public int getPageNumber() { 1414 return pageNumber_; 1415 } 1416 /** 1417 * 1418 * 1419 * <pre> 1420 * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts 1421 * from 1. 1422 * </pre> 1423 * 1424 * <code>int32 page_number = 2;</code> 1425 * 1426 * @param value The pageNumber to set. 1427 * @return This builder for chaining. 1428 */ setPageNumber(int value)1429 public Builder setPageNumber(int value) { 1430 1431 pageNumber_ = value; 1432 bitField0_ |= 0x00000002; 1433 onChanged(); 1434 return this; 1435 } 1436 /** 1437 * 1438 * 1439 * <pre> 1440 * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts 1441 * from 1. 1442 * </pre> 1443 * 1444 * <code>int32 page_number = 2;</code> 1445 * 1446 * @return This builder for chaining. 1447 */ clearPageNumber()1448 public Builder clearPageNumber() { 1449 bitField0_ = (bitField0_ & ~0x00000002); 1450 pageNumber_ = 0; 1451 onChanged(); 1452 return this; 1453 } 1454 1455 private com.google.cloud.automl.v1.BoundingPoly boundingPoly_; 1456 private com.google.protobuf.SingleFieldBuilderV3< 1457 com.google.cloud.automl.v1.BoundingPoly, 1458 com.google.cloud.automl.v1.BoundingPoly.Builder, 1459 com.google.cloud.automl.v1.BoundingPolyOrBuilder> 1460 boundingPolyBuilder_; 1461 /** 1462 * 1463 * 1464 * <pre> 1465 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 1466 * Contains exactly 4 1467 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 1468 * and they are connected by edges in the order provided, which will 1469 * represent a rectangle parallel to the frame. The 1470 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 1471 * relative to the page. 1472 * Coordinates are based on top-left as point (0,0). 1473 * </pre> 1474 * 1475 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 1476 * 1477 * @return Whether the boundingPoly field is set. 1478 */ hasBoundingPoly()1479 public boolean hasBoundingPoly() { 1480 return ((bitField0_ & 0x00000004) != 0); 1481 } 1482 /** 1483 * 1484 * 1485 * <pre> 1486 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 1487 * Contains exactly 4 1488 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 1489 * and they are connected by edges in the order provided, which will 1490 * represent a rectangle parallel to the frame. The 1491 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 1492 * relative to the page. 1493 * Coordinates are based on top-left as point (0,0). 1494 * </pre> 1495 * 1496 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 1497 * 1498 * @return The boundingPoly. 1499 */ getBoundingPoly()1500 public com.google.cloud.automl.v1.BoundingPoly getBoundingPoly() { 1501 if (boundingPolyBuilder_ == null) { 1502 return boundingPoly_ == null 1503 ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() 1504 : boundingPoly_; 1505 } else { 1506 return boundingPolyBuilder_.getMessage(); 1507 } 1508 } 1509 /** 1510 * 1511 * 1512 * <pre> 1513 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 1514 * Contains exactly 4 1515 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 1516 * and they are connected by edges in the order provided, which will 1517 * represent a rectangle parallel to the frame. The 1518 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 1519 * relative to the page. 1520 * Coordinates are based on top-left as point (0,0). 1521 * </pre> 1522 * 1523 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 1524 */ setBoundingPoly(com.google.cloud.automl.v1.BoundingPoly value)1525 public Builder setBoundingPoly(com.google.cloud.automl.v1.BoundingPoly value) { 1526 if (boundingPolyBuilder_ == null) { 1527 if (value == null) { 1528 throw new NullPointerException(); 1529 } 1530 boundingPoly_ = value; 1531 } else { 1532 boundingPolyBuilder_.setMessage(value); 1533 } 1534 bitField0_ |= 0x00000004; 1535 onChanged(); 1536 return this; 1537 } 1538 /** 1539 * 1540 * 1541 * <pre> 1542 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 1543 * Contains exactly 4 1544 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 1545 * and they are connected by edges in the order provided, which will 1546 * represent a rectangle parallel to the frame. The 1547 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 1548 * relative to the page. 1549 * Coordinates are based on top-left as point (0,0). 1550 * </pre> 1551 * 1552 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 1553 */ setBoundingPoly( com.google.cloud.automl.v1.BoundingPoly.Builder builderForValue)1554 public Builder setBoundingPoly( 1555 com.google.cloud.automl.v1.BoundingPoly.Builder builderForValue) { 1556 if (boundingPolyBuilder_ == null) { 1557 boundingPoly_ = builderForValue.build(); 1558 } else { 1559 boundingPolyBuilder_.setMessage(builderForValue.build()); 1560 } 1561 bitField0_ |= 0x00000004; 1562 onChanged(); 1563 return this; 1564 } 1565 /** 1566 * 1567 * 1568 * <pre> 1569 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 1570 * Contains exactly 4 1571 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 1572 * and they are connected by edges in the order provided, which will 1573 * represent a rectangle parallel to the frame. The 1574 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 1575 * relative to the page. 1576 * Coordinates are based on top-left as point (0,0). 1577 * </pre> 1578 * 1579 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 1580 */ mergeBoundingPoly(com.google.cloud.automl.v1.BoundingPoly value)1581 public Builder mergeBoundingPoly(com.google.cloud.automl.v1.BoundingPoly value) { 1582 if (boundingPolyBuilder_ == null) { 1583 if (((bitField0_ & 0x00000004) != 0) 1584 && boundingPoly_ != null 1585 && boundingPoly_ != com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance()) { 1586 getBoundingPolyBuilder().mergeFrom(value); 1587 } else { 1588 boundingPoly_ = value; 1589 } 1590 } else { 1591 boundingPolyBuilder_.mergeFrom(value); 1592 } 1593 bitField0_ |= 0x00000004; 1594 onChanged(); 1595 return this; 1596 } 1597 /** 1598 * 1599 * 1600 * <pre> 1601 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 1602 * Contains exactly 4 1603 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 1604 * and they are connected by edges in the order provided, which will 1605 * represent a rectangle parallel to the frame. The 1606 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 1607 * relative to the page. 1608 * Coordinates are based on top-left as point (0,0). 1609 * </pre> 1610 * 1611 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 1612 */ clearBoundingPoly()1613 public Builder clearBoundingPoly() { 1614 bitField0_ = (bitField0_ & ~0x00000004); 1615 boundingPoly_ = null; 1616 if (boundingPolyBuilder_ != null) { 1617 boundingPolyBuilder_.dispose(); 1618 boundingPolyBuilder_ = null; 1619 } 1620 onChanged(); 1621 return this; 1622 } 1623 /** 1624 * 1625 * 1626 * <pre> 1627 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 1628 * Contains exactly 4 1629 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 1630 * and they are connected by edges in the order provided, which will 1631 * represent a rectangle parallel to the frame. The 1632 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 1633 * relative to the page. 1634 * Coordinates are based on top-left as point (0,0). 1635 * </pre> 1636 * 1637 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 1638 */ getBoundingPolyBuilder()1639 public com.google.cloud.automl.v1.BoundingPoly.Builder getBoundingPolyBuilder() { 1640 bitField0_ |= 0x00000004; 1641 onChanged(); 1642 return getBoundingPolyFieldBuilder().getBuilder(); 1643 } 1644 /** 1645 * 1646 * 1647 * <pre> 1648 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 1649 * Contains exactly 4 1650 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 1651 * and they are connected by edges in the order provided, which will 1652 * represent a rectangle parallel to the frame. The 1653 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 1654 * relative to the page. 1655 * Coordinates are based on top-left as point (0,0). 1656 * </pre> 1657 * 1658 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 1659 */ getBoundingPolyOrBuilder()1660 public com.google.cloud.automl.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { 1661 if (boundingPolyBuilder_ != null) { 1662 return boundingPolyBuilder_.getMessageOrBuilder(); 1663 } else { 1664 return boundingPoly_ == null 1665 ? com.google.cloud.automl.v1.BoundingPoly.getDefaultInstance() 1666 : boundingPoly_; 1667 } 1668 } 1669 /** 1670 * 1671 * 1672 * <pre> 1673 * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. 1674 * Contains exactly 4 1675 * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] 1676 * and they are connected by edges in the order provided, which will 1677 * represent a rectangle parallel to the frame. The 1678 * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are 1679 * relative to the page. 1680 * Coordinates are based on top-left as point (0,0). 1681 * </pre> 1682 * 1683 * <code>.google.cloud.automl.v1.BoundingPoly bounding_poly = 3;</code> 1684 */ 1685 private com.google.protobuf.SingleFieldBuilderV3< 1686 com.google.cloud.automl.v1.BoundingPoly, 1687 com.google.cloud.automl.v1.BoundingPoly.Builder, 1688 com.google.cloud.automl.v1.BoundingPolyOrBuilder> getBoundingPolyFieldBuilder()1689 getBoundingPolyFieldBuilder() { 1690 if (boundingPolyBuilder_ == null) { 1691 boundingPolyBuilder_ = 1692 new com.google.protobuf.SingleFieldBuilderV3< 1693 com.google.cloud.automl.v1.BoundingPoly, 1694 com.google.cloud.automl.v1.BoundingPoly.Builder, 1695 com.google.cloud.automl.v1.BoundingPolyOrBuilder>( 1696 getBoundingPoly(), getParentForChildren(), isClean()); 1697 boundingPoly_ = null; 1698 } 1699 return boundingPolyBuilder_; 1700 } 1701 1702 private int textSegmentType_ = 0; 1703 /** 1704 * 1705 * 1706 * <pre> 1707 * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. 1708 * </pre> 1709 * 1710 * <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> 1711 * 1712 * @return The enum numeric value on the wire for textSegmentType. 1713 */ 1714 @java.lang.Override getTextSegmentTypeValue()1715 public int getTextSegmentTypeValue() { 1716 return textSegmentType_; 1717 } 1718 /** 1719 * 1720 * 1721 * <pre> 1722 * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. 1723 * </pre> 1724 * 1725 * <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> 1726 * 1727 * @param value The enum numeric value on the wire for textSegmentType to set. 1728 * @return This builder for chaining. 1729 */ setTextSegmentTypeValue(int value)1730 public Builder setTextSegmentTypeValue(int value) { 1731 textSegmentType_ = value; 1732 bitField0_ |= 0x00000008; 1733 onChanged(); 1734 return this; 1735 } 1736 /** 1737 * 1738 * 1739 * <pre> 1740 * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. 1741 * </pre> 1742 * 1743 * <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> 1744 * 1745 * @return The textSegmentType. 1746 */ 1747 @java.lang.Override getTextSegmentType()1748 public com.google.cloud.automl.v1.Document.Layout.TextSegmentType getTextSegmentType() { 1749 com.google.cloud.automl.v1.Document.Layout.TextSegmentType result = 1750 com.google.cloud.automl.v1.Document.Layout.TextSegmentType.forNumber(textSegmentType_); 1751 return result == null 1752 ? com.google.cloud.automl.v1.Document.Layout.TextSegmentType.UNRECOGNIZED 1753 : result; 1754 } 1755 /** 1756 * 1757 * 1758 * <pre> 1759 * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. 1760 * </pre> 1761 * 1762 * <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> 1763 * 1764 * @param value The textSegmentType to set. 1765 * @return This builder for chaining. 1766 */ setTextSegmentType( com.google.cloud.automl.v1.Document.Layout.TextSegmentType value)1767 public Builder setTextSegmentType( 1768 com.google.cloud.automl.v1.Document.Layout.TextSegmentType value) { 1769 if (value == null) { 1770 throw new NullPointerException(); 1771 } 1772 bitField0_ |= 0x00000008; 1773 textSegmentType_ = value.getNumber(); 1774 onChanged(); 1775 return this; 1776 } 1777 /** 1778 * 1779 * 1780 * <pre> 1781 * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. 1782 * </pre> 1783 * 1784 * <code>.google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4;</code> 1785 * 1786 * @return This builder for chaining. 1787 */ clearTextSegmentType()1788 public Builder clearTextSegmentType() { 1789 bitField0_ = (bitField0_ & ~0x00000008); 1790 textSegmentType_ = 0; 1791 onChanged(); 1792 return this; 1793 } 1794 1795 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1796 public final Builder setUnknownFields( 1797 final com.google.protobuf.UnknownFieldSet unknownFields) { 1798 return super.setUnknownFields(unknownFields); 1799 } 1800 1801 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1802 public final Builder mergeUnknownFields( 1803 final com.google.protobuf.UnknownFieldSet unknownFields) { 1804 return super.mergeUnknownFields(unknownFields); 1805 } 1806 1807 // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.Document.Layout) 1808 } 1809 1810 // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.Document.Layout) 1811 private static final com.google.cloud.automl.v1.Document.Layout DEFAULT_INSTANCE; 1812 1813 static { 1814 DEFAULT_INSTANCE = new com.google.cloud.automl.v1.Document.Layout(); 1815 } 1816 getDefaultInstance()1817 public static com.google.cloud.automl.v1.Document.Layout getDefaultInstance() { 1818 return DEFAULT_INSTANCE; 1819 } 1820 1821 private static final com.google.protobuf.Parser<Layout> PARSER = 1822 new com.google.protobuf.AbstractParser<Layout>() { 1823 @java.lang.Override 1824 public Layout parsePartialFrom( 1825 com.google.protobuf.CodedInputStream input, 1826 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1827 throws com.google.protobuf.InvalidProtocolBufferException { 1828 Builder builder = newBuilder(); 1829 try { 1830 builder.mergeFrom(input, extensionRegistry); 1831 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1832 throw e.setUnfinishedMessage(builder.buildPartial()); 1833 } catch (com.google.protobuf.UninitializedMessageException e) { 1834 throw e.asInvalidProtocolBufferException() 1835 .setUnfinishedMessage(builder.buildPartial()); 1836 } catch (java.io.IOException e) { 1837 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1838 .setUnfinishedMessage(builder.buildPartial()); 1839 } 1840 return builder.buildPartial(); 1841 } 1842 }; 1843 parser()1844 public static com.google.protobuf.Parser<Layout> parser() { 1845 return PARSER; 1846 } 1847 1848 @java.lang.Override getParserForType()1849 public com.google.protobuf.Parser<Layout> getParserForType() { 1850 return PARSER; 1851 } 1852 1853 @java.lang.Override getDefaultInstanceForType()1854 public com.google.cloud.automl.v1.Document.Layout getDefaultInstanceForType() { 1855 return DEFAULT_INSTANCE; 1856 } 1857 } 1858 1859 public static final int INPUT_CONFIG_FIELD_NUMBER = 1; 1860 private com.google.cloud.automl.v1.DocumentInputConfig inputConfig_; 1861 /** 1862 * 1863 * 1864 * <pre> 1865 * An input config specifying the content of the document. 1866 * </pre> 1867 * 1868 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 1869 * 1870 * @return Whether the inputConfig field is set. 1871 */ 1872 @java.lang.Override hasInputConfig()1873 public boolean hasInputConfig() { 1874 return inputConfig_ != null; 1875 } 1876 /** 1877 * 1878 * 1879 * <pre> 1880 * An input config specifying the content of the document. 1881 * </pre> 1882 * 1883 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 1884 * 1885 * @return The inputConfig. 1886 */ 1887 @java.lang.Override getInputConfig()1888 public com.google.cloud.automl.v1.DocumentInputConfig getInputConfig() { 1889 return inputConfig_ == null 1890 ? com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance() 1891 : inputConfig_; 1892 } 1893 /** 1894 * 1895 * 1896 * <pre> 1897 * An input config specifying the content of the document. 1898 * </pre> 1899 * 1900 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 1901 */ 1902 @java.lang.Override getInputConfigOrBuilder()1903 public com.google.cloud.automl.v1.DocumentInputConfigOrBuilder getInputConfigOrBuilder() { 1904 return inputConfig_ == null 1905 ? com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance() 1906 : inputConfig_; 1907 } 1908 1909 public static final int DOCUMENT_TEXT_FIELD_NUMBER = 2; 1910 private com.google.cloud.automl.v1.TextSnippet documentText_; 1911 /** 1912 * 1913 * 1914 * <pre> 1915 * The plain text version of this document. 1916 * </pre> 1917 * 1918 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 1919 * 1920 * @return Whether the documentText field is set. 1921 */ 1922 @java.lang.Override hasDocumentText()1923 public boolean hasDocumentText() { 1924 return documentText_ != null; 1925 } 1926 /** 1927 * 1928 * 1929 * <pre> 1930 * The plain text version of this document. 1931 * </pre> 1932 * 1933 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 1934 * 1935 * @return The documentText. 1936 */ 1937 @java.lang.Override getDocumentText()1938 public com.google.cloud.automl.v1.TextSnippet getDocumentText() { 1939 return documentText_ == null 1940 ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() 1941 : documentText_; 1942 } 1943 /** 1944 * 1945 * 1946 * <pre> 1947 * The plain text version of this document. 1948 * </pre> 1949 * 1950 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 1951 */ 1952 @java.lang.Override getDocumentTextOrBuilder()1953 public com.google.cloud.automl.v1.TextSnippetOrBuilder getDocumentTextOrBuilder() { 1954 return documentText_ == null 1955 ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() 1956 : documentText_; 1957 } 1958 1959 public static final int LAYOUT_FIELD_NUMBER = 3; 1960 1961 @SuppressWarnings("serial") 1962 private java.util.List<com.google.cloud.automl.v1.Document.Layout> layout_; 1963 /** 1964 * 1965 * 1966 * <pre> 1967 * Describes the layout of the document. 1968 * Sorted by [page_number][]. 1969 * </pre> 1970 * 1971 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 1972 */ 1973 @java.lang.Override getLayoutList()1974 public java.util.List<com.google.cloud.automl.v1.Document.Layout> getLayoutList() { 1975 return layout_; 1976 } 1977 /** 1978 * 1979 * 1980 * <pre> 1981 * Describes the layout of the document. 1982 * Sorted by [page_number][]. 1983 * </pre> 1984 * 1985 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 1986 */ 1987 @java.lang.Override 1988 public java.util.List<? extends com.google.cloud.automl.v1.Document.LayoutOrBuilder> getLayoutOrBuilderList()1989 getLayoutOrBuilderList() { 1990 return layout_; 1991 } 1992 /** 1993 * 1994 * 1995 * <pre> 1996 * Describes the layout of the document. 1997 * Sorted by [page_number][]. 1998 * </pre> 1999 * 2000 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 2001 */ 2002 @java.lang.Override getLayoutCount()2003 public int getLayoutCount() { 2004 return layout_.size(); 2005 } 2006 /** 2007 * 2008 * 2009 * <pre> 2010 * Describes the layout of the document. 2011 * Sorted by [page_number][]. 2012 * </pre> 2013 * 2014 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 2015 */ 2016 @java.lang.Override getLayout(int index)2017 public com.google.cloud.automl.v1.Document.Layout getLayout(int index) { 2018 return layout_.get(index); 2019 } 2020 /** 2021 * 2022 * 2023 * <pre> 2024 * Describes the layout of the document. 2025 * Sorted by [page_number][]. 2026 * </pre> 2027 * 2028 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 2029 */ 2030 @java.lang.Override getLayoutOrBuilder(int index)2031 public com.google.cloud.automl.v1.Document.LayoutOrBuilder getLayoutOrBuilder(int index) { 2032 return layout_.get(index); 2033 } 2034 2035 public static final int DOCUMENT_DIMENSIONS_FIELD_NUMBER = 4; 2036 private com.google.cloud.automl.v1.DocumentDimensions documentDimensions_; 2037 /** 2038 * 2039 * 2040 * <pre> 2041 * The dimensions of the page in the document. 2042 * </pre> 2043 * 2044 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 2045 * 2046 * @return Whether the documentDimensions field is set. 2047 */ 2048 @java.lang.Override hasDocumentDimensions()2049 public boolean hasDocumentDimensions() { 2050 return documentDimensions_ != null; 2051 } 2052 /** 2053 * 2054 * 2055 * <pre> 2056 * The dimensions of the page in the document. 2057 * </pre> 2058 * 2059 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 2060 * 2061 * @return The documentDimensions. 2062 */ 2063 @java.lang.Override getDocumentDimensions()2064 public com.google.cloud.automl.v1.DocumentDimensions getDocumentDimensions() { 2065 return documentDimensions_ == null 2066 ? com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance() 2067 : documentDimensions_; 2068 } 2069 /** 2070 * 2071 * 2072 * <pre> 2073 * The dimensions of the page in the document. 2074 * </pre> 2075 * 2076 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 2077 */ 2078 @java.lang.Override getDocumentDimensionsOrBuilder()2079 public com.google.cloud.automl.v1.DocumentDimensionsOrBuilder getDocumentDimensionsOrBuilder() { 2080 return documentDimensions_ == null 2081 ? com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance() 2082 : documentDimensions_; 2083 } 2084 2085 public static final int PAGE_COUNT_FIELD_NUMBER = 5; 2086 private int pageCount_ = 0; 2087 /** 2088 * 2089 * 2090 * <pre> 2091 * Number of pages in the document. 2092 * </pre> 2093 * 2094 * <code>int32 page_count = 5;</code> 2095 * 2096 * @return The pageCount. 2097 */ 2098 @java.lang.Override getPageCount()2099 public int getPageCount() { 2100 return pageCount_; 2101 } 2102 2103 private byte memoizedIsInitialized = -1; 2104 2105 @java.lang.Override isInitialized()2106 public final boolean isInitialized() { 2107 byte isInitialized = memoizedIsInitialized; 2108 if (isInitialized == 1) return true; 2109 if (isInitialized == 0) return false; 2110 2111 memoizedIsInitialized = 1; 2112 return true; 2113 } 2114 2115 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)2116 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 2117 if (inputConfig_ != null) { 2118 output.writeMessage(1, getInputConfig()); 2119 } 2120 if (documentText_ != null) { 2121 output.writeMessage(2, getDocumentText()); 2122 } 2123 for (int i = 0; i < layout_.size(); i++) { 2124 output.writeMessage(3, layout_.get(i)); 2125 } 2126 if (documentDimensions_ != null) { 2127 output.writeMessage(4, getDocumentDimensions()); 2128 } 2129 if (pageCount_ != 0) { 2130 output.writeInt32(5, pageCount_); 2131 } 2132 getUnknownFields().writeTo(output); 2133 } 2134 2135 @java.lang.Override getSerializedSize()2136 public int getSerializedSize() { 2137 int size = memoizedSize; 2138 if (size != -1) return size; 2139 2140 size = 0; 2141 if (inputConfig_ != null) { 2142 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputConfig()); 2143 } 2144 if (documentText_ != null) { 2145 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocumentText()); 2146 } 2147 for (int i = 0; i < layout_.size(); i++) { 2148 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, layout_.get(i)); 2149 } 2150 if (documentDimensions_ != null) { 2151 size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentDimensions()); 2152 } 2153 if (pageCount_ != 0) { 2154 size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, pageCount_); 2155 } 2156 size += getUnknownFields().getSerializedSize(); 2157 memoizedSize = size; 2158 return size; 2159 } 2160 2161 @java.lang.Override equals(final java.lang.Object obj)2162 public boolean equals(final java.lang.Object obj) { 2163 if (obj == this) { 2164 return true; 2165 } 2166 if (!(obj instanceof com.google.cloud.automl.v1.Document)) { 2167 return super.equals(obj); 2168 } 2169 com.google.cloud.automl.v1.Document other = (com.google.cloud.automl.v1.Document) obj; 2170 2171 if (hasInputConfig() != other.hasInputConfig()) return false; 2172 if (hasInputConfig()) { 2173 if (!getInputConfig().equals(other.getInputConfig())) return false; 2174 } 2175 if (hasDocumentText() != other.hasDocumentText()) return false; 2176 if (hasDocumentText()) { 2177 if (!getDocumentText().equals(other.getDocumentText())) return false; 2178 } 2179 if (!getLayoutList().equals(other.getLayoutList())) return false; 2180 if (hasDocumentDimensions() != other.hasDocumentDimensions()) return false; 2181 if (hasDocumentDimensions()) { 2182 if (!getDocumentDimensions().equals(other.getDocumentDimensions())) return false; 2183 } 2184 if (getPageCount() != other.getPageCount()) return false; 2185 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 2186 return true; 2187 } 2188 2189 @java.lang.Override hashCode()2190 public int hashCode() { 2191 if (memoizedHashCode != 0) { 2192 return memoizedHashCode; 2193 } 2194 int hash = 41; 2195 hash = (19 * hash) + getDescriptor().hashCode(); 2196 if (hasInputConfig()) { 2197 hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; 2198 hash = (53 * hash) + getInputConfig().hashCode(); 2199 } 2200 if (hasDocumentText()) { 2201 hash = (37 * hash) + DOCUMENT_TEXT_FIELD_NUMBER; 2202 hash = (53 * hash) + getDocumentText().hashCode(); 2203 } 2204 if (getLayoutCount() > 0) { 2205 hash = (37 * hash) + LAYOUT_FIELD_NUMBER; 2206 hash = (53 * hash) + getLayoutList().hashCode(); 2207 } 2208 if (hasDocumentDimensions()) { 2209 hash = (37 * hash) + DOCUMENT_DIMENSIONS_FIELD_NUMBER; 2210 hash = (53 * hash) + getDocumentDimensions().hashCode(); 2211 } 2212 hash = (37 * hash) + PAGE_COUNT_FIELD_NUMBER; 2213 hash = (53 * hash) + getPageCount(); 2214 hash = (29 * hash) + getUnknownFields().hashCode(); 2215 memoizedHashCode = hash; 2216 return hash; 2217 } 2218 parseFrom(java.nio.ByteBuffer data)2219 public static com.google.cloud.automl.v1.Document parseFrom(java.nio.ByteBuffer data) 2220 throws com.google.protobuf.InvalidProtocolBufferException { 2221 return PARSER.parseFrom(data); 2222 } 2223 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2224 public static com.google.cloud.automl.v1.Document parseFrom( 2225 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2226 throws com.google.protobuf.InvalidProtocolBufferException { 2227 return PARSER.parseFrom(data, extensionRegistry); 2228 } 2229 parseFrom(com.google.protobuf.ByteString data)2230 public static com.google.cloud.automl.v1.Document parseFrom(com.google.protobuf.ByteString data) 2231 throws com.google.protobuf.InvalidProtocolBufferException { 2232 return PARSER.parseFrom(data); 2233 } 2234 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2235 public static com.google.cloud.automl.v1.Document parseFrom( 2236 com.google.protobuf.ByteString data, 2237 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2238 throws com.google.protobuf.InvalidProtocolBufferException { 2239 return PARSER.parseFrom(data, extensionRegistry); 2240 } 2241 parseFrom(byte[] data)2242 public static com.google.cloud.automl.v1.Document parseFrom(byte[] data) 2243 throws com.google.protobuf.InvalidProtocolBufferException { 2244 return PARSER.parseFrom(data); 2245 } 2246 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2247 public static com.google.cloud.automl.v1.Document parseFrom( 2248 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2249 throws com.google.protobuf.InvalidProtocolBufferException { 2250 return PARSER.parseFrom(data, extensionRegistry); 2251 } 2252 parseFrom(java.io.InputStream input)2253 public static com.google.cloud.automl.v1.Document parseFrom(java.io.InputStream input) 2254 throws java.io.IOException { 2255 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 2256 } 2257 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2258 public static com.google.cloud.automl.v1.Document parseFrom( 2259 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2260 throws java.io.IOException { 2261 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 2262 PARSER, input, extensionRegistry); 2263 } 2264 parseDelimitedFrom(java.io.InputStream input)2265 public static com.google.cloud.automl.v1.Document parseDelimitedFrom(java.io.InputStream input) 2266 throws java.io.IOException { 2267 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 2268 } 2269 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2270 public static com.google.cloud.automl.v1.Document parseDelimitedFrom( 2271 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2272 throws java.io.IOException { 2273 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 2274 PARSER, input, extensionRegistry); 2275 } 2276 parseFrom( com.google.protobuf.CodedInputStream input)2277 public static com.google.cloud.automl.v1.Document parseFrom( 2278 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 2279 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 2280 } 2281 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2282 public static com.google.cloud.automl.v1.Document parseFrom( 2283 com.google.protobuf.CodedInputStream input, 2284 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2285 throws java.io.IOException { 2286 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 2287 PARSER, input, extensionRegistry); 2288 } 2289 2290 @java.lang.Override newBuilderForType()2291 public Builder newBuilderForType() { 2292 return newBuilder(); 2293 } 2294 newBuilder()2295 public static Builder newBuilder() { 2296 return DEFAULT_INSTANCE.toBuilder(); 2297 } 2298 newBuilder(com.google.cloud.automl.v1.Document prototype)2299 public static Builder newBuilder(com.google.cloud.automl.v1.Document prototype) { 2300 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 2301 } 2302 2303 @java.lang.Override toBuilder()2304 public Builder toBuilder() { 2305 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 2306 } 2307 2308 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2309 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 2310 Builder builder = new Builder(parent); 2311 return builder; 2312 } 2313 /** 2314 * 2315 * 2316 * <pre> 2317 * A structured text document e.g. a PDF. 2318 * </pre> 2319 * 2320 * Protobuf type {@code google.cloud.automl.v1.Document} 2321 */ 2322 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 2323 implements 2324 // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.Document) 2325 com.google.cloud.automl.v1.DocumentOrBuilder { getDescriptor()2326 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 2327 return com.google.cloud.automl.v1.DataItems 2328 .internal_static_google_cloud_automl_v1_Document_descriptor; 2329 } 2330 2331 @java.lang.Override 2332 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()2333 internalGetFieldAccessorTable() { 2334 return com.google.cloud.automl.v1.DataItems 2335 .internal_static_google_cloud_automl_v1_Document_fieldAccessorTable 2336 .ensureFieldAccessorsInitialized( 2337 com.google.cloud.automl.v1.Document.class, 2338 com.google.cloud.automl.v1.Document.Builder.class); 2339 } 2340 2341 // Construct using com.google.cloud.automl.v1.Document.newBuilder() Builder()2342 private Builder() {} 2343 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2344 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 2345 super(parent); 2346 } 2347 2348 @java.lang.Override clear()2349 public Builder clear() { 2350 super.clear(); 2351 bitField0_ = 0; 2352 inputConfig_ = null; 2353 if (inputConfigBuilder_ != null) { 2354 inputConfigBuilder_.dispose(); 2355 inputConfigBuilder_ = null; 2356 } 2357 documentText_ = null; 2358 if (documentTextBuilder_ != null) { 2359 documentTextBuilder_.dispose(); 2360 documentTextBuilder_ = null; 2361 } 2362 if (layoutBuilder_ == null) { 2363 layout_ = java.util.Collections.emptyList(); 2364 } else { 2365 layout_ = null; 2366 layoutBuilder_.clear(); 2367 } 2368 bitField0_ = (bitField0_ & ~0x00000004); 2369 documentDimensions_ = null; 2370 if (documentDimensionsBuilder_ != null) { 2371 documentDimensionsBuilder_.dispose(); 2372 documentDimensionsBuilder_ = null; 2373 } 2374 pageCount_ = 0; 2375 return this; 2376 } 2377 2378 @java.lang.Override getDescriptorForType()2379 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 2380 return com.google.cloud.automl.v1.DataItems 2381 .internal_static_google_cloud_automl_v1_Document_descriptor; 2382 } 2383 2384 @java.lang.Override getDefaultInstanceForType()2385 public com.google.cloud.automl.v1.Document getDefaultInstanceForType() { 2386 return com.google.cloud.automl.v1.Document.getDefaultInstance(); 2387 } 2388 2389 @java.lang.Override build()2390 public com.google.cloud.automl.v1.Document build() { 2391 com.google.cloud.automl.v1.Document result = buildPartial(); 2392 if (!result.isInitialized()) { 2393 throw newUninitializedMessageException(result); 2394 } 2395 return result; 2396 } 2397 2398 @java.lang.Override buildPartial()2399 public com.google.cloud.automl.v1.Document buildPartial() { 2400 com.google.cloud.automl.v1.Document result = new com.google.cloud.automl.v1.Document(this); 2401 buildPartialRepeatedFields(result); 2402 if (bitField0_ != 0) { 2403 buildPartial0(result); 2404 } 2405 onBuilt(); 2406 return result; 2407 } 2408 buildPartialRepeatedFields(com.google.cloud.automl.v1.Document result)2409 private void buildPartialRepeatedFields(com.google.cloud.automl.v1.Document result) { 2410 if (layoutBuilder_ == null) { 2411 if (((bitField0_ & 0x00000004) != 0)) { 2412 layout_ = java.util.Collections.unmodifiableList(layout_); 2413 bitField0_ = (bitField0_ & ~0x00000004); 2414 } 2415 result.layout_ = layout_; 2416 } else { 2417 result.layout_ = layoutBuilder_.build(); 2418 } 2419 } 2420 buildPartial0(com.google.cloud.automl.v1.Document result)2421 private void buildPartial0(com.google.cloud.automl.v1.Document result) { 2422 int from_bitField0_ = bitField0_; 2423 if (((from_bitField0_ & 0x00000001) != 0)) { 2424 result.inputConfig_ = 2425 inputConfigBuilder_ == null ? inputConfig_ : inputConfigBuilder_.build(); 2426 } 2427 if (((from_bitField0_ & 0x00000002) != 0)) { 2428 result.documentText_ = 2429 documentTextBuilder_ == null ? documentText_ : documentTextBuilder_.build(); 2430 } 2431 if (((from_bitField0_ & 0x00000008) != 0)) { 2432 result.documentDimensions_ = 2433 documentDimensionsBuilder_ == null 2434 ? documentDimensions_ 2435 : documentDimensionsBuilder_.build(); 2436 } 2437 if (((from_bitField0_ & 0x00000010) != 0)) { 2438 result.pageCount_ = pageCount_; 2439 } 2440 } 2441 2442 @java.lang.Override clone()2443 public Builder clone() { 2444 return super.clone(); 2445 } 2446 2447 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2448 public Builder setField( 2449 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2450 return super.setField(field, value); 2451 } 2452 2453 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2454 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 2455 return super.clearField(field); 2456 } 2457 2458 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2459 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 2460 return super.clearOneof(oneof); 2461 } 2462 2463 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2464 public Builder setRepeatedField( 2465 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 2466 return super.setRepeatedField(field, index, value); 2467 } 2468 2469 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2470 public Builder addRepeatedField( 2471 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2472 return super.addRepeatedField(field, value); 2473 } 2474 2475 @java.lang.Override mergeFrom(com.google.protobuf.Message other)2476 public Builder mergeFrom(com.google.protobuf.Message other) { 2477 if (other instanceof com.google.cloud.automl.v1.Document) { 2478 return mergeFrom((com.google.cloud.automl.v1.Document) other); 2479 } else { 2480 super.mergeFrom(other); 2481 return this; 2482 } 2483 } 2484 mergeFrom(com.google.cloud.automl.v1.Document other)2485 public Builder mergeFrom(com.google.cloud.automl.v1.Document other) { 2486 if (other == com.google.cloud.automl.v1.Document.getDefaultInstance()) return this; 2487 if (other.hasInputConfig()) { 2488 mergeInputConfig(other.getInputConfig()); 2489 } 2490 if (other.hasDocumentText()) { 2491 mergeDocumentText(other.getDocumentText()); 2492 } 2493 if (layoutBuilder_ == null) { 2494 if (!other.layout_.isEmpty()) { 2495 if (layout_.isEmpty()) { 2496 layout_ = other.layout_; 2497 bitField0_ = (bitField0_ & ~0x00000004); 2498 } else { 2499 ensureLayoutIsMutable(); 2500 layout_.addAll(other.layout_); 2501 } 2502 onChanged(); 2503 } 2504 } else { 2505 if (!other.layout_.isEmpty()) { 2506 if (layoutBuilder_.isEmpty()) { 2507 layoutBuilder_.dispose(); 2508 layoutBuilder_ = null; 2509 layout_ = other.layout_; 2510 bitField0_ = (bitField0_ & ~0x00000004); 2511 layoutBuilder_ = 2512 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 2513 ? getLayoutFieldBuilder() 2514 : null; 2515 } else { 2516 layoutBuilder_.addAllMessages(other.layout_); 2517 } 2518 } 2519 } 2520 if (other.hasDocumentDimensions()) { 2521 mergeDocumentDimensions(other.getDocumentDimensions()); 2522 } 2523 if (other.getPageCount() != 0) { 2524 setPageCount(other.getPageCount()); 2525 } 2526 this.mergeUnknownFields(other.getUnknownFields()); 2527 onChanged(); 2528 return this; 2529 } 2530 2531 @java.lang.Override isInitialized()2532 public final boolean isInitialized() { 2533 return true; 2534 } 2535 2536 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2537 public Builder mergeFrom( 2538 com.google.protobuf.CodedInputStream input, 2539 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2540 throws java.io.IOException { 2541 if (extensionRegistry == null) { 2542 throw new java.lang.NullPointerException(); 2543 } 2544 try { 2545 boolean done = false; 2546 while (!done) { 2547 int tag = input.readTag(); 2548 switch (tag) { 2549 case 0: 2550 done = true; 2551 break; 2552 case 10: 2553 { 2554 input.readMessage(getInputConfigFieldBuilder().getBuilder(), extensionRegistry); 2555 bitField0_ |= 0x00000001; 2556 break; 2557 } // case 10 2558 case 18: 2559 { 2560 input.readMessage(getDocumentTextFieldBuilder().getBuilder(), extensionRegistry); 2561 bitField0_ |= 0x00000002; 2562 break; 2563 } // case 18 2564 case 26: 2565 { 2566 com.google.cloud.automl.v1.Document.Layout m = 2567 input.readMessage( 2568 com.google.cloud.automl.v1.Document.Layout.parser(), extensionRegistry); 2569 if (layoutBuilder_ == null) { 2570 ensureLayoutIsMutable(); 2571 layout_.add(m); 2572 } else { 2573 layoutBuilder_.addMessage(m); 2574 } 2575 break; 2576 } // case 26 2577 case 34: 2578 { 2579 input.readMessage( 2580 getDocumentDimensionsFieldBuilder().getBuilder(), extensionRegistry); 2581 bitField0_ |= 0x00000008; 2582 break; 2583 } // case 34 2584 case 40: 2585 { 2586 pageCount_ = input.readInt32(); 2587 bitField0_ |= 0x00000010; 2588 break; 2589 } // case 40 2590 default: 2591 { 2592 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 2593 done = true; // was an endgroup tag 2594 } 2595 break; 2596 } // default: 2597 } // switch (tag) 2598 } // while (!done) 2599 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2600 throw e.unwrapIOException(); 2601 } finally { 2602 onChanged(); 2603 } // finally 2604 return this; 2605 } 2606 2607 private int bitField0_; 2608 2609 private com.google.cloud.automl.v1.DocumentInputConfig inputConfig_; 2610 private com.google.protobuf.SingleFieldBuilderV3< 2611 com.google.cloud.automl.v1.DocumentInputConfig, 2612 com.google.cloud.automl.v1.DocumentInputConfig.Builder, 2613 com.google.cloud.automl.v1.DocumentInputConfigOrBuilder> 2614 inputConfigBuilder_; 2615 /** 2616 * 2617 * 2618 * <pre> 2619 * An input config specifying the content of the document. 2620 * </pre> 2621 * 2622 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 2623 * 2624 * @return Whether the inputConfig field is set. 2625 */ hasInputConfig()2626 public boolean hasInputConfig() { 2627 return ((bitField0_ & 0x00000001) != 0); 2628 } 2629 /** 2630 * 2631 * 2632 * <pre> 2633 * An input config specifying the content of the document. 2634 * </pre> 2635 * 2636 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 2637 * 2638 * @return The inputConfig. 2639 */ getInputConfig()2640 public com.google.cloud.automl.v1.DocumentInputConfig getInputConfig() { 2641 if (inputConfigBuilder_ == null) { 2642 return inputConfig_ == null 2643 ? com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance() 2644 : inputConfig_; 2645 } else { 2646 return inputConfigBuilder_.getMessage(); 2647 } 2648 } 2649 /** 2650 * 2651 * 2652 * <pre> 2653 * An input config specifying the content of the document. 2654 * </pre> 2655 * 2656 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 2657 */ setInputConfig(com.google.cloud.automl.v1.DocumentInputConfig value)2658 public Builder setInputConfig(com.google.cloud.automl.v1.DocumentInputConfig value) { 2659 if (inputConfigBuilder_ == null) { 2660 if (value == null) { 2661 throw new NullPointerException(); 2662 } 2663 inputConfig_ = value; 2664 } else { 2665 inputConfigBuilder_.setMessage(value); 2666 } 2667 bitField0_ |= 0x00000001; 2668 onChanged(); 2669 return this; 2670 } 2671 /** 2672 * 2673 * 2674 * <pre> 2675 * An input config specifying the content of the document. 2676 * </pre> 2677 * 2678 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 2679 */ setInputConfig( com.google.cloud.automl.v1.DocumentInputConfig.Builder builderForValue)2680 public Builder setInputConfig( 2681 com.google.cloud.automl.v1.DocumentInputConfig.Builder builderForValue) { 2682 if (inputConfigBuilder_ == null) { 2683 inputConfig_ = builderForValue.build(); 2684 } else { 2685 inputConfigBuilder_.setMessage(builderForValue.build()); 2686 } 2687 bitField0_ |= 0x00000001; 2688 onChanged(); 2689 return this; 2690 } 2691 /** 2692 * 2693 * 2694 * <pre> 2695 * An input config specifying the content of the document. 2696 * </pre> 2697 * 2698 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 2699 */ mergeInputConfig(com.google.cloud.automl.v1.DocumentInputConfig value)2700 public Builder mergeInputConfig(com.google.cloud.automl.v1.DocumentInputConfig value) { 2701 if (inputConfigBuilder_ == null) { 2702 if (((bitField0_ & 0x00000001) != 0) 2703 && inputConfig_ != null 2704 && inputConfig_ 2705 != com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance()) { 2706 getInputConfigBuilder().mergeFrom(value); 2707 } else { 2708 inputConfig_ = value; 2709 } 2710 } else { 2711 inputConfigBuilder_.mergeFrom(value); 2712 } 2713 bitField0_ |= 0x00000001; 2714 onChanged(); 2715 return this; 2716 } 2717 /** 2718 * 2719 * 2720 * <pre> 2721 * An input config specifying the content of the document. 2722 * </pre> 2723 * 2724 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 2725 */ clearInputConfig()2726 public Builder clearInputConfig() { 2727 bitField0_ = (bitField0_ & ~0x00000001); 2728 inputConfig_ = null; 2729 if (inputConfigBuilder_ != null) { 2730 inputConfigBuilder_.dispose(); 2731 inputConfigBuilder_ = null; 2732 } 2733 onChanged(); 2734 return this; 2735 } 2736 /** 2737 * 2738 * 2739 * <pre> 2740 * An input config specifying the content of the document. 2741 * </pre> 2742 * 2743 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 2744 */ getInputConfigBuilder()2745 public com.google.cloud.automl.v1.DocumentInputConfig.Builder getInputConfigBuilder() { 2746 bitField0_ |= 0x00000001; 2747 onChanged(); 2748 return getInputConfigFieldBuilder().getBuilder(); 2749 } 2750 /** 2751 * 2752 * 2753 * <pre> 2754 * An input config specifying the content of the document. 2755 * </pre> 2756 * 2757 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 2758 */ getInputConfigOrBuilder()2759 public com.google.cloud.automl.v1.DocumentInputConfigOrBuilder getInputConfigOrBuilder() { 2760 if (inputConfigBuilder_ != null) { 2761 return inputConfigBuilder_.getMessageOrBuilder(); 2762 } else { 2763 return inputConfig_ == null 2764 ? com.google.cloud.automl.v1.DocumentInputConfig.getDefaultInstance() 2765 : inputConfig_; 2766 } 2767 } 2768 /** 2769 * 2770 * 2771 * <pre> 2772 * An input config specifying the content of the document. 2773 * </pre> 2774 * 2775 * <code>.google.cloud.automl.v1.DocumentInputConfig input_config = 1;</code> 2776 */ 2777 private com.google.protobuf.SingleFieldBuilderV3< 2778 com.google.cloud.automl.v1.DocumentInputConfig, 2779 com.google.cloud.automl.v1.DocumentInputConfig.Builder, 2780 com.google.cloud.automl.v1.DocumentInputConfigOrBuilder> getInputConfigFieldBuilder()2781 getInputConfigFieldBuilder() { 2782 if (inputConfigBuilder_ == null) { 2783 inputConfigBuilder_ = 2784 new com.google.protobuf.SingleFieldBuilderV3< 2785 com.google.cloud.automl.v1.DocumentInputConfig, 2786 com.google.cloud.automl.v1.DocumentInputConfig.Builder, 2787 com.google.cloud.automl.v1.DocumentInputConfigOrBuilder>( 2788 getInputConfig(), getParentForChildren(), isClean()); 2789 inputConfig_ = null; 2790 } 2791 return inputConfigBuilder_; 2792 } 2793 2794 private com.google.cloud.automl.v1.TextSnippet documentText_; 2795 private com.google.protobuf.SingleFieldBuilderV3< 2796 com.google.cloud.automl.v1.TextSnippet, 2797 com.google.cloud.automl.v1.TextSnippet.Builder, 2798 com.google.cloud.automl.v1.TextSnippetOrBuilder> 2799 documentTextBuilder_; 2800 /** 2801 * 2802 * 2803 * <pre> 2804 * The plain text version of this document. 2805 * </pre> 2806 * 2807 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 2808 * 2809 * @return Whether the documentText field is set. 2810 */ hasDocumentText()2811 public boolean hasDocumentText() { 2812 return ((bitField0_ & 0x00000002) != 0); 2813 } 2814 /** 2815 * 2816 * 2817 * <pre> 2818 * The plain text version of this document. 2819 * </pre> 2820 * 2821 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 2822 * 2823 * @return The documentText. 2824 */ getDocumentText()2825 public com.google.cloud.automl.v1.TextSnippet getDocumentText() { 2826 if (documentTextBuilder_ == null) { 2827 return documentText_ == null 2828 ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() 2829 : documentText_; 2830 } else { 2831 return documentTextBuilder_.getMessage(); 2832 } 2833 } 2834 /** 2835 * 2836 * 2837 * <pre> 2838 * The plain text version of this document. 2839 * </pre> 2840 * 2841 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 2842 */ setDocumentText(com.google.cloud.automl.v1.TextSnippet value)2843 public Builder setDocumentText(com.google.cloud.automl.v1.TextSnippet value) { 2844 if (documentTextBuilder_ == null) { 2845 if (value == null) { 2846 throw new NullPointerException(); 2847 } 2848 documentText_ = value; 2849 } else { 2850 documentTextBuilder_.setMessage(value); 2851 } 2852 bitField0_ |= 0x00000002; 2853 onChanged(); 2854 return this; 2855 } 2856 /** 2857 * 2858 * 2859 * <pre> 2860 * The plain text version of this document. 2861 * </pre> 2862 * 2863 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 2864 */ setDocumentText(com.google.cloud.automl.v1.TextSnippet.Builder builderForValue)2865 public Builder setDocumentText(com.google.cloud.automl.v1.TextSnippet.Builder builderForValue) { 2866 if (documentTextBuilder_ == null) { 2867 documentText_ = builderForValue.build(); 2868 } else { 2869 documentTextBuilder_.setMessage(builderForValue.build()); 2870 } 2871 bitField0_ |= 0x00000002; 2872 onChanged(); 2873 return this; 2874 } 2875 /** 2876 * 2877 * 2878 * <pre> 2879 * The plain text version of this document. 2880 * </pre> 2881 * 2882 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 2883 */ mergeDocumentText(com.google.cloud.automl.v1.TextSnippet value)2884 public Builder mergeDocumentText(com.google.cloud.automl.v1.TextSnippet value) { 2885 if (documentTextBuilder_ == null) { 2886 if (((bitField0_ & 0x00000002) != 0) 2887 && documentText_ != null 2888 && documentText_ != com.google.cloud.automl.v1.TextSnippet.getDefaultInstance()) { 2889 getDocumentTextBuilder().mergeFrom(value); 2890 } else { 2891 documentText_ = value; 2892 } 2893 } else { 2894 documentTextBuilder_.mergeFrom(value); 2895 } 2896 bitField0_ |= 0x00000002; 2897 onChanged(); 2898 return this; 2899 } 2900 /** 2901 * 2902 * 2903 * <pre> 2904 * The plain text version of this document. 2905 * </pre> 2906 * 2907 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 2908 */ clearDocumentText()2909 public Builder clearDocumentText() { 2910 bitField0_ = (bitField0_ & ~0x00000002); 2911 documentText_ = null; 2912 if (documentTextBuilder_ != null) { 2913 documentTextBuilder_.dispose(); 2914 documentTextBuilder_ = null; 2915 } 2916 onChanged(); 2917 return this; 2918 } 2919 /** 2920 * 2921 * 2922 * <pre> 2923 * The plain text version of this document. 2924 * </pre> 2925 * 2926 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 2927 */ getDocumentTextBuilder()2928 public com.google.cloud.automl.v1.TextSnippet.Builder getDocumentTextBuilder() { 2929 bitField0_ |= 0x00000002; 2930 onChanged(); 2931 return getDocumentTextFieldBuilder().getBuilder(); 2932 } 2933 /** 2934 * 2935 * 2936 * <pre> 2937 * The plain text version of this document. 2938 * </pre> 2939 * 2940 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 2941 */ getDocumentTextOrBuilder()2942 public com.google.cloud.automl.v1.TextSnippetOrBuilder getDocumentTextOrBuilder() { 2943 if (documentTextBuilder_ != null) { 2944 return documentTextBuilder_.getMessageOrBuilder(); 2945 } else { 2946 return documentText_ == null 2947 ? com.google.cloud.automl.v1.TextSnippet.getDefaultInstance() 2948 : documentText_; 2949 } 2950 } 2951 /** 2952 * 2953 * 2954 * <pre> 2955 * The plain text version of this document. 2956 * </pre> 2957 * 2958 * <code>.google.cloud.automl.v1.TextSnippet document_text = 2;</code> 2959 */ 2960 private com.google.protobuf.SingleFieldBuilderV3< 2961 com.google.cloud.automl.v1.TextSnippet, 2962 com.google.cloud.automl.v1.TextSnippet.Builder, 2963 com.google.cloud.automl.v1.TextSnippetOrBuilder> getDocumentTextFieldBuilder()2964 getDocumentTextFieldBuilder() { 2965 if (documentTextBuilder_ == null) { 2966 documentTextBuilder_ = 2967 new com.google.protobuf.SingleFieldBuilderV3< 2968 com.google.cloud.automl.v1.TextSnippet, 2969 com.google.cloud.automl.v1.TextSnippet.Builder, 2970 com.google.cloud.automl.v1.TextSnippetOrBuilder>( 2971 getDocumentText(), getParentForChildren(), isClean()); 2972 documentText_ = null; 2973 } 2974 return documentTextBuilder_; 2975 } 2976 2977 private java.util.List<com.google.cloud.automl.v1.Document.Layout> layout_ = 2978 java.util.Collections.emptyList(); 2979 ensureLayoutIsMutable()2980 private void ensureLayoutIsMutable() { 2981 if (!((bitField0_ & 0x00000004) != 0)) { 2982 layout_ = new java.util.ArrayList<com.google.cloud.automl.v1.Document.Layout>(layout_); 2983 bitField0_ |= 0x00000004; 2984 } 2985 } 2986 2987 private com.google.protobuf.RepeatedFieldBuilderV3< 2988 com.google.cloud.automl.v1.Document.Layout, 2989 com.google.cloud.automl.v1.Document.Layout.Builder, 2990 com.google.cloud.automl.v1.Document.LayoutOrBuilder> 2991 layoutBuilder_; 2992 2993 /** 2994 * 2995 * 2996 * <pre> 2997 * Describes the layout of the document. 2998 * Sorted by [page_number][]. 2999 * </pre> 3000 * 3001 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3002 */ getLayoutList()3003 public java.util.List<com.google.cloud.automl.v1.Document.Layout> getLayoutList() { 3004 if (layoutBuilder_ == null) { 3005 return java.util.Collections.unmodifiableList(layout_); 3006 } else { 3007 return layoutBuilder_.getMessageList(); 3008 } 3009 } 3010 /** 3011 * 3012 * 3013 * <pre> 3014 * Describes the layout of the document. 3015 * Sorted by [page_number][]. 3016 * </pre> 3017 * 3018 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3019 */ getLayoutCount()3020 public int getLayoutCount() { 3021 if (layoutBuilder_ == null) { 3022 return layout_.size(); 3023 } else { 3024 return layoutBuilder_.getCount(); 3025 } 3026 } 3027 /** 3028 * 3029 * 3030 * <pre> 3031 * Describes the layout of the document. 3032 * Sorted by [page_number][]. 3033 * </pre> 3034 * 3035 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3036 */ getLayout(int index)3037 public com.google.cloud.automl.v1.Document.Layout getLayout(int index) { 3038 if (layoutBuilder_ == null) { 3039 return layout_.get(index); 3040 } else { 3041 return layoutBuilder_.getMessage(index); 3042 } 3043 } 3044 /** 3045 * 3046 * 3047 * <pre> 3048 * Describes the layout of the document. 3049 * Sorted by [page_number][]. 3050 * </pre> 3051 * 3052 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3053 */ setLayout(int index, com.google.cloud.automl.v1.Document.Layout value)3054 public Builder setLayout(int index, com.google.cloud.automl.v1.Document.Layout value) { 3055 if (layoutBuilder_ == null) { 3056 if (value == null) { 3057 throw new NullPointerException(); 3058 } 3059 ensureLayoutIsMutable(); 3060 layout_.set(index, value); 3061 onChanged(); 3062 } else { 3063 layoutBuilder_.setMessage(index, value); 3064 } 3065 return this; 3066 } 3067 /** 3068 * 3069 * 3070 * <pre> 3071 * Describes the layout of the document. 3072 * Sorted by [page_number][]. 3073 * </pre> 3074 * 3075 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3076 */ setLayout( int index, com.google.cloud.automl.v1.Document.Layout.Builder builderForValue)3077 public Builder setLayout( 3078 int index, com.google.cloud.automl.v1.Document.Layout.Builder builderForValue) { 3079 if (layoutBuilder_ == null) { 3080 ensureLayoutIsMutable(); 3081 layout_.set(index, builderForValue.build()); 3082 onChanged(); 3083 } else { 3084 layoutBuilder_.setMessage(index, builderForValue.build()); 3085 } 3086 return this; 3087 } 3088 /** 3089 * 3090 * 3091 * <pre> 3092 * Describes the layout of the document. 3093 * Sorted by [page_number][]. 3094 * </pre> 3095 * 3096 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3097 */ addLayout(com.google.cloud.automl.v1.Document.Layout value)3098 public Builder addLayout(com.google.cloud.automl.v1.Document.Layout value) { 3099 if (layoutBuilder_ == null) { 3100 if (value == null) { 3101 throw new NullPointerException(); 3102 } 3103 ensureLayoutIsMutable(); 3104 layout_.add(value); 3105 onChanged(); 3106 } else { 3107 layoutBuilder_.addMessage(value); 3108 } 3109 return this; 3110 } 3111 /** 3112 * 3113 * 3114 * <pre> 3115 * Describes the layout of the document. 3116 * Sorted by [page_number][]. 3117 * </pre> 3118 * 3119 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3120 */ addLayout(int index, com.google.cloud.automl.v1.Document.Layout value)3121 public Builder addLayout(int index, com.google.cloud.automl.v1.Document.Layout value) { 3122 if (layoutBuilder_ == null) { 3123 if (value == null) { 3124 throw new NullPointerException(); 3125 } 3126 ensureLayoutIsMutable(); 3127 layout_.add(index, value); 3128 onChanged(); 3129 } else { 3130 layoutBuilder_.addMessage(index, value); 3131 } 3132 return this; 3133 } 3134 /** 3135 * 3136 * 3137 * <pre> 3138 * Describes the layout of the document. 3139 * Sorted by [page_number][]. 3140 * </pre> 3141 * 3142 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3143 */ addLayout(com.google.cloud.automl.v1.Document.Layout.Builder builderForValue)3144 public Builder addLayout(com.google.cloud.automl.v1.Document.Layout.Builder builderForValue) { 3145 if (layoutBuilder_ == null) { 3146 ensureLayoutIsMutable(); 3147 layout_.add(builderForValue.build()); 3148 onChanged(); 3149 } else { 3150 layoutBuilder_.addMessage(builderForValue.build()); 3151 } 3152 return this; 3153 } 3154 /** 3155 * 3156 * 3157 * <pre> 3158 * Describes the layout of the document. 3159 * Sorted by [page_number][]. 3160 * </pre> 3161 * 3162 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3163 */ addLayout( int index, com.google.cloud.automl.v1.Document.Layout.Builder builderForValue)3164 public Builder addLayout( 3165 int index, com.google.cloud.automl.v1.Document.Layout.Builder builderForValue) { 3166 if (layoutBuilder_ == null) { 3167 ensureLayoutIsMutable(); 3168 layout_.add(index, builderForValue.build()); 3169 onChanged(); 3170 } else { 3171 layoutBuilder_.addMessage(index, builderForValue.build()); 3172 } 3173 return this; 3174 } 3175 /** 3176 * 3177 * 3178 * <pre> 3179 * Describes the layout of the document. 3180 * Sorted by [page_number][]. 3181 * </pre> 3182 * 3183 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3184 */ addAllLayout( java.lang.Iterable<? extends com.google.cloud.automl.v1.Document.Layout> values)3185 public Builder addAllLayout( 3186 java.lang.Iterable<? extends com.google.cloud.automl.v1.Document.Layout> values) { 3187 if (layoutBuilder_ == null) { 3188 ensureLayoutIsMutable(); 3189 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, layout_); 3190 onChanged(); 3191 } else { 3192 layoutBuilder_.addAllMessages(values); 3193 } 3194 return this; 3195 } 3196 /** 3197 * 3198 * 3199 * <pre> 3200 * Describes the layout of the document. 3201 * Sorted by [page_number][]. 3202 * </pre> 3203 * 3204 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3205 */ clearLayout()3206 public Builder clearLayout() { 3207 if (layoutBuilder_ == null) { 3208 layout_ = java.util.Collections.emptyList(); 3209 bitField0_ = (bitField0_ & ~0x00000004); 3210 onChanged(); 3211 } else { 3212 layoutBuilder_.clear(); 3213 } 3214 return this; 3215 } 3216 /** 3217 * 3218 * 3219 * <pre> 3220 * Describes the layout of the document. 3221 * Sorted by [page_number][]. 3222 * </pre> 3223 * 3224 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3225 */ removeLayout(int index)3226 public Builder removeLayout(int index) { 3227 if (layoutBuilder_ == null) { 3228 ensureLayoutIsMutable(); 3229 layout_.remove(index); 3230 onChanged(); 3231 } else { 3232 layoutBuilder_.remove(index); 3233 } 3234 return this; 3235 } 3236 /** 3237 * 3238 * 3239 * <pre> 3240 * Describes the layout of the document. 3241 * Sorted by [page_number][]. 3242 * </pre> 3243 * 3244 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3245 */ getLayoutBuilder(int index)3246 public com.google.cloud.automl.v1.Document.Layout.Builder getLayoutBuilder(int index) { 3247 return getLayoutFieldBuilder().getBuilder(index); 3248 } 3249 /** 3250 * 3251 * 3252 * <pre> 3253 * Describes the layout of the document. 3254 * Sorted by [page_number][]. 3255 * </pre> 3256 * 3257 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3258 */ getLayoutOrBuilder(int index)3259 public com.google.cloud.automl.v1.Document.LayoutOrBuilder getLayoutOrBuilder(int index) { 3260 if (layoutBuilder_ == null) { 3261 return layout_.get(index); 3262 } else { 3263 return layoutBuilder_.getMessageOrBuilder(index); 3264 } 3265 } 3266 /** 3267 * 3268 * 3269 * <pre> 3270 * Describes the layout of the document. 3271 * Sorted by [page_number][]. 3272 * </pre> 3273 * 3274 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3275 */ 3276 public java.util.List<? extends com.google.cloud.automl.v1.Document.LayoutOrBuilder> getLayoutOrBuilderList()3277 getLayoutOrBuilderList() { 3278 if (layoutBuilder_ != null) { 3279 return layoutBuilder_.getMessageOrBuilderList(); 3280 } else { 3281 return java.util.Collections.unmodifiableList(layout_); 3282 } 3283 } 3284 /** 3285 * 3286 * 3287 * <pre> 3288 * Describes the layout of the document. 3289 * Sorted by [page_number][]. 3290 * </pre> 3291 * 3292 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3293 */ addLayoutBuilder()3294 public com.google.cloud.automl.v1.Document.Layout.Builder addLayoutBuilder() { 3295 return getLayoutFieldBuilder() 3296 .addBuilder(com.google.cloud.automl.v1.Document.Layout.getDefaultInstance()); 3297 } 3298 /** 3299 * 3300 * 3301 * <pre> 3302 * Describes the layout of the document. 3303 * Sorted by [page_number][]. 3304 * </pre> 3305 * 3306 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3307 */ addLayoutBuilder(int index)3308 public com.google.cloud.automl.v1.Document.Layout.Builder addLayoutBuilder(int index) { 3309 return getLayoutFieldBuilder() 3310 .addBuilder(index, com.google.cloud.automl.v1.Document.Layout.getDefaultInstance()); 3311 } 3312 /** 3313 * 3314 * 3315 * <pre> 3316 * Describes the layout of the document. 3317 * Sorted by [page_number][]. 3318 * </pre> 3319 * 3320 * <code>repeated .google.cloud.automl.v1.Document.Layout layout = 3;</code> 3321 */ 3322 public java.util.List<com.google.cloud.automl.v1.Document.Layout.Builder> getLayoutBuilderList()3323 getLayoutBuilderList() { 3324 return getLayoutFieldBuilder().getBuilderList(); 3325 } 3326 3327 private com.google.protobuf.RepeatedFieldBuilderV3< 3328 com.google.cloud.automl.v1.Document.Layout, 3329 com.google.cloud.automl.v1.Document.Layout.Builder, 3330 com.google.cloud.automl.v1.Document.LayoutOrBuilder> getLayoutFieldBuilder()3331 getLayoutFieldBuilder() { 3332 if (layoutBuilder_ == null) { 3333 layoutBuilder_ = 3334 new com.google.protobuf.RepeatedFieldBuilderV3< 3335 com.google.cloud.automl.v1.Document.Layout, 3336 com.google.cloud.automl.v1.Document.Layout.Builder, 3337 com.google.cloud.automl.v1.Document.LayoutOrBuilder>( 3338 layout_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); 3339 layout_ = null; 3340 } 3341 return layoutBuilder_; 3342 } 3343 3344 private com.google.cloud.automl.v1.DocumentDimensions documentDimensions_; 3345 private com.google.protobuf.SingleFieldBuilderV3< 3346 com.google.cloud.automl.v1.DocumentDimensions, 3347 com.google.cloud.automl.v1.DocumentDimensions.Builder, 3348 com.google.cloud.automl.v1.DocumentDimensionsOrBuilder> 3349 documentDimensionsBuilder_; 3350 /** 3351 * 3352 * 3353 * <pre> 3354 * The dimensions of the page in the document. 3355 * </pre> 3356 * 3357 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 3358 * 3359 * @return Whether the documentDimensions field is set. 3360 */ hasDocumentDimensions()3361 public boolean hasDocumentDimensions() { 3362 return ((bitField0_ & 0x00000008) != 0); 3363 } 3364 /** 3365 * 3366 * 3367 * <pre> 3368 * The dimensions of the page in the document. 3369 * </pre> 3370 * 3371 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 3372 * 3373 * @return The documentDimensions. 3374 */ getDocumentDimensions()3375 public com.google.cloud.automl.v1.DocumentDimensions getDocumentDimensions() { 3376 if (documentDimensionsBuilder_ == null) { 3377 return documentDimensions_ == null 3378 ? com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance() 3379 : documentDimensions_; 3380 } else { 3381 return documentDimensionsBuilder_.getMessage(); 3382 } 3383 } 3384 /** 3385 * 3386 * 3387 * <pre> 3388 * The dimensions of the page in the document. 3389 * </pre> 3390 * 3391 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 3392 */ setDocumentDimensions(com.google.cloud.automl.v1.DocumentDimensions value)3393 public Builder setDocumentDimensions(com.google.cloud.automl.v1.DocumentDimensions value) { 3394 if (documentDimensionsBuilder_ == null) { 3395 if (value == null) { 3396 throw new NullPointerException(); 3397 } 3398 documentDimensions_ = value; 3399 } else { 3400 documentDimensionsBuilder_.setMessage(value); 3401 } 3402 bitField0_ |= 0x00000008; 3403 onChanged(); 3404 return this; 3405 } 3406 /** 3407 * 3408 * 3409 * <pre> 3410 * The dimensions of the page in the document. 3411 * </pre> 3412 * 3413 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 3414 */ setDocumentDimensions( com.google.cloud.automl.v1.DocumentDimensions.Builder builderForValue)3415 public Builder setDocumentDimensions( 3416 com.google.cloud.automl.v1.DocumentDimensions.Builder builderForValue) { 3417 if (documentDimensionsBuilder_ == null) { 3418 documentDimensions_ = builderForValue.build(); 3419 } else { 3420 documentDimensionsBuilder_.setMessage(builderForValue.build()); 3421 } 3422 bitField0_ |= 0x00000008; 3423 onChanged(); 3424 return this; 3425 } 3426 /** 3427 * 3428 * 3429 * <pre> 3430 * The dimensions of the page in the document. 3431 * </pre> 3432 * 3433 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 3434 */ mergeDocumentDimensions(com.google.cloud.automl.v1.DocumentDimensions value)3435 public Builder mergeDocumentDimensions(com.google.cloud.automl.v1.DocumentDimensions value) { 3436 if (documentDimensionsBuilder_ == null) { 3437 if (((bitField0_ & 0x00000008) != 0) 3438 && documentDimensions_ != null 3439 && documentDimensions_ 3440 != com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance()) { 3441 getDocumentDimensionsBuilder().mergeFrom(value); 3442 } else { 3443 documentDimensions_ = value; 3444 } 3445 } else { 3446 documentDimensionsBuilder_.mergeFrom(value); 3447 } 3448 bitField0_ |= 0x00000008; 3449 onChanged(); 3450 return this; 3451 } 3452 /** 3453 * 3454 * 3455 * <pre> 3456 * The dimensions of the page in the document. 3457 * </pre> 3458 * 3459 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 3460 */ clearDocumentDimensions()3461 public Builder clearDocumentDimensions() { 3462 bitField0_ = (bitField0_ & ~0x00000008); 3463 documentDimensions_ = null; 3464 if (documentDimensionsBuilder_ != null) { 3465 documentDimensionsBuilder_.dispose(); 3466 documentDimensionsBuilder_ = null; 3467 } 3468 onChanged(); 3469 return this; 3470 } 3471 /** 3472 * 3473 * 3474 * <pre> 3475 * The dimensions of the page in the document. 3476 * </pre> 3477 * 3478 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 3479 */ getDocumentDimensionsBuilder()3480 public com.google.cloud.automl.v1.DocumentDimensions.Builder getDocumentDimensionsBuilder() { 3481 bitField0_ |= 0x00000008; 3482 onChanged(); 3483 return getDocumentDimensionsFieldBuilder().getBuilder(); 3484 } 3485 /** 3486 * 3487 * 3488 * <pre> 3489 * The dimensions of the page in the document. 3490 * </pre> 3491 * 3492 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 3493 */ getDocumentDimensionsOrBuilder()3494 public com.google.cloud.automl.v1.DocumentDimensionsOrBuilder getDocumentDimensionsOrBuilder() { 3495 if (documentDimensionsBuilder_ != null) { 3496 return documentDimensionsBuilder_.getMessageOrBuilder(); 3497 } else { 3498 return documentDimensions_ == null 3499 ? com.google.cloud.automl.v1.DocumentDimensions.getDefaultInstance() 3500 : documentDimensions_; 3501 } 3502 } 3503 /** 3504 * 3505 * 3506 * <pre> 3507 * The dimensions of the page in the document. 3508 * </pre> 3509 * 3510 * <code>.google.cloud.automl.v1.DocumentDimensions document_dimensions = 4;</code> 3511 */ 3512 private com.google.protobuf.SingleFieldBuilderV3< 3513 com.google.cloud.automl.v1.DocumentDimensions, 3514 com.google.cloud.automl.v1.DocumentDimensions.Builder, 3515 com.google.cloud.automl.v1.DocumentDimensionsOrBuilder> getDocumentDimensionsFieldBuilder()3516 getDocumentDimensionsFieldBuilder() { 3517 if (documentDimensionsBuilder_ == null) { 3518 documentDimensionsBuilder_ = 3519 new com.google.protobuf.SingleFieldBuilderV3< 3520 com.google.cloud.automl.v1.DocumentDimensions, 3521 com.google.cloud.automl.v1.DocumentDimensions.Builder, 3522 com.google.cloud.automl.v1.DocumentDimensionsOrBuilder>( 3523 getDocumentDimensions(), getParentForChildren(), isClean()); 3524 documentDimensions_ = null; 3525 } 3526 return documentDimensionsBuilder_; 3527 } 3528 3529 private int pageCount_; 3530 /** 3531 * 3532 * 3533 * <pre> 3534 * Number of pages in the document. 3535 * </pre> 3536 * 3537 * <code>int32 page_count = 5;</code> 3538 * 3539 * @return The pageCount. 3540 */ 3541 @java.lang.Override getPageCount()3542 public int getPageCount() { 3543 return pageCount_; 3544 } 3545 /** 3546 * 3547 * 3548 * <pre> 3549 * Number of pages in the document. 3550 * </pre> 3551 * 3552 * <code>int32 page_count = 5;</code> 3553 * 3554 * @param value The pageCount to set. 3555 * @return This builder for chaining. 3556 */ setPageCount(int value)3557 public Builder setPageCount(int value) { 3558 3559 pageCount_ = value; 3560 bitField0_ |= 0x00000010; 3561 onChanged(); 3562 return this; 3563 } 3564 /** 3565 * 3566 * 3567 * <pre> 3568 * Number of pages in the document. 3569 * </pre> 3570 * 3571 * <code>int32 page_count = 5;</code> 3572 * 3573 * @return This builder for chaining. 3574 */ clearPageCount()3575 public Builder clearPageCount() { 3576 bitField0_ = (bitField0_ & ~0x00000010); 3577 pageCount_ = 0; 3578 onChanged(); 3579 return this; 3580 } 3581 3582 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)3583 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 3584 return super.setUnknownFields(unknownFields); 3585 } 3586 3587 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3588 public final Builder mergeUnknownFields( 3589 final com.google.protobuf.UnknownFieldSet unknownFields) { 3590 return super.mergeUnknownFields(unknownFields); 3591 } 3592 3593 // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.Document) 3594 } 3595 3596 // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.Document) 3597 private static final com.google.cloud.automl.v1.Document DEFAULT_INSTANCE; 3598 3599 static { 3600 DEFAULT_INSTANCE = new com.google.cloud.automl.v1.Document(); 3601 } 3602 getDefaultInstance()3603 public static com.google.cloud.automl.v1.Document getDefaultInstance() { 3604 return DEFAULT_INSTANCE; 3605 } 3606 3607 private static final com.google.protobuf.Parser<Document> PARSER = 3608 new com.google.protobuf.AbstractParser<Document>() { 3609 @java.lang.Override 3610 public Document parsePartialFrom( 3611 com.google.protobuf.CodedInputStream input, 3612 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3613 throws com.google.protobuf.InvalidProtocolBufferException { 3614 Builder builder = newBuilder(); 3615 try { 3616 builder.mergeFrom(input, extensionRegistry); 3617 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 3618 throw e.setUnfinishedMessage(builder.buildPartial()); 3619 } catch (com.google.protobuf.UninitializedMessageException e) { 3620 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 3621 } catch (java.io.IOException e) { 3622 throw new com.google.protobuf.InvalidProtocolBufferException(e) 3623 .setUnfinishedMessage(builder.buildPartial()); 3624 } 3625 return builder.buildPartial(); 3626 } 3627 }; 3628 parser()3629 public static com.google.protobuf.Parser<Document> parser() { 3630 return PARSER; 3631 } 3632 3633 @java.lang.Override getParserForType()3634 public com.google.protobuf.Parser<Document> getParserForType() { 3635 return PARSER; 3636 } 3637 3638 @java.lang.Override getDefaultInstanceForType()3639 public com.google.cloud.automl.v1.Document getDefaultInstanceForType() { 3640 return DEFAULT_INSTANCE; 3641 } 3642 } 3643