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 * Source describes the location of the source used for the build. 27 * </pre> 28 * 29 * Protobuf type {@code grafeas.v1.Source} 30 */ 31 public final class Source extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:grafeas.v1.Source) 34 SourceOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use Source.newBuilder() to construct. Source(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private Source(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 Source()41 private Source() { 42 artifactStorageSourceUri_ = ""; 43 additionalContexts_ = java.util.Collections.emptyList(); 44 } 45 46 @java.lang.Override 47 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)48 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 49 return new Source(); 50 } 51 52 @java.lang.Override getUnknownFields()53 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 54 return this.unknownFields; 55 } 56 getDescriptor()57 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 58 return io.grafeas.v1.Provenance.internal_static_grafeas_v1_Source_descriptor; 59 } 60 61 @SuppressWarnings({"rawtypes"}) 62 @java.lang.Override internalGetMapField(int number)63 protected com.google.protobuf.MapField internalGetMapField(int number) { 64 switch (number) { 65 case 2: 66 return internalGetFileHashes(); 67 default: 68 throw new RuntimeException("Invalid map field number: " + number); 69 } 70 } 71 72 @java.lang.Override 73 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()74 internalGetFieldAccessorTable() { 75 return io.grafeas.v1.Provenance.internal_static_grafeas_v1_Source_fieldAccessorTable 76 .ensureFieldAccessorsInitialized( 77 io.grafeas.v1.Source.class, io.grafeas.v1.Source.Builder.class); 78 } 79 80 public static final int ARTIFACT_STORAGE_SOURCE_URI_FIELD_NUMBER = 1; 81 82 @SuppressWarnings("serial") 83 private volatile java.lang.Object artifactStorageSourceUri_ = ""; 84 /** 85 * 86 * 87 * <pre> 88 * If provided, the input binary artifacts for the build came from this 89 * location. 90 * </pre> 91 * 92 * <code>string artifact_storage_source_uri = 1;</code> 93 * 94 * @return The artifactStorageSourceUri. 95 */ 96 @java.lang.Override getArtifactStorageSourceUri()97 public java.lang.String getArtifactStorageSourceUri() { 98 java.lang.Object ref = artifactStorageSourceUri_; 99 if (ref instanceof java.lang.String) { 100 return (java.lang.String) ref; 101 } else { 102 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 103 java.lang.String s = bs.toStringUtf8(); 104 artifactStorageSourceUri_ = s; 105 return s; 106 } 107 } 108 /** 109 * 110 * 111 * <pre> 112 * If provided, the input binary artifacts for the build came from this 113 * location. 114 * </pre> 115 * 116 * <code>string artifact_storage_source_uri = 1;</code> 117 * 118 * @return The bytes for artifactStorageSourceUri. 119 */ 120 @java.lang.Override getArtifactStorageSourceUriBytes()121 public com.google.protobuf.ByteString getArtifactStorageSourceUriBytes() { 122 java.lang.Object ref = artifactStorageSourceUri_; 123 if (ref instanceof java.lang.String) { 124 com.google.protobuf.ByteString b = 125 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 126 artifactStorageSourceUri_ = b; 127 return b; 128 } else { 129 return (com.google.protobuf.ByteString) ref; 130 } 131 } 132 133 public static final int FILE_HASHES_FIELD_NUMBER = 2; 134 135 private static final class FileHashesDefaultEntryHolder { 136 static final com.google.protobuf.MapEntry<java.lang.String, io.grafeas.v1.FileHashes> 137 defaultEntry = 138 com.google.protobuf.MapEntry 139 .<java.lang.String, io.grafeas.v1.FileHashes>newDefaultInstance( 140 io.grafeas.v1.Provenance 141 .internal_static_grafeas_v1_Source_FileHashesEntry_descriptor, 142 com.google.protobuf.WireFormat.FieldType.STRING, 143 "", 144 com.google.protobuf.WireFormat.FieldType.MESSAGE, 145 io.grafeas.v1.FileHashes.getDefaultInstance()); 146 } 147 148 @SuppressWarnings("serial") 149 private com.google.protobuf.MapField<java.lang.String, io.grafeas.v1.FileHashes> fileHashes_; 150 151 private com.google.protobuf.MapField<java.lang.String, io.grafeas.v1.FileHashes> internalGetFileHashes()152 internalGetFileHashes() { 153 if (fileHashes_ == null) { 154 return com.google.protobuf.MapField.emptyMapField(FileHashesDefaultEntryHolder.defaultEntry); 155 } 156 return fileHashes_; 157 } 158 getFileHashesCount()159 public int getFileHashesCount() { 160 return internalGetFileHashes().getMap().size(); 161 } 162 /** 163 * 164 * 165 * <pre> 166 * Hash(es) of the build source, which can be used to verify that the original 167 * source integrity was maintained in the build. 168 * The keys to this map are file paths used as build source and the values 169 * contain the hash values for those files. 170 * If the build source came in a single package such as a gzipped tarfile 171 * (.tar.gz), the FileHash will be for the single path to that file. 172 * </pre> 173 * 174 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 175 */ 176 @java.lang.Override containsFileHashes(java.lang.String key)177 public boolean containsFileHashes(java.lang.String key) { 178 if (key == null) { 179 throw new NullPointerException("map key"); 180 } 181 return internalGetFileHashes().getMap().containsKey(key); 182 } 183 /** Use {@link #getFileHashesMap()} instead. */ 184 @java.lang.Override 185 @java.lang.Deprecated getFileHashes()186 public java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> getFileHashes() { 187 return getFileHashesMap(); 188 } 189 /** 190 * 191 * 192 * <pre> 193 * Hash(es) of the build source, which can be used to verify that the original 194 * source integrity was maintained in the build. 195 * The keys to this map are file paths used as build source and the values 196 * contain the hash values for those files. 197 * If the build source came in a single package such as a gzipped tarfile 198 * (.tar.gz), the FileHash will be for the single path to that file. 199 * </pre> 200 * 201 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 202 */ 203 @java.lang.Override getFileHashesMap()204 public java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> getFileHashesMap() { 205 return internalGetFileHashes().getMap(); 206 } 207 /** 208 * 209 * 210 * <pre> 211 * Hash(es) of the build source, which can be used to verify that the original 212 * source integrity was maintained in the build. 213 * The keys to this map are file paths used as build source and the values 214 * contain the hash values for those files. 215 * If the build source came in a single package such as a gzipped tarfile 216 * (.tar.gz), the FileHash will be for the single path to that file. 217 * </pre> 218 * 219 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 220 */ 221 @java.lang.Override getFileHashesOrDefault( java.lang.String key, io.grafeas.v1.FileHashes defaultValue)222 public /* nullable */ io.grafeas.v1.FileHashes getFileHashesOrDefault( 223 java.lang.String key, 224 /* nullable */ 225 io.grafeas.v1.FileHashes defaultValue) { 226 if (key == null) { 227 throw new NullPointerException("map key"); 228 } 229 java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> map = 230 internalGetFileHashes().getMap(); 231 return map.containsKey(key) ? map.get(key) : defaultValue; 232 } 233 /** 234 * 235 * 236 * <pre> 237 * Hash(es) of the build source, which can be used to verify that the original 238 * source integrity was maintained in the build. 239 * The keys to this map are file paths used as build source and the values 240 * contain the hash values for those files. 241 * If the build source came in a single package such as a gzipped tarfile 242 * (.tar.gz), the FileHash will be for the single path to that file. 243 * </pre> 244 * 245 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 246 */ 247 @java.lang.Override getFileHashesOrThrow(java.lang.String key)248 public io.grafeas.v1.FileHashes getFileHashesOrThrow(java.lang.String key) { 249 if (key == null) { 250 throw new NullPointerException("map key"); 251 } 252 java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> map = 253 internalGetFileHashes().getMap(); 254 if (!map.containsKey(key)) { 255 throw new java.lang.IllegalArgumentException(); 256 } 257 return map.get(key); 258 } 259 260 public static final int CONTEXT_FIELD_NUMBER = 3; 261 private io.grafeas.v1.SourceContext context_; 262 /** 263 * 264 * 265 * <pre> 266 * If provided, the source code used for the build came from this location. 267 * </pre> 268 * 269 * <code>.grafeas.v1.SourceContext context = 3;</code> 270 * 271 * @return Whether the context field is set. 272 */ 273 @java.lang.Override hasContext()274 public boolean hasContext() { 275 return context_ != null; 276 } 277 /** 278 * 279 * 280 * <pre> 281 * If provided, the source code used for the build came from this location. 282 * </pre> 283 * 284 * <code>.grafeas.v1.SourceContext context = 3;</code> 285 * 286 * @return The context. 287 */ 288 @java.lang.Override getContext()289 public io.grafeas.v1.SourceContext getContext() { 290 return context_ == null ? io.grafeas.v1.SourceContext.getDefaultInstance() : context_; 291 } 292 /** 293 * 294 * 295 * <pre> 296 * If provided, the source code used for the build came from this location. 297 * </pre> 298 * 299 * <code>.grafeas.v1.SourceContext context = 3;</code> 300 */ 301 @java.lang.Override getContextOrBuilder()302 public io.grafeas.v1.SourceContextOrBuilder getContextOrBuilder() { 303 return context_ == null ? io.grafeas.v1.SourceContext.getDefaultInstance() : context_; 304 } 305 306 public static final int ADDITIONAL_CONTEXTS_FIELD_NUMBER = 4; 307 308 @SuppressWarnings("serial") 309 private java.util.List<io.grafeas.v1.SourceContext> additionalContexts_; 310 /** 311 * 312 * 313 * <pre> 314 * If provided, some of the source code used for the build may be found in 315 * these locations, in the case where the source repository had multiple 316 * remotes or submodules. This list will not include the context specified in 317 * the context field. 318 * </pre> 319 * 320 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 321 */ 322 @java.lang.Override getAdditionalContextsList()323 public java.util.List<io.grafeas.v1.SourceContext> getAdditionalContextsList() { 324 return additionalContexts_; 325 } 326 /** 327 * 328 * 329 * <pre> 330 * If provided, some of the source code used for the build may be found in 331 * these locations, in the case where the source repository had multiple 332 * remotes or submodules. This list will not include the context specified in 333 * the context field. 334 * </pre> 335 * 336 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 337 */ 338 @java.lang.Override 339 public java.util.List<? extends io.grafeas.v1.SourceContextOrBuilder> getAdditionalContextsOrBuilderList()340 getAdditionalContextsOrBuilderList() { 341 return additionalContexts_; 342 } 343 /** 344 * 345 * 346 * <pre> 347 * If provided, some of the source code used for the build may be found in 348 * these locations, in the case where the source repository had multiple 349 * remotes or submodules. This list will not include the context specified in 350 * the context field. 351 * </pre> 352 * 353 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 354 */ 355 @java.lang.Override getAdditionalContextsCount()356 public int getAdditionalContextsCount() { 357 return additionalContexts_.size(); 358 } 359 /** 360 * 361 * 362 * <pre> 363 * If provided, some of the source code used for the build may be found in 364 * these locations, in the case where the source repository had multiple 365 * remotes or submodules. This list will not include the context specified in 366 * the context field. 367 * </pre> 368 * 369 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 370 */ 371 @java.lang.Override getAdditionalContexts(int index)372 public io.grafeas.v1.SourceContext getAdditionalContexts(int index) { 373 return additionalContexts_.get(index); 374 } 375 /** 376 * 377 * 378 * <pre> 379 * If provided, some of the source code used for the build may be found in 380 * these locations, in the case where the source repository had multiple 381 * remotes or submodules. This list will not include the context specified in 382 * the context field. 383 * </pre> 384 * 385 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 386 */ 387 @java.lang.Override getAdditionalContextsOrBuilder(int index)388 public io.grafeas.v1.SourceContextOrBuilder getAdditionalContextsOrBuilder(int index) { 389 return additionalContexts_.get(index); 390 } 391 392 private byte memoizedIsInitialized = -1; 393 394 @java.lang.Override isInitialized()395 public final boolean isInitialized() { 396 byte isInitialized = memoizedIsInitialized; 397 if (isInitialized == 1) return true; 398 if (isInitialized == 0) return false; 399 400 memoizedIsInitialized = 1; 401 return true; 402 } 403 404 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)405 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 406 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(artifactStorageSourceUri_)) { 407 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, artifactStorageSourceUri_); 408 } 409 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 410 output, internalGetFileHashes(), FileHashesDefaultEntryHolder.defaultEntry, 2); 411 if (context_ != null) { 412 output.writeMessage(3, getContext()); 413 } 414 for (int i = 0; i < additionalContexts_.size(); i++) { 415 output.writeMessage(4, additionalContexts_.get(i)); 416 } 417 getUnknownFields().writeTo(output); 418 } 419 420 @java.lang.Override getSerializedSize()421 public int getSerializedSize() { 422 int size = memoizedSize; 423 if (size != -1) return size; 424 425 size = 0; 426 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(artifactStorageSourceUri_)) { 427 size += 428 com.google.protobuf.GeneratedMessageV3.computeStringSize(1, artifactStorageSourceUri_); 429 } 430 for (java.util.Map.Entry<java.lang.String, io.grafeas.v1.FileHashes> entry : 431 internalGetFileHashes().getMap().entrySet()) { 432 com.google.protobuf.MapEntry<java.lang.String, io.grafeas.v1.FileHashes> fileHashes__ = 433 FileHashesDefaultEntryHolder.defaultEntry 434 .newBuilderForType() 435 .setKey(entry.getKey()) 436 .setValue(entry.getValue()) 437 .build(); 438 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, fileHashes__); 439 } 440 if (context_ != null) { 441 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getContext()); 442 } 443 for (int i = 0; i < additionalContexts_.size(); i++) { 444 size += 445 com.google.protobuf.CodedOutputStream.computeMessageSize(4, additionalContexts_.get(i)); 446 } 447 size += getUnknownFields().getSerializedSize(); 448 memoizedSize = size; 449 return size; 450 } 451 452 @java.lang.Override equals(final java.lang.Object obj)453 public boolean equals(final java.lang.Object obj) { 454 if (obj == this) { 455 return true; 456 } 457 if (!(obj instanceof io.grafeas.v1.Source)) { 458 return super.equals(obj); 459 } 460 io.grafeas.v1.Source other = (io.grafeas.v1.Source) obj; 461 462 if (!getArtifactStorageSourceUri().equals(other.getArtifactStorageSourceUri())) return false; 463 if (!internalGetFileHashes().equals(other.internalGetFileHashes())) return false; 464 if (hasContext() != other.hasContext()) return false; 465 if (hasContext()) { 466 if (!getContext().equals(other.getContext())) return false; 467 } 468 if (!getAdditionalContextsList().equals(other.getAdditionalContextsList())) return false; 469 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 470 return true; 471 } 472 473 @java.lang.Override hashCode()474 public int hashCode() { 475 if (memoizedHashCode != 0) { 476 return memoizedHashCode; 477 } 478 int hash = 41; 479 hash = (19 * hash) + getDescriptor().hashCode(); 480 hash = (37 * hash) + ARTIFACT_STORAGE_SOURCE_URI_FIELD_NUMBER; 481 hash = (53 * hash) + getArtifactStorageSourceUri().hashCode(); 482 if (!internalGetFileHashes().getMap().isEmpty()) { 483 hash = (37 * hash) + FILE_HASHES_FIELD_NUMBER; 484 hash = (53 * hash) + internalGetFileHashes().hashCode(); 485 } 486 if (hasContext()) { 487 hash = (37 * hash) + CONTEXT_FIELD_NUMBER; 488 hash = (53 * hash) + getContext().hashCode(); 489 } 490 if (getAdditionalContextsCount() > 0) { 491 hash = (37 * hash) + ADDITIONAL_CONTEXTS_FIELD_NUMBER; 492 hash = (53 * hash) + getAdditionalContextsList().hashCode(); 493 } 494 hash = (29 * hash) + getUnknownFields().hashCode(); 495 memoizedHashCode = hash; 496 return hash; 497 } 498 parseFrom(java.nio.ByteBuffer data)499 public static io.grafeas.v1.Source parseFrom(java.nio.ByteBuffer data) 500 throws com.google.protobuf.InvalidProtocolBufferException { 501 return PARSER.parseFrom(data); 502 } 503 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)504 public static io.grafeas.v1.Source parseFrom( 505 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 506 throws com.google.protobuf.InvalidProtocolBufferException { 507 return PARSER.parseFrom(data, extensionRegistry); 508 } 509 parseFrom(com.google.protobuf.ByteString data)510 public static io.grafeas.v1.Source parseFrom(com.google.protobuf.ByteString data) 511 throws com.google.protobuf.InvalidProtocolBufferException { 512 return PARSER.parseFrom(data); 513 } 514 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)515 public static io.grafeas.v1.Source parseFrom( 516 com.google.protobuf.ByteString data, 517 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 518 throws com.google.protobuf.InvalidProtocolBufferException { 519 return PARSER.parseFrom(data, extensionRegistry); 520 } 521 parseFrom(byte[] data)522 public static io.grafeas.v1.Source parseFrom(byte[] data) 523 throws com.google.protobuf.InvalidProtocolBufferException { 524 return PARSER.parseFrom(data); 525 } 526 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)527 public static io.grafeas.v1.Source parseFrom( 528 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 529 throws com.google.protobuf.InvalidProtocolBufferException { 530 return PARSER.parseFrom(data, extensionRegistry); 531 } 532 parseFrom(java.io.InputStream input)533 public static io.grafeas.v1.Source parseFrom(java.io.InputStream input) 534 throws java.io.IOException { 535 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 536 } 537 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)538 public static io.grafeas.v1.Source parseFrom( 539 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 540 throws java.io.IOException { 541 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 542 PARSER, input, extensionRegistry); 543 } 544 parseDelimitedFrom(java.io.InputStream input)545 public static io.grafeas.v1.Source parseDelimitedFrom(java.io.InputStream input) 546 throws java.io.IOException { 547 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 548 } 549 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)550 public static io.grafeas.v1.Source parseDelimitedFrom( 551 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 552 throws java.io.IOException { 553 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 554 PARSER, input, extensionRegistry); 555 } 556 parseFrom(com.google.protobuf.CodedInputStream input)557 public static io.grafeas.v1.Source parseFrom(com.google.protobuf.CodedInputStream input) 558 throws java.io.IOException { 559 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 560 } 561 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)562 public static io.grafeas.v1.Source parseFrom( 563 com.google.protobuf.CodedInputStream input, 564 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 565 throws java.io.IOException { 566 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 567 PARSER, input, extensionRegistry); 568 } 569 570 @java.lang.Override newBuilderForType()571 public Builder newBuilderForType() { 572 return newBuilder(); 573 } 574 newBuilder()575 public static Builder newBuilder() { 576 return DEFAULT_INSTANCE.toBuilder(); 577 } 578 newBuilder(io.grafeas.v1.Source prototype)579 public static Builder newBuilder(io.grafeas.v1.Source prototype) { 580 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 581 } 582 583 @java.lang.Override toBuilder()584 public Builder toBuilder() { 585 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 586 } 587 588 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)589 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 590 Builder builder = new Builder(parent); 591 return builder; 592 } 593 /** 594 * 595 * 596 * <pre> 597 * Source describes the location of the source used for the build. 598 * </pre> 599 * 600 * Protobuf type {@code grafeas.v1.Source} 601 */ 602 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 603 implements 604 // @@protoc_insertion_point(builder_implements:grafeas.v1.Source) 605 io.grafeas.v1.SourceOrBuilder { getDescriptor()606 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 607 return io.grafeas.v1.Provenance.internal_static_grafeas_v1_Source_descriptor; 608 } 609 610 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)611 protected com.google.protobuf.MapField internalGetMapField(int number) { 612 switch (number) { 613 case 2: 614 return internalGetFileHashes(); 615 default: 616 throw new RuntimeException("Invalid map field number: " + number); 617 } 618 } 619 620 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)621 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 622 switch (number) { 623 case 2: 624 return internalGetMutableFileHashes(); 625 default: 626 throw new RuntimeException("Invalid map field number: " + number); 627 } 628 } 629 630 @java.lang.Override 631 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()632 internalGetFieldAccessorTable() { 633 return io.grafeas.v1.Provenance.internal_static_grafeas_v1_Source_fieldAccessorTable 634 .ensureFieldAccessorsInitialized( 635 io.grafeas.v1.Source.class, io.grafeas.v1.Source.Builder.class); 636 } 637 638 // Construct using io.grafeas.v1.Source.newBuilder() Builder()639 private Builder() {} 640 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)641 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 642 super(parent); 643 } 644 645 @java.lang.Override clear()646 public Builder clear() { 647 super.clear(); 648 bitField0_ = 0; 649 artifactStorageSourceUri_ = ""; 650 internalGetMutableFileHashes().clear(); 651 context_ = null; 652 if (contextBuilder_ != null) { 653 contextBuilder_.dispose(); 654 contextBuilder_ = null; 655 } 656 if (additionalContextsBuilder_ == null) { 657 additionalContexts_ = java.util.Collections.emptyList(); 658 } else { 659 additionalContexts_ = null; 660 additionalContextsBuilder_.clear(); 661 } 662 bitField0_ = (bitField0_ & ~0x00000008); 663 return this; 664 } 665 666 @java.lang.Override getDescriptorForType()667 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 668 return io.grafeas.v1.Provenance.internal_static_grafeas_v1_Source_descriptor; 669 } 670 671 @java.lang.Override getDefaultInstanceForType()672 public io.grafeas.v1.Source getDefaultInstanceForType() { 673 return io.grafeas.v1.Source.getDefaultInstance(); 674 } 675 676 @java.lang.Override build()677 public io.grafeas.v1.Source build() { 678 io.grafeas.v1.Source result = buildPartial(); 679 if (!result.isInitialized()) { 680 throw newUninitializedMessageException(result); 681 } 682 return result; 683 } 684 685 @java.lang.Override buildPartial()686 public io.grafeas.v1.Source buildPartial() { 687 io.grafeas.v1.Source result = new io.grafeas.v1.Source(this); 688 buildPartialRepeatedFields(result); 689 if (bitField0_ != 0) { 690 buildPartial0(result); 691 } 692 onBuilt(); 693 return result; 694 } 695 buildPartialRepeatedFields(io.grafeas.v1.Source result)696 private void buildPartialRepeatedFields(io.grafeas.v1.Source result) { 697 if (additionalContextsBuilder_ == null) { 698 if (((bitField0_ & 0x00000008) != 0)) { 699 additionalContexts_ = java.util.Collections.unmodifiableList(additionalContexts_); 700 bitField0_ = (bitField0_ & ~0x00000008); 701 } 702 result.additionalContexts_ = additionalContexts_; 703 } else { 704 result.additionalContexts_ = additionalContextsBuilder_.build(); 705 } 706 } 707 buildPartial0(io.grafeas.v1.Source result)708 private void buildPartial0(io.grafeas.v1.Source result) { 709 int from_bitField0_ = bitField0_; 710 if (((from_bitField0_ & 0x00000001) != 0)) { 711 result.artifactStorageSourceUri_ = artifactStorageSourceUri_; 712 } 713 if (((from_bitField0_ & 0x00000002) != 0)) { 714 result.fileHashes_ = internalGetFileHashes(); 715 result.fileHashes_.makeImmutable(); 716 } 717 if (((from_bitField0_ & 0x00000004) != 0)) { 718 result.context_ = contextBuilder_ == null ? context_ : contextBuilder_.build(); 719 } 720 } 721 722 @java.lang.Override clone()723 public Builder clone() { 724 return super.clone(); 725 } 726 727 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)728 public Builder setField( 729 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 730 return super.setField(field, value); 731 } 732 733 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)734 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 735 return super.clearField(field); 736 } 737 738 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)739 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 740 return super.clearOneof(oneof); 741 } 742 743 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)744 public Builder setRepeatedField( 745 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 746 return super.setRepeatedField(field, index, value); 747 } 748 749 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)750 public Builder addRepeatedField( 751 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 752 return super.addRepeatedField(field, value); 753 } 754 755 @java.lang.Override mergeFrom(com.google.protobuf.Message other)756 public Builder mergeFrom(com.google.protobuf.Message other) { 757 if (other instanceof io.grafeas.v1.Source) { 758 return mergeFrom((io.grafeas.v1.Source) other); 759 } else { 760 super.mergeFrom(other); 761 return this; 762 } 763 } 764 mergeFrom(io.grafeas.v1.Source other)765 public Builder mergeFrom(io.grafeas.v1.Source other) { 766 if (other == io.grafeas.v1.Source.getDefaultInstance()) return this; 767 if (!other.getArtifactStorageSourceUri().isEmpty()) { 768 artifactStorageSourceUri_ = other.artifactStorageSourceUri_; 769 bitField0_ |= 0x00000001; 770 onChanged(); 771 } 772 internalGetMutableFileHashes().mergeFrom(other.internalGetFileHashes()); 773 bitField0_ |= 0x00000002; 774 if (other.hasContext()) { 775 mergeContext(other.getContext()); 776 } 777 if (additionalContextsBuilder_ == null) { 778 if (!other.additionalContexts_.isEmpty()) { 779 if (additionalContexts_.isEmpty()) { 780 additionalContexts_ = other.additionalContexts_; 781 bitField0_ = (bitField0_ & ~0x00000008); 782 } else { 783 ensureAdditionalContextsIsMutable(); 784 additionalContexts_.addAll(other.additionalContexts_); 785 } 786 onChanged(); 787 } 788 } else { 789 if (!other.additionalContexts_.isEmpty()) { 790 if (additionalContextsBuilder_.isEmpty()) { 791 additionalContextsBuilder_.dispose(); 792 additionalContextsBuilder_ = null; 793 additionalContexts_ = other.additionalContexts_; 794 bitField0_ = (bitField0_ & ~0x00000008); 795 additionalContextsBuilder_ = 796 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 797 ? getAdditionalContextsFieldBuilder() 798 : null; 799 } else { 800 additionalContextsBuilder_.addAllMessages(other.additionalContexts_); 801 } 802 } 803 } 804 this.mergeUnknownFields(other.getUnknownFields()); 805 onChanged(); 806 return this; 807 } 808 809 @java.lang.Override isInitialized()810 public final boolean isInitialized() { 811 return true; 812 } 813 814 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)815 public Builder mergeFrom( 816 com.google.protobuf.CodedInputStream input, 817 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 818 throws java.io.IOException { 819 if (extensionRegistry == null) { 820 throw new java.lang.NullPointerException(); 821 } 822 try { 823 boolean done = false; 824 while (!done) { 825 int tag = input.readTag(); 826 switch (tag) { 827 case 0: 828 done = true; 829 break; 830 case 10: 831 { 832 artifactStorageSourceUri_ = input.readStringRequireUtf8(); 833 bitField0_ |= 0x00000001; 834 break; 835 } // case 10 836 case 18: 837 { 838 com.google.protobuf.MapEntry<java.lang.String, io.grafeas.v1.FileHashes> 839 fileHashes__ = 840 input.readMessage( 841 FileHashesDefaultEntryHolder.defaultEntry.getParserForType(), 842 extensionRegistry); 843 internalGetMutableFileHashes() 844 .getMutableMap() 845 .put(fileHashes__.getKey(), fileHashes__.getValue()); 846 bitField0_ |= 0x00000002; 847 break; 848 } // case 18 849 case 26: 850 { 851 input.readMessage(getContextFieldBuilder().getBuilder(), extensionRegistry); 852 bitField0_ |= 0x00000004; 853 break; 854 } // case 26 855 case 34: 856 { 857 io.grafeas.v1.SourceContext m = 858 input.readMessage(io.grafeas.v1.SourceContext.parser(), extensionRegistry); 859 if (additionalContextsBuilder_ == null) { 860 ensureAdditionalContextsIsMutable(); 861 additionalContexts_.add(m); 862 } else { 863 additionalContextsBuilder_.addMessage(m); 864 } 865 break; 866 } // case 34 867 default: 868 { 869 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 870 done = true; // was an endgroup tag 871 } 872 break; 873 } // default: 874 } // switch (tag) 875 } // while (!done) 876 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 877 throw e.unwrapIOException(); 878 } finally { 879 onChanged(); 880 } // finally 881 return this; 882 } 883 884 private int bitField0_; 885 886 private java.lang.Object artifactStorageSourceUri_ = ""; 887 /** 888 * 889 * 890 * <pre> 891 * If provided, the input binary artifacts for the build came from this 892 * location. 893 * </pre> 894 * 895 * <code>string artifact_storage_source_uri = 1;</code> 896 * 897 * @return The artifactStorageSourceUri. 898 */ getArtifactStorageSourceUri()899 public java.lang.String getArtifactStorageSourceUri() { 900 java.lang.Object ref = artifactStorageSourceUri_; 901 if (!(ref instanceof java.lang.String)) { 902 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 903 java.lang.String s = bs.toStringUtf8(); 904 artifactStorageSourceUri_ = s; 905 return s; 906 } else { 907 return (java.lang.String) ref; 908 } 909 } 910 /** 911 * 912 * 913 * <pre> 914 * If provided, the input binary artifacts for the build came from this 915 * location. 916 * </pre> 917 * 918 * <code>string artifact_storage_source_uri = 1;</code> 919 * 920 * @return The bytes for artifactStorageSourceUri. 921 */ getArtifactStorageSourceUriBytes()922 public com.google.protobuf.ByteString getArtifactStorageSourceUriBytes() { 923 java.lang.Object ref = artifactStorageSourceUri_; 924 if (ref instanceof String) { 925 com.google.protobuf.ByteString b = 926 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 927 artifactStorageSourceUri_ = b; 928 return b; 929 } else { 930 return (com.google.protobuf.ByteString) ref; 931 } 932 } 933 /** 934 * 935 * 936 * <pre> 937 * If provided, the input binary artifacts for the build came from this 938 * location. 939 * </pre> 940 * 941 * <code>string artifact_storage_source_uri = 1;</code> 942 * 943 * @param value The artifactStorageSourceUri to set. 944 * @return This builder for chaining. 945 */ setArtifactStorageSourceUri(java.lang.String value)946 public Builder setArtifactStorageSourceUri(java.lang.String value) { 947 if (value == null) { 948 throw new NullPointerException(); 949 } 950 artifactStorageSourceUri_ = value; 951 bitField0_ |= 0x00000001; 952 onChanged(); 953 return this; 954 } 955 /** 956 * 957 * 958 * <pre> 959 * If provided, the input binary artifacts for the build came from this 960 * location. 961 * </pre> 962 * 963 * <code>string artifact_storage_source_uri = 1;</code> 964 * 965 * @return This builder for chaining. 966 */ clearArtifactStorageSourceUri()967 public Builder clearArtifactStorageSourceUri() { 968 artifactStorageSourceUri_ = getDefaultInstance().getArtifactStorageSourceUri(); 969 bitField0_ = (bitField0_ & ~0x00000001); 970 onChanged(); 971 return this; 972 } 973 /** 974 * 975 * 976 * <pre> 977 * If provided, the input binary artifacts for the build came from this 978 * location. 979 * </pre> 980 * 981 * <code>string artifact_storage_source_uri = 1;</code> 982 * 983 * @param value The bytes for artifactStorageSourceUri to set. 984 * @return This builder for chaining. 985 */ setArtifactStorageSourceUriBytes(com.google.protobuf.ByteString value)986 public Builder setArtifactStorageSourceUriBytes(com.google.protobuf.ByteString value) { 987 if (value == null) { 988 throw new NullPointerException(); 989 } 990 checkByteStringIsUtf8(value); 991 artifactStorageSourceUri_ = value; 992 bitField0_ |= 0x00000001; 993 onChanged(); 994 return this; 995 } 996 997 private com.google.protobuf.MapField<java.lang.String, io.grafeas.v1.FileHashes> fileHashes_; 998 999 private com.google.protobuf.MapField<java.lang.String, io.grafeas.v1.FileHashes> internalGetFileHashes()1000 internalGetFileHashes() { 1001 if (fileHashes_ == null) { 1002 return com.google.protobuf.MapField.emptyMapField( 1003 FileHashesDefaultEntryHolder.defaultEntry); 1004 } 1005 return fileHashes_; 1006 } 1007 1008 private com.google.protobuf.MapField<java.lang.String, io.grafeas.v1.FileHashes> internalGetMutableFileHashes()1009 internalGetMutableFileHashes() { 1010 if (fileHashes_ == null) { 1011 fileHashes_ = 1012 com.google.protobuf.MapField.newMapField(FileHashesDefaultEntryHolder.defaultEntry); 1013 } 1014 if (!fileHashes_.isMutable()) { 1015 fileHashes_ = fileHashes_.copy(); 1016 } 1017 bitField0_ |= 0x00000002; 1018 onChanged(); 1019 return fileHashes_; 1020 } 1021 getFileHashesCount()1022 public int getFileHashesCount() { 1023 return internalGetFileHashes().getMap().size(); 1024 } 1025 /** 1026 * 1027 * 1028 * <pre> 1029 * Hash(es) of the build source, which can be used to verify that the original 1030 * source integrity was maintained in the build. 1031 * The keys to this map are file paths used as build source and the values 1032 * contain the hash values for those files. 1033 * If the build source came in a single package such as a gzipped tarfile 1034 * (.tar.gz), the FileHash will be for the single path to that file. 1035 * </pre> 1036 * 1037 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 1038 */ 1039 @java.lang.Override containsFileHashes(java.lang.String key)1040 public boolean containsFileHashes(java.lang.String key) { 1041 if (key == null) { 1042 throw new NullPointerException("map key"); 1043 } 1044 return internalGetFileHashes().getMap().containsKey(key); 1045 } 1046 /** Use {@link #getFileHashesMap()} instead. */ 1047 @java.lang.Override 1048 @java.lang.Deprecated getFileHashes()1049 public java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> getFileHashes() { 1050 return getFileHashesMap(); 1051 } 1052 /** 1053 * 1054 * 1055 * <pre> 1056 * Hash(es) of the build source, which can be used to verify that the original 1057 * source integrity was maintained in the build. 1058 * The keys to this map are file paths used as build source and the values 1059 * contain the hash values for those files. 1060 * If the build source came in a single package such as a gzipped tarfile 1061 * (.tar.gz), the FileHash will be for the single path to that file. 1062 * </pre> 1063 * 1064 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 1065 */ 1066 @java.lang.Override getFileHashesMap()1067 public java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> getFileHashesMap() { 1068 return internalGetFileHashes().getMap(); 1069 } 1070 /** 1071 * 1072 * 1073 * <pre> 1074 * Hash(es) of the build source, which can be used to verify that the original 1075 * source integrity was maintained in the build. 1076 * The keys to this map are file paths used as build source and the values 1077 * contain the hash values for those files. 1078 * If the build source came in a single package such as a gzipped tarfile 1079 * (.tar.gz), the FileHash will be for the single path to that file. 1080 * </pre> 1081 * 1082 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 1083 */ 1084 @java.lang.Override getFileHashesOrDefault( java.lang.String key, io.grafeas.v1.FileHashes defaultValue)1085 public /* nullable */ io.grafeas.v1.FileHashes getFileHashesOrDefault( 1086 java.lang.String key, 1087 /* nullable */ 1088 io.grafeas.v1.FileHashes defaultValue) { 1089 if (key == null) { 1090 throw new NullPointerException("map key"); 1091 } 1092 java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> map = 1093 internalGetFileHashes().getMap(); 1094 return map.containsKey(key) ? map.get(key) : defaultValue; 1095 } 1096 /** 1097 * 1098 * 1099 * <pre> 1100 * Hash(es) of the build source, which can be used to verify that the original 1101 * source integrity was maintained in the build. 1102 * The keys to this map are file paths used as build source and the values 1103 * contain the hash values for those files. 1104 * If the build source came in a single package such as a gzipped tarfile 1105 * (.tar.gz), the FileHash will be for the single path to that file. 1106 * </pre> 1107 * 1108 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 1109 */ 1110 @java.lang.Override getFileHashesOrThrow(java.lang.String key)1111 public io.grafeas.v1.FileHashes getFileHashesOrThrow(java.lang.String key) { 1112 if (key == null) { 1113 throw new NullPointerException("map key"); 1114 } 1115 java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> map = 1116 internalGetFileHashes().getMap(); 1117 if (!map.containsKey(key)) { 1118 throw new java.lang.IllegalArgumentException(); 1119 } 1120 return map.get(key); 1121 } 1122 clearFileHashes()1123 public Builder clearFileHashes() { 1124 bitField0_ = (bitField0_ & ~0x00000002); 1125 internalGetMutableFileHashes().getMutableMap().clear(); 1126 return this; 1127 } 1128 /** 1129 * 1130 * 1131 * <pre> 1132 * Hash(es) of the build source, which can be used to verify that the original 1133 * source integrity was maintained in the build. 1134 * The keys to this map are file paths used as build source and the values 1135 * contain the hash values for those files. 1136 * If the build source came in a single package such as a gzipped tarfile 1137 * (.tar.gz), the FileHash will be for the single path to that file. 1138 * </pre> 1139 * 1140 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 1141 */ removeFileHashes(java.lang.String key)1142 public Builder removeFileHashes(java.lang.String key) { 1143 if (key == null) { 1144 throw new NullPointerException("map key"); 1145 } 1146 internalGetMutableFileHashes().getMutableMap().remove(key); 1147 return this; 1148 } 1149 /** Use alternate mutation accessors instead. */ 1150 @java.lang.Deprecated getMutableFileHashes()1151 public java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> getMutableFileHashes() { 1152 bitField0_ |= 0x00000002; 1153 return internalGetMutableFileHashes().getMutableMap(); 1154 } 1155 /** 1156 * 1157 * 1158 * <pre> 1159 * Hash(es) of the build source, which can be used to verify that the original 1160 * source integrity was maintained in the build. 1161 * The keys to this map are file paths used as build source and the values 1162 * contain the hash values for those files. 1163 * If the build source came in a single package such as a gzipped tarfile 1164 * (.tar.gz), the FileHash will be for the single path to that file. 1165 * </pre> 1166 * 1167 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 1168 */ putFileHashes(java.lang.String key, io.grafeas.v1.FileHashes value)1169 public Builder putFileHashes(java.lang.String key, io.grafeas.v1.FileHashes value) { 1170 if (key == null) { 1171 throw new NullPointerException("map key"); 1172 } 1173 if (value == null) { 1174 throw new NullPointerException("map value"); 1175 } 1176 internalGetMutableFileHashes().getMutableMap().put(key, value); 1177 bitField0_ |= 0x00000002; 1178 return this; 1179 } 1180 /** 1181 * 1182 * 1183 * <pre> 1184 * Hash(es) of the build source, which can be used to verify that the original 1185 * source integrity was maintained in the build. 1186 * The keys to this map are file paths used as build source and the values 1187 * contain the hash values for those files. 1188 * If the build source came in a single package such as a gzipped tarfile 1189 * (.tar.gz), the FileHash will be for the single path to that file. 1190 * </pre> 1191 * 1192 * <code>map<string, .grafeas.v1.FileHashes> file_hashes = 2;</code> 1193 */ putAllFileHashes( java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> values)1194 public Builder putAllFileHashes( 1195 java.util.Map<java.lang.String, io.grafeas.v1.FileHashes> values) { 1196 internalGetMutableFileHashes().getMutableMap().putAll(values); 1197 bitField0_ |= 0x00000002; 1198 return this; 1199 } 1200 1201 private io.grafeas.v1.SourceContext context_; 1202 private com.google.protobuf.SingleFieldBuilderV3< 1203 io.grafeas.v1.SourceContext, 1204 io.grafeas.v1.SourceContext.Builder, 1205 io.grafeas.v1.SourceContextOrBuilder> 1206 contextBuilder_; 1207 /** 1208 * 1209 * 1210 * <pre> 1211 * If provided, the source code used for the build came from this location. 1212 * </pre> 1213 * 1214 * <code>.grafeas.v1.SourceContext context = 3;</code> 1215 * 1216 * @return Whether the context field is set. 1217 */ hasContext()1218 public boolean hasContext() { 1219 return ((bitField0_ & 0x00000004) != 0); 1220 } 1221 /** 1222 * 1223 * 1224 * <pre> 1225 * If provided, the source code used for the build came from this location. 1226 * </pre> 1227 * 1228 * <code>.grafeas.v1.SourceContext context = 3;</code> 1229 * 1230 * @return The context. 1231 */ getContext()1232 public io.grafeas.v1.SourceContext getContext() { 1233 if (contextBuilder_ == null) { 1234 return context_ == null ? io.grafeas.v1.SourceContext.getDefaultInstance() : context_; 1235 } else { 1236 return contextBuilder_.getMessage(); 1237 } 1238 } 1239 /** 1240 * 1241 * 1242 * <pre> 1243 * If provided, the source code used for the build came from this location. 1244 * </pre> 1245 * 1246 * <code>.grafeas.v1.SourceContext context = 3;</code> 1247 */ setContext(io.grafeas.v1.SourceContext value)1248 public Builder setContext(io.grafeas.v1.SourceContext value) { 1249 if (contextBuilder_ == null) { 1250 if (value == null) { 1251 throw new NullPointerException(); 1252 } 1253 context_ = value; 1254 } else { 1255 contextBuilder_.setMessage(value); 1256 } 1257 bitField0_ |= 0x00000004; 1258 onChanged(); 1259 return this; 1260 } 1261 /** 1262 * 1263 * 1264 * <pre> 1265 * If provided, the source code used for the build came from this location. 1266 * </pre> 1267 * 1268 * <code>.grafeas.v1.SourceContext context = 3;</code> 1269 */ setContext(io.grafeas.v1.SourceContext.Builder builderForValue)1270 public Builder setContext(io.grafeas.v1.SourceContext.Builder builderForValue) { 1271 if (contextBuilder_ == null) { 1272 context_ = builderForValue.build(); 1273 } else { 1274 contextBuilder_.setMessage(builderForValue.build()); 1275 } 1276 bitField0_ |= 0x00000004; 1277 onChanged(); 1278 return this; 1279 } 1280 /** 1281 * 1282 * 1283 * <pre> 1284 * If provided, the source code used for the build came from this location. 1285 * </pre> 1286 * 1287 * <code>.grafeas.v1.SourceContext context = 3;</code> 1288 */ mergeContext(io.grafeas.v1.SourceContext value)1289 public Builder mergeContext(io.grafeas.v1.SourceContext value) { 1290 if (contextBuilder_ == null) { 1291 if (((bitField0_ & 0x00000004) != 0) 1292 && context_ != null 1293 && context_ != io.grafeas.v1.SourceContext.getDefaultInstance()) { 1294 getContextBuilder().mergeFrom(value); 1295 } else { 1296 context_ = value; 1297 } 1298 } else { 1299 contextBuilder_.mergeFrom(value); 1300 } 1301 bitField0_ |= 0x00000004; 1302 onChanged(); 1303 return this; 1304 } 1305 /** 1306 * 1307 * 1308 * <pre> 1309 * If provided, the source code used for the build came from this location. 1310 * </pre> 1311 * 1312 * <code>.grafeas.v1.SourceContext context = 3;</code> 1313 */ clearContext()1314 public Builder clearContext() { 1315 bitField0_ = (bitField0_ & ~0x00000004); 1316 context_ = null; 1317 if (contextBuilder_ != null) { 1318 contextBuilder_.dispose(); 1319 contextBuilder_ = null; 1320 } 1321 onChanged(); 1322 return this; 1323 } 1324 /** 1325 * 1326 * 1327 * <pre> 1328 * If provided, the source code used for the build came from this location. 1329 * </pre> 1330 * 1331 * <code>.grafeas.v1.SourceContext context = 3;</code> 1332 */ getContextBuilder()1333 public io.grafeas.v1.SourceContext.Builder getContextBuilder() { 1334 bitField0_ |= 0x00000004; 1335 onChanged(); 1336 return getContextFieldBuilder().getBuilder(); 1337 } 1338 /** 1339 * 1340 * 1341 * <pre> 1342 * If provided, the source code used for the build came from this location. 1343 * </pre> 1344 * 1345 * <code>.grafeas.v1.SourceContext context = 3;</code> 1346 */ getContextOrBuilder()1347 public io.grafeas.v1.SourceContextOrBuilder getContextOrBuilder() { 1348 if (contextBuilder_ != null) { 1349 return contextBuilder_.getMessageOrBuilder(); 1350 } else { 1351 return context_ == null ? io.grafeas.v1.SourceContext.getDefaultInstance() : context_; 1352 } 1353 } 1354 /** 1355 * 1356 * 1357 * <pre> 1358 * If provided, the source code used for the build came from this location. 1359 * </pre> 1360 * 1361 * <code>.grafeas.v1.SourceContext context = 3;</code> 1362 */ 1363 private com.google.protobuf.SingleFieldBuilderV3< 1364 io.grafeas.v1.SourceContext, 1365 io.grafeas.v1.SourceContext.Builder, 1366 io.grafeas.v1.SourceContextOrBuilder> getContextFieldBuilder()1367 getContextFieldBuilder() { 1368 if (contextBuilder_ == null) { 1369 contextBuilder_ = 1370 new com.google.protobuf.SingleFieldBuilderV3< 1371 io.grafeas.v1.SourceContext, 1372 io.grafeas.v1.SourceContext.Builder, 1373 io.grafeas.v1.SourceContextOrBuilder>( 1374 getContext(), getParentForChildren(), isClean()); 1375 context_ = null; 1376 } 1377 return contextBuilder_; 1378 } 1379 1380 private java.util.List<io.grafeas.v1.SourceContext> additionalContexts_ = 1381 java.util.Collections.emptyList(); 1382 ensureAdditionalContextsIsMutable()1383 private void ensureAdditionalContextsIsMutable() { 1384 if (!((bitField0_ & 0x00000008) != 0)) { 1385 additionalContexts_ = 1386 new java.util.ArrayList<io.grafeas.v1.SourceContext>(additionalContexts_); 1387 bitField0_ |= 0x00000008; 1388 } 1389 } 1390 1391 private com.google.protobuf.RepeatedFieldBuilderV3< 1392 io.grafeas.v1.SourceContext, 1393 io.grafeas.v1.SourceContext.Builder, 1394 io.grafeas.v1.SourceContextOrBuilder> 1395 additionalContextsBuilder_; 1396 1397 /** 1398 * 1399 * 1400 * <pre> 1401 * If provided, some of the source code used for the build may be found in 1402 * these locations, in the case where the source repository had multiple 1403 * remotes or submodules. This list will not include the context specified in 1404 * the context field. 1405 * </pre> 1406 * 1407 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1408 */ getAdditionalContextsList()1409 public java.util.List<io.grafeas.v1.SourceContext> getAdditionalContextsList() { 1410 if (additionalContextsBuilder_ == null) { 1411 return java.util.Collections.unmodifiableList(additionalContexts_); 1412 } else { 1413 return additionalContextsBuilder_.getMessageList(); 1414 } 1415 } 1416 /** 1417 * 1418 * 1419 * <pre> 1420 * If provided, some of the source code used for the build may be found in 1421 * these locations, in the case where the source repository had multiple 1422 * remotes or submodules. This list will not include the context specified in 1423 * the context field. 1424 * </pre> 1425 * 1426 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1427 */ getAdditionalContextsCount()1428 public int getAdditionalContextsCount() { 1429 if (additionalContextsBuilder_ == null) { 1430 return additionalContexts_.size(); 1431 } else { 1432 return additionalContextsBuilder_.getCount(); 1433 } 1434 } 1435 /** 1436 * 1437 * 1438 * <pre> 1439 * If provided, some of the source code used for the build may be found in 1440 * these locations, in the case where the source repository had multiple 1441 * remotes or submodules. This list will not include the context specified in 1442 * the context field. 1443 * </pre> 1444 * 1445 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1446 */ getAdditionalContexts(int index)1447 public io.grafeas.v1.SourceContext getAdditionalContexts(int index) { 1448 if (additionalContextsBuilder_ == null) { 1449 return additionalContexts_.get(index); 1450 } else { 1451 return additionalContextsBuilder_.getMessage(index); 1452 } 1453 } 1454 /** 1455 * 1456 * 1457 * <pre> 1458 * If provided, some of the source code used for the build may be found in 1459 * these locations, in the case where the source repository had multiple 1460 * remotes or submodules. This list will not include the context specified in 1461 * the context field. 1462 * </pre> 1463 * 1464 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1465 */ setAdditionalContexts(int index, io.grafeas.v1.SourceContext value)1466 public Builder setAdditionalContexts(int index, io.grafeas.v1.SourceContext value) { 1467 if (additionalContextsBuilder_ == null) { 1468 if (value == null) { 1469 throw new NullPointerException(); 1470 } 1471 ensureAdditionalContextsIsMutable(); 1472 additionalContexts_.set(index, value); 1473 onChanged(); 1474 } else { 1475 additionalContextsBuilder_.setMessage(index, value); 1476 } 1477 return this; 1478 } 1479 /** 1480 * 1481 * 1482 * <pre> 1483 * If provided, some of the source code used for the build may be found in 1484 * these locations, in the case where the source repository had multiple 1485 * remotes or submodules. This list will not include the context specified in 1486 * the context field. 1487 * </pre> 1488 * 1489 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1490 */ setAdditionalContexts( int index, io.grafeas.v1.SourceContext.Builder builderForValue)1491 public Builder setAdditionalContexts( 1492 int index, io.grafeas.v1.SourceContext.Builder builderForValue) { 1493 if (additionalContextsBuilder_ == null) { 1494 ensureAdditionalContextsIsMutable(); 1495 additionalContexts_.set(index, builderForValue.build()); 1496 onChanged(); 1497 } else { 1498 additionalContextsBuilder_.setMessage(index, builderForValue.build()); 1499 } 1500 return this; 1501 } 1502 /** 1503 * 1504 * 1505 * <pre> 1506 * If provided, some of the source code used for the build may be found in 1507 * these locations, in the case where the source repository had multiple 1508 * remotes or submodules. This list will not include the context specified in 1509 * the context field. 1510 * </pre> 1511 * 1512 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1513 */ addAdditionalContexts(io.grafeas.v1.SourceContext value)1514 public Builder addAdditionalContexts(io.grafeas.v1.SourceContext value) { 1515 if (additionalContextsBuilder_ == null) { 1516 if (value == null) { 1517 throw new NullPointerException(); 1518 } 1519 ensureAdditionalContextsIsMutable(); 1520 additionalContexts_.add(value); 1521 onChanged(); 1522 } else { 1523 additionalContextsBuilder_.addMessage(value); 1524 } 1525 return this; 1526 } 1527 /** 1528 * 1529 * 1530 * <pre> 1531 * If provided, some of the source code used for the build may be found in 1532 * these locations, in the case where the source repository had multiple 1533 * remotes or submodules. This list will not include the context specified in 1534 * the context field. 1535 * </pre> 1536 * 1537 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1538 */ addAdditionalContexts(int index, io.grafeas.v1.SourceContext value)1539 public Builder addAdditionalContexts(int index, io.grafeas.v1.SourceContext value) { 1540 if (additionalContextsBuilder_ == null) { 1541 if (value == null) { 1542 throw new NullPointerException(); 1543 } 1544 ensureAdditionalContextsIsMutable(); 1545 additionalContexts_.add(index, value); 1546 onChanged(); 1547 } else { 1548 additionalContextsBuilder_.addMessage(index, value); 1549 } 1550 return this; 1551 } 1552 /** 1553 * 1554 * 1555 * <pre> 1556 * If provided, some of the source code used for the build may be found in 1557 * these locations, in the case where the source repository had multiple 1558 * remotes or submodules. This list will not include the context specified in 1559 * the context field. 1560 * </pre> 1561 * 1562 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1563 */ addAdditionalContexts(io.grafeas.v1.SourceContext.Builder builderForValue)1564 public Builder addAdditionalContexts(io.grafeas.v1.SourceContext.Builder builderForValue) { 1565 if (additionalContextsBuilder_ == null) { 1566 ensureAdditionalContextsIsMutable(); 1567 additionalContexts_.add(builderForValue.build()); 1568 onChanged(); 1569 } else { 1570 additionalContextsBuilder_.addMessage(builderForValue.build()); 1571 } 1572 return this; 1573 } 1574 /** 1575 * 1576 * 1577 * <pre> 1578 * If provided, some of the source code used for the build may be found in 1579 * these locations, in the case where the source repository had multiple 1580 * remotes or submodules. This list will not include the context specified in 1581 * the context field. 1582 * </pre> 1583 * 1584 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1585 */ addAdditionalContexts( int index, io.grafeas.v1.SourceContext.Builder builderForValue)1586 public Builder addAdditionalContexts( 1587 int index, io.grafeas.v1.SourceContext.Builder builderForValue) { 1588 if (additionalContextsBuilder_ == null) { 1589 ensureAdditionalContextsIsMutable(); 1590 additionalContexts_.add(index, builderForValue.build()); 1591 onChanged(); 1592 } else { 1593 additionalContextsBuilder_.addMessage(index, builderForValue.build()); 1594 } 1595 return this; 1596 } 1597 /** 1598 * 1599 * 1600 * <pre> 1601 * If provided, some of the source code used for the build may be found in 1602 * these locations, in the case where the source repository had multiple 1603 * remotes or submodules. This list will not include the context specified in 1604 * the context field. 1605 * </pre> 1606 * 1607 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1608 */ addAllAdditionalContexts( java.lang.Iterable<? extends io.grafeas.v1.SourceContext> values)1609 public Builder addAllAdditionalContexts( 1610 java.lang.Iterable<? extends io.grafeas.v1.SourceContext> values) { 1611 if (additionalContextsBuilder_ == null) { 1612 ensureAdditionalContextsIsMutable(); 1613 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalContexts_); 1614 onChanged(); 1615 } else { 1616 additionalContextsBuilder_.addAllMessages(values); 1617 } 1618 return this; 1619 } 1620 /** 1621 * 1622 * 1623 * <pre> 1624 * If provided, some of the source code used for the build may be found in 1625 * these locations, in the case where the source repository had multiple 1626 * remotes or submodules. This list will not include the context specified in 1627 * the context field. 1628 * </pre> 1629 * 1630 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1631 */ clearAdditionalContexts()1632 public Builder clearAdditionalContexts() { 1633 if (additionalContextsBuilder_ == null) { 1634 additionalContexts_ = java.util.Collections.emptyList(); 1635 bitField0_ = (bitField0_ & ~0x00000008); 1636 onChanged(); 1637 } else { 1638 additionalContextsBuilder_.clear(); 1639 } 1640 return this; 1641 } 1642 /** 1643 * 1644 * 1645 * <pre> 1646 * If provided, some of the source code used for the build may be found in 1647 * these locations, in the case where the source repository had multiple 1648 * remotes or submodules. This list will not include the context specified in 1649 * the context field. 1650 * </pre> 1651 * 1652 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1653 */ removeAdditionalContexts(int index)1654 public Builder removeAdditionalContexts(int index) { 1655 if (additionalContextsBuilder_ == null) { 1656 ensureAdditionalContextsIsMutable(); 1657 additionalContexts_.remove(index); 1658 onChanged(); 1659 } else { 1660 additionalContextsBuilder_.remove(index); 1661 } 1662 return this; 1663 } 1664 /** 1665 * 1666 * 1667 * <pre> 1668 * If provided, some of the source code used for the build may be found in 1669 * these locations, in the case where the source repository had multiple 1670 * remotes or submodules. This list will not include the context specified in 1671 * the context field. 1672 * </pre> 1673 * 1674 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1675 */ getAdditionalContextsBuilder(int index)1676 public io.grafeas.v1.SourceContext.Builder getAdditionalContextsBuilder(int index) { 1677 return getAdditionalContextsFieldBuilder().getBuilder(index); 1678 } 1679 /** 1680 * 1681 * 1682 * <pre> 1683 * If provided, some of the source code used for the build may be found in 1684 * these locations, in the case where the source repository had multiple 1685 * remotes or submodules. This list will not include the context specified in 1686 * the context field. 1687 * </pre> 1688 * 1689 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1690 */ getAdditionalContextsOrBuilder(int index)1691 public io.grafeas.v1.SourceContextOrBuilder getAdditionalContextsOrBuilder(int index) { 1692 if (additionalContextsBuilder_ == null) { 1693 return additionalContexts_.get(index); 1694 } else { 1695 return additionalContextsBuilder_.getMessageOrBuilder(index); 1696 } 1697 } 1698 /** 1699 * 1700 * 1701 * <pre> 1702 * If provided, some of the source code used for the build may be found in 1703 * these locations, in the case where the source repository had multiple 1704 * remotes or submodules. This list will not include the context specified in 1705 * the context field. 1706 * </pre> 1707 * 1708 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1709 */ 1710 public java.util.List<? extends io.grafeas.v1.SourceContextOrBuilder> getAdditionalContextsOrBuilderList()1711 getAdditionalContextsOrBuilderList() { 1712 if (additionalContextsBuilder_ != null) { 1713 return additionalContextsBuilder_.getMessageOrBuilderList(); 1714 } else { 1715 return java.util.Collections.unmodifiableList(additionalContexts_); 1716 } 1717 } 1718 /** 1719 * 1720 * 1721 * <pre> 1722 * If provided, some of the source code used for the build may be found in 1723 * these locations, in the case where the source repository had multiple 1724 * remotes or submodules. This list will not include the context specified in 1725 * the context field. 1726 * </pre> 1727 * 1728 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1729 */ addAdditionalContextsBuilder()1730 public io.grafeas.v1.SourceContext.Builder addAdditionalContextsBuilder() { 1731 return getAdditionalContextsFieldBuilder() 1732 .addBuilder(io.grafeas.v1.SourceContext.getDefaultInstance()); 1733 } 1734 /** 1735 * 1736 * 1737 * <pre> 1738 * If provided, some of the source code used for the build may be found in 1739 * these locations, in the case where the source repository had multiple 1740 * remotes or submodules. This list will not include the context specified in 1741 * the context field. 1742 * </pre> 1743 * 1744 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1745 */ addAdditionalContextsBuilder(int index)1746 public io.grafeas.v1.SourceContext.Builder addAdditionalContextsBuilder(int index) { 1747 return getAdditionalContextsFieldBuilder() 1748 .addBuilder(index, io.grafeas.v1.SourceContext.getDefaultInstance()); 1749 } 1750 /** 1751 * 1752 * 1753 * <pre> 1754 * If provided, some of the source code used for the build may be found in 1755 * these locations, in the case where the source repository had multiple 1756 * remotes or submodules. This list will not include the context specified in 1757 * the context field. 1758 * </pre> 1759 * 1760 * <code>repeated .grafeas.v1.SourceContext additional_contexts = 4;</code> 1761 */ getAdditionalContextsBuilderList()1762 public java.util.List<io.grafeas.v1.SourceContext.Builder> getAdditionalContextsBuilderList() { 1763 return getAdditionalContextsFieldBuilder().getBuilderList(); 1764 } 1765 1766 private com.google.protobuf.RepeatedFieldBuilderV3< 1767 io.grafeas.v1.SourceContext, 1768 io.grafeas.v1.SourceContext.Builder, 1769 io.grafeas.v1.SourceContextOrBuilder> getAdditionalContextsFieldBuilder()1770 getAdditionalContextsFieldBuilder() { 1771 if (additionalContextsBuilder_ == null) { 1772 additionalContextsBuilder_ = 1773 new com.google.protobuf.RepeatedFieldBuilderV3< 1774 io.grafeas.v1.SourceContext, 1775 io.grafeas.v1.SourceContext.Builder, 1776 io.grafeas.v1.SourceContextOrBuilder>( 1777 additionalContexts_, 1778 ((bitField0_ & 0x00000008) != 0), 1779 getParentForChildren(), 1780 isClean()); 1781 additionalContexts_ = null; 1782 } 1783 return additionalContextsBuilder_; 1784 } 1785 1786 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1787 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1788 return super.setUnknownFields(unknownFields); 1789 } 1790 1791 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1792 public final Builder mergeUnknownFields( 1793 final com.google.protobuf.UnknownFieldSet unknownFields) { 1794 return super.mergeUnknownFields(unknownFields); 1795 } 1796 1797 // @@protoc_insertion_point(builder_scope:grafeas.v1.Source) 1798 } 1799 1800 // @@protoc_insertion_point(class_scope:grafeas.v1.Source) 1801 private static final io.grafeas.v1.Source DEFAULT_INSTANCE; 1802 1803 static { 1804 DEFAULT_INSTANCE = new io.grafeas.v1.Source(); 1805 } 1806 getDefaultInstance()1807 public static io.grafeas.v1.Source getDefaultInstance() { 1808 return DEFAULT_INSTANCE; 1809 } 1810 1811 private static final com.google.protobuf.Parser<Source> PARSER = 1812 new com.google.protobuf.AbstractParser<Source>() { 1813 @java.lang.Override 1814 public Source parsePartialFrom( 1815 com.google.protobuf.CodedInputStream input, 1816 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1817 throws com.google.protobuf.InvalidProtocolBufferException { 1818 Builder builder = newBuilder(); 1819 try { 1820 builder.mergeFrom(input, extensionRegistry); 1821 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1822 throw e.setUnfinishedMessage(builder.buildPartial()); 1823 } catch (com.google.protobuf.UninitializedMessageException e) { 1824 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1825 } catch (java.io.IOException e) { 1826 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1827 .setUnfinishedMessage(builder.buildPartial()); 1828 } 1829 return builder.buildPartial(); 1830 } 1831 }; 1832 parser()1833 public static com.google.protobuf.Parser<Source> parser() { 1834 return PARSER; 1835 } 1836 1837 @java.lang.Override getParserForType()1838 public com.google.protobuf.Parser<Source> getParserForType() { 1839 return PARSER; 1840 } 1841 1842 @java.lang.Override getDefaultInstanceForType()1843 public io.grafeas.v1.Source getDefaultInstanceForType() { 1844 return DEFAULT_INSTANCE; 1845 } 1846 } 1847