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