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