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