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