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