1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/datalabeling/v1beta1/evaluation.proto 18 19 package com.google.cloud.datalabeling.v1beta1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Confusion matrix of the model running the classification. Only applicable 26 * when the metrics entry aggregates multiple labels. Not applicable when the 27 * entry is for a single label. 28 * </pre> 29 * 30 * Protobuf type {@code google.cloud.datalabeling.v1beta1.ConfusionMatrix} 31 */ 32 public final class ConfusionMatrix extends com.google.protobuf.GeneratedMessageV3 33 implements 34 // @@protoc_insertion_point(message_implements:google.cloud.datalabeling.v1beta1.ConfusionMatrix) 35 ConfusionMatrixOrBuilder { 36 private static final long serialVersionUID = 0L; 37 // Use ConfusionMatrix.newBuilder() to construct. ConfusionMatrix(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)38 private ConfusionMatrix(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 39 super(builder); 40 } 41 ConfusionMatrix()42 private ConfusionMatrix() { 43 row_ = 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 ConfusionMatrix(); 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 com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 59 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_descriptor; 60 } 61 62 @java.lang.Override 63 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()64 internalGetFieldAccessorTable() { 65 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 66 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_fieldAccessorTable 67 .ensureFieldAccessorsInitialized( 68 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.class, 69 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Builder.class); 70 } 71 72 public interface ConfusionMatrixEntryOrBuilder 73 extends 74 // @@protoc_insertion_point(interface_extends:google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) 75 com.google.protobuf.MessageOrBuilder { 76 77 /** 78 * 79 * 80 * <pre> 81 * The annotation spec of a predicted label. 82 * </pre> 83 * 84 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 85 * 86 * @return Whether the annotationSpec field is set. 87 */ hasAnnotationSpec()88 boolean hasAnnotationSpec(); 89 /** 90 * 91 * 92 * <pre> 93 * The annotation spec of a predicted label. 94 * </pre> 95 * 96 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 97 * 98 * @return The annotationSpec. 99 */ getAnnotationSpec()100 com.google.cloud.datalabeling.v1beta1.AnnotationSpec getAnnotationSpec(); 101 /** 102 * 103 * 104 * <pre> 105 * The annotation spec of a predicted label. 106 * </pre> 107 * 108 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 109 */ getAnnotationSpecOrBuilder()110 com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder getAnnotationSpecOrBuilder(); 111 112 /** 113 * 114 * 115 * <pre> 116 * Number of items predicted to have this label. (The ground truth label for 117 * these items is the `Row.annotationSpec` of this entry's parent.) 118 * </pre> 119 * 120 * <code>int32 item_count = 2;</code> 121 * 122 * @return The itemCount. 123 */ getItemCount()124 int getItemCount(); 125 } 126 /** 127 * Protobuf type {@code google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry} 128 */ 129 public static final class ConfusionMatrixEntry extends com.google.protobuf.GeneratedMessageV3 130 implements 131 // @@protoc_insertion_point(message_implements:google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) 132 ConfusionMatrixEntryOrBuilder { 133 private static final long serialVersionUID = 0L; 134 // Use ConfusionMatrixEntry.newBuilder() to construct. ConfusionMatrixEntry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)135 private ConfusionMatrixEntry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 136 super(builder); 137 } 138 ConfusionMatrixEntry()139 private ConfusionMatrixEntry() {} 140 141 @java.lang.Override 142 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)143 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 144 return new ConfusionMatrixEntry(); 145 } 146 147 @java.lang.Override getUnknownFields()148 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 149 return this.unknownFields; 150 } 151 getDescriptor()152 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 153 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 154 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_ConfusionMatrixEntry_descriptor; 155 } 156 157 @java.lang.Override 158 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()159 internalGetFieldAccessorTable() { 160 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 161 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_ConfusionMatrixEntry_fieldAccessorTable 162 .ensureFieldAccessorsInitialized( 163 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.class, 164 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder 165 .class); 166 } 167 168 public static final int ANNOTATION_SPEC_FIELD_NUMBER = 1; 169 private com.google.cloud.datalabeling.v1beta1.AnnotationSpec annotationSpec_; 170 /** 171 * 172 * 173 * <pre> 174 * The annotation spec of a predicted label. 175 * </pre> 176 * 177 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 178 * 179 * @return Whether the annotationSpec field is set. 180 */ 181 @java.lang.Override hasAnnotationSpec()182 public boolean hasAnnotationSpec() { 183 return annotationSpec_ != null; 184 } 185 /** 186 * 187 * 188 * <pre> 189 * The annotation spec of a predicted label. 190 * </pre> 191 * 192 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 193 * 194 * @return The annotationSpec. 195 */ 196 @java.lang.Override getAnnotationSpec()197 public com.google.cloud.datalabeling.v1beta1.AnnotationSpec getAnnotationSpec() { 198 return annotationSpec_ == null 199 ? com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance() 200 : annotationSpec_; 201 } 202 /** 203 * 204 * 205 * <pre> 206 * The annotation spec of a predicted label. 207 * </pre> 208 * 209 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 210 */ 211 @java.lang.Override 212 public com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder getAnnotationSpecOrBuilder()213 getAnnotationSpecOrBuilder() { 214 return annotationSpec_ == null 215 ? com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance() 216 : annotationSpec_; 217 } 218 219 public static final int ITEM_COUNT_FIELD_NUMBER = 2; 220 private int itemCount_ = 0; 221 /** 222 * 223 * 224 * <pre> 225 * Number of items predicted to have this label. (The ground truth label for 226 * these items is the `Row.annotationSpec` of this entry's parent.) 227 * </pre> 228 * 229 * <code>int32 item_count = 2;</code> 230 * 231 * @return The itemCount. 232 */ 233 @java.lang.Override getItemCount()234 public int getItemCount() { 235 return itemCount_; 236 } 237 238 private byte memoizedIsInitialized = -1; 239 240 @java.lang.Override isInitialized()241 public final boolean isInitialized() { 242 byte isInitialized = memoizedIsInitialized; 243 if (isInitialized == 1) return true; 244 if (isInitialized == 0) return false; 245 246 memoizedIsInitialized = 1; 247 return true; 248 } 249 250 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)251 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 252 if (annotationSpec_ != null) { 253 output.writeMessage(1, getAnnotationSpec()); 254 } 255 if (itemCount_ != 0) { 256 output.writeInt32(2, itemCount_); 257 } 258 getUnknownFields().writeTo(output); 259 } 260 261 @java.lang.Override getSerializedSize()262 public int getSerializedSize() { 263 int size = memoizedSize; 264 if (size != -1) return size; 265 266 size = 0; 267 if (annotationSpec_ != null) { 268 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAnnotationSpec()); 269 } 270 if (itemCount_ != 0) { 271 size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, itemCount_); 272 } 273 size += getUnknownFields().getSerializedSize(); 274 memoizedSize = size; 275 return size; 276 } 277 278 @java.lang.Override equals(final java.lang.Object obj)279 public boolean equals(final java.lang.Object obj) { 280 if (obj == this) { 281 return true; 282 } 283 if (!(obj 284 instanceof com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry)) { 285 return super.equals(obj); 286 } 287 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry other = 288 (com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) obj; 289 290 if (hasAnnotationSpec() != other.hasAnnotationSpec()) return false; 291 if (hasAnnotationSpec()) { 292 if (!getAnnotationSpec().equals(other.getAnnotationSpec())) return false; 293 } 294 if (getItemCount() != other.getItemCount()) return false; 295 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 296 return true; 297 } 298 299 @java.lang.Override hashCode()300 public int hashCode() { 301 if (memoizedHashCode != 0) { 302 return memoizedHashCode; 303 } 304 int hash = 41; 305 hash = (19 * hash) + getDescriptor().hashCode(); 306 if (hasAnnotationSpec()) { 307 hash = (37 * hash) + ANNOTATION_SPEC_FIELD_NUMBER; 308 hash = (53 * hash) + getAnnotationSpec().hashCode(); 309 } 310 hash = (37 * hash) + ITEM_COUNT_FIELD_NUMBER; 311 hash = (53 * hash) + getItemCount(); 312 hash = (29 * hash) + getUnknownFields().hashCode(); 313 memoizedHashCode = hash; 314 return hash; 315 } 316 317 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom(java.nio.ByteBuffer data)318 parseFrom(java.nio.ByteBuffer data) 319 throws com.google.protobuf.InvalidProtocolBufferException { 320 return PARSER.parseFrom(data); 321 } 322 323 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)324 parseFrom( 325 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 326 throws com.google.protobuf.InvalidProtocolBufferException { 327 return PARSER.parseFrom(data, extensionRegistry); 328 } 329 330 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom(com.google.protobuf.ByteString data)331 parseFrom(com.google.protobuf.ByteString data) 332 throws com.google.protobuf.InvalidProtocolBufferException { 333 return PARSER.parseFrom(data); 334 } 335 336 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)337 parseFrom( 338 com.google.protobuf.ByteString data, 339 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 340 throws com.google.protobuf.InvalidProtocolBufferException { 341 return PARSER.parseFrom(data, extensionRegistry); 342 } 343 344 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom(byte[] data)345 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { 346 return PARSER.parseFrom(data); 347 } 348 349 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)350 parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 351 throws com.google.protobuf.InvalidProtocolBufferException { 352 return PARSER.parseFrom(data, extensionRegistry); 353 } 354 355 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom(java.io.InputStream input)356 parseFrom(java.io.InputStream input) throws java.io.IOException { 357 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 358 } 359 360 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)361 parseFrom( 362 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 363 throws java.io.IOException { 364 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 365 PARSER, input, extensionRegistry); 366 } 367 368 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseDelimitedFrom(java.io.InputStream input)369 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { 370 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 371 } 372 373 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)374 parseDelimitedFrom( 375 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 376 throws java.io.IOException { 377 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 378 PARSER, input, extensionRegistry); 379 } 380 381 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom(com.google.protobuf.CodedInputStream input)382 parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { 383 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 384 } 385 386 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)387 parseFrom( 388 com.google.protobuf.CodedInputStream input, 389 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 390 throws java.io.IOException { 391 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 392 PARSER, input, extensionRegistry); 393 } 394 395 @java.lang.Override newBuilderForType()396 public Builder newBuilderForType() { 397 return newBuilder(); 398 } 399 newBuilder()400 public static Builder newBuilder() { 401 return DEFAULT_INSTANCE.toBuilder(); 402 } 403 newBuilder( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry prototype)404 public static Builder newBuilder( 405 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry prototype) { 406 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 407 } 408 409 @java.lang.Override toBuilder()410 public Builder toBuilder() { 411 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 412 } 413 414 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)415 protected Builder newBuilderForType( 416 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 417 Builder builder = new Builder(parent); 418 return builder; 419 } 420 /** 421 * Protobuf type {@code google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry} 422 */ 423 public static final class Builder 424 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 425 implements 426 // @@protoc_insertion_point(builder_implements:google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) 427 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntryOrBuilder { getDescriptor()428 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 429 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 430 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_ConfusionMatrixEntry_descriptor; 431 } 432 433 @java.lang.Override 434 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()435 internalGetFieldAccessorTable() { 436 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 437 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_ConfusionMatrixEntry_fieldAccessorTable 438 .ensureFieldAccessorsInitialized( 439 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.class, 440 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder 441 .class); 442 } 443 444 // Construct using 445 // com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.newBuilder() Builder()446 private Builder() {} 447 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)448 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 449 super(parent); 450 } 451 452 @java.lang.Override clear()453 public Builder clear() { 454 super.clear(); 455 bitField0_ = 0; 456 annotationSpec_ = null; 457 if (annotationSpecBuilder_ != null) { 458 annotationSpecBuilder_.dispose(); 459 annotationSpecBuilder_ = null; 460 } 461 itemCount_ = 0; 462 return this; 463 } 464 465 @java.lang.Override getDescriptorForType()466 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 467 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 468 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_ConfusionMatrixEntry_descriptor; 469 } 470 471 @java.lang.Override 472 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry getDefaultInstanceForType()473 getDefaultInstanceForType() { 474 return com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry 475 .getDefaultInstance(); 476 } 477 478 @java.lang.Override build()479 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry build() { 480 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry result = 481 buildPartial(); 482 if (!result.isInitialized()) { 483 throw newUninitializedMessageException(result); 484 } 485 return result; 486 } 487 488 @java.lang.Override 489 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry buildPartial()490 buildPartial() { 491 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry result = 492 new com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry(this); 493 if (bitField0_ != 0) { 494 buildPartial0(result); 495 } 496 onBuilt(); 497 return result; 498 } 499 buildPartial0( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry result)500 private void buildPartial0( 501 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry result) { 502 int from_bitField0_ = bitField0_; 503 if (((from_bitField0_ & 0x00000001) != 0)) { 504 result.annotationSpec_ = 505 annotationSpecBuilder_ == null ? annotationSpec_ : annotationSpecBuilder_.build(); 506 } 507 if (((from_bitField0_ & 0x00000002) != 0)) { 508 result.itemCount_ = itemCount_; 509 } 510 } 511 512 @java.lang.Override clone()513 public Builder clone() { 514 return super.clone(); 515 } 516 517 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)518 public Builder setField( 519 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 520 return super.setField(field, value); 521 } 522 523 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)524 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 525 return super.clearField(field); 526 } 527 528 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)529 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 530 return super.clearOneof(oneof); 531 } 532 533 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)534 public Builder setRepeatedField( 535 com.google.protobuf.Descriptors.FieldDescriptor field, 536 int index, 537 java.lang.Object value) { 538 return super.setRepeatedField(field, index, value); 539 } 540 541 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)542 public Builder addRepeatedField( 543 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 544 return super.addRepeatedField(field, value); 545 } 546 547 @java.lang.Override mergeFrom(com.google.protobuf.Message other)548 public Builder mergeFrom(com.google.protobuf.Message other) { 549 if (other 550 instanceof com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) { 551 return mergeFrom( 552 (com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) other); 553 } else { 554 super.mergeFrom(other); 555 return this; 556 } 557 } 558 mergeFrom( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry other)559 public Builder mergeFrom( 560 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry other) { 561 if (other 562 == com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry 563 .getDefaultInstance()) return this; 564 if (other.hasAnnotationSpec()) { 565 mergeAnnotationSpec(other.getAnnotationSpec()); 566 } 567 if (other.getItemCount() != 0) { 568 setItemCount(other.getItemCount()); 569 } 570 this.mergeUnknownFields(other.getUnknownFields()); 571 onChanged(); 572 return this; 573 } 574 575 @java.lang.Override isInitialized()576 public final boolean isInitialized() { 577 return true; 578 } 579 580 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)581 public Builder mergeFrom( 582 com.google.protobuf.CodedInputStream input, 583 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 584 throws java.io.IOException { 585 if (extensionRegistry == null) { 586 throw new java.lang.NullPointerException(); 587 } 588 try { 589 boolean done = false; 590 while (!done) { 591 int tag = input.readTag(); 592 switch (tag) { 593 case 0: 594 done = true; 595 break; 596 case 10: 597 { 598 input.readMessage( 599 getAnnotationSpecFieldBuilder().getBuilder(), extensionRegistry); 600 bitField0_ |= 0x00000001; 601 break; 602 } // case 10 603 case 16: 604 { 605 itemCount_ = input.readInt32(); 606 bitField0_ |= 0x00000002; 607 break; 608 } // case 16 609 default: 610 { 611 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 612 done = true; // was an endgroup tag 613 } 614 break; 615 } // default: 616 } // switch (tag) 617 } // while (!done) 618 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 619 throw e.unwrapIOException(); 620 } finally { 621 onChanged(); 622 } // finally 623 return this; 624 } 625 626 private int bitField0_; 627 628 private com.google.cloud.datalabeling.v1beta1.AnnotationSpec annotationSpec_; 629 private com.google.protobuf.SingleFieldBuilderV3< 630 com.google.cloud.datalabeling.v1beta1.AnnotationSpec, 631 com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder, 632 com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder> 633 annotationSpecBuilder_; 634 /** 635 * 636 * 637 * <pre> 638 * The annotation spec of a predicted label. 639 * </pre> 640 * 641 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 642 * 643 * @return Whether the annotationSpec field is set. 644 */ hasAnnotationSpec()645 public boolean hasAnnotationSpec() { 646 return ((bitField0_ & 0x00000001) != 0); 647 } 648 /** 649 * 650 * 651 * <pre> 652 * The annotation spec of a predicted label. 653 * </pre> 654 * 655 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 656 * 657 * @return The annotationSpec. 658 */ getAnnotationSpec()659 public com.google.cloud.datalabeling.v1beta1.AnnotationSpec getAnnotationSpec() { 660 if (annotationSpecBuilder_ == null) { 661 return annotationSpec_ == null 662 ? com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance() 663 : annotationSpec_; 664 } else { 665 return annotationSpecBuilder_.getMessage(); 666 } 667 } 668 /** 669 * 670 * 671 * <pre> 672 * The annotation spec of a predicted label. 673 * </pre> 674 * 675 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 676 */ setAnnotationSpec(com.google.cloud.datalabeling.v1beta1.AnnotationSpec value)677 public Builder setAnnotationSpec(com.google.cloud.datalabeling.v1beta1.AnnotationSpec value) { 678 if (annotationSpecBuilder_ == null) { 679 if (value == null) { 680 throw new NullPointerException(); 681 } 682 annotationSpec_ = value; 683 } else { 684 annotationSpecBuilder_.setMessage(value); 685 } 686 bitField0_ |= 0x00000001; 687 onChanged(); 688 return this; 689 } 690 /** 691 * 692 * 693 * <pre> 694 * The annotation spec of a predicted label. 695 * </pre> 696 * 697 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 698 */ setAnnotationSpec( com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder builderForValue)699 public Builder setAnnotationSpec( 700 com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder builderForValue) { 701 if (annotationSpecBuilder_ == null) { 702 annotationSpec_ = builderForValue.build(); 703 } else { 704 annotationSpecBuilder_.setMessage(builderForValue.build()); 705 } 706 bitField0_ |= 0x00000001; 707 onChanged(); 708 return this; 709 } 710 /** 711 * 712 * 713 * <pre> 714 * The annotation spec of a predicted label. 715 * </pre> 716 * 717 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 718 */ mergeAnnotationSpec( com.google.cloud.datalabeling.v1beta1.AnnotationSpec value)719 public Builder mergeAnnotationSpec( 720 com.google.cloud.datalabeling.v1beta1.AnnotationSpec value) { 721 if (annotationSpecBuilder_ == null) { 722 if (((bitField0_ & 0x00000001) != 0) 723 && annotationSpec_ != null 724 && annotationSpec_ 725 != com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance()) { 726 getAnnotationSpecBuilder().mergeFrom(value); 727 } else { 728 annotationSpec_ = value; 729 } 730 } else { 731 annotationSpecBuilder_.mergeFrom(value); 732 } 733 bitField0_ |= 0x00000001; 734 onChanged(); 735 return this; 736 } 737 /** 738 * 739 * 740 * <pre> 741 * The annotation spec of a predicted label. 742 * </pre> 743 * 744 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 745 */ clearAnnotationSpec()746 public Builder clearAnnotationSpec() { 747 bitField0_ = (bitField0_ & ~0x00000001); 748 annotationSpec_ = null; 749 if (annotationSpecBuilder_ != null) { 750 annotationSpecBuilder_.dispose(); 751 annotationSpecBuilder_ = null; 752 } 753 onChanged(); 754 return this; 755 } 756 /** 757 * 758 * 759 * <pre> 760 * The annotation spec of a predicted label. 761 * </pre> 762 * 763 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 764 */ 765 public com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder getAnnotationSpecBuilder()766 getAnnotationSpecBuilder() { 767 bitField0_ |= 0x00000001; 768 onChanged(); 769 return getAnnotationSpecFieldBuilder().getBuilder(); 770 } 771 /** 772 * 773 * 774 * <pre> 775 * The annotation spec of a predicted label. 776 * </pre> 777 * 778 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 779 */ 780 public com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder getAnnotationSpecOrBuilder()781 getAnnotationSpecOrBuilder() { 782 if (annotationSpecBuilder_ != null) { 783 return annotationSpecBuilder_.getMessageOrBuilder(); 784 } else { 785 return annotationSpec_ == null 786 ? com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance() 787 : annotationSpec_; 788 } 789 } 790 /** 791 * 792 * 793 * <pre> 794 * The annotation spec of a predicted label. 795 * </pre> 796 * 797 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 798 */ 799 private com.google.protobuf.SingleFieldBuilderV3< 800 com.google.cloud.datalabeling.v1beta1.AnnotationSpec, 801 com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder, 802 com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder> getAnnotationSpecFieldBuilder()803 getAnnotationSpecFieldBuilder() { 804 if (annotationSpecBuilder_ == null) { 805 annotationSpecBuilder_ = 806 new com.google.protobuf.SingleFieldBuilderV3< 807 com.google.cloud.datalabeling.v1beta1.AnnotationSpec, 808 com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder, 809 com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder>( 810 getAnnotationSpec(), getParentForChildren(), isClean()); 811 annotationSpec_ = null; 812 } 813 return annotationSpecBuilder_; 814 } 815 816 private int itemCount_; 817 /** 818 * 819 * 820 * <pre> 821 * Number of items predicted to have this label. (The ground truth label for 822 * these items is the `Row.annotationSpec` of this entry's parent.) 823 * </pre> 824 * 825 * <code>int32 item_count = 2;</code> 826 * 827 * @return The itemCount. 828 */ 829 @java.lang.Override getItemCount()830 public int getItemCount() { 831 return itemCount_; 832 } 833 /** 834 * 835 * 836 * <pre> 837 * Number of items predicted to have this label. (The ground truth label for 838 * these items is the `Row.annotationSpec` of this entry's parent.) 839 * </pre> 840 * 841 * <code>int32 item_count = 2;</code> 842 * 843 * @param value The itemCount to set. 844 * @return This builder for chaining. 845 */ setItemCount(int value)846 public Builder setItemCount(int value) { 847 848 itemCount_ = value; 849 bitField0_ |= 0x00000002; 850 onChanged(); 851 return this; 852 } 853 /** 854 * 855 * 856 * <pre> 857 * Number of items predicted to have this label. (The ground truth label for 858 * these items is the `Row.annotationSpec` of this entry's parent.) 859 * </pre> 860 * 861 * <code>int32 item_count = 2;</code> 862 * 863 * @return This builder for chaining. 864 */ clearItemCount()865 public Builder clearItemCount() { 866 bitField0_ = (bitField0_ & ~0x00000002); 867 itemCount_ = 0; 868 onChanged(); 869 return this; 870 } 871 872 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)873 public final Builder setUnknownFields( 874 final com.google.protobuf.UnknownFieldSet unknownFields) { 875 return super.setUnknownFields(unknownFields); 876 } 877 878 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)879 public final Builder mergeUnknownFields( 880 final com.google.protobuf.UnknownFieldSet unknownFields) { 881 return super.mergeUnknownFields(unknownFields); 882 } 883 884 // @@protoc_insertion_point(builder_scope:google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) 885 } 886 887 // @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) 888 private static final com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry 889 DEFAULT_INSTANCE; 890 891 static { 892 DEFAULT_INSTANCE = 893 new com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry(); 894 } 895 896 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry getDefaultInstance()897 getDefaultInstance() { 898 return DEFAULT_INSTANCE; 899 } 900 901 private static final com.google.protobuf.Parser<ConfusionMatrixEntry> PARSER = 902 new com.google.protobuf.AbstractParser<ConfusionMatrixEntry>() { 903 @java.lang.Override 904 public ConfusionMatrixEntry parsePartialFrom( 905 com.google.protobuf.CodedInputStream input, 906 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 907 throws com.google.protobuf.InvalidProtocolBufferException { 908 Builder builder = newBuilder(); 909 try { 910 builder.mergeFrom(input, extensionRegistry); 911 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 912 throw e.setUnfinishedMessage(builder.buildPartial()); 913 } catch (com.google.protobuf.UninitializedMessageException e) { 914 throw e.asInvalidProtocolBufferException() 915 .setUnfinishedMessage(builder.buildPartial()); 916 } catch (java.io.IOException e) { 917 throw new com.google.protobuf.InvalidProtocolBufferException(e) 918 .setUnfinishedMessage(builder.buildPartial()); 919 } 920 return builder.buildPartial(); 921 } 922 }; 923 parser()924 public static com.google.protobuf.Parser<ConfusionMatrixEntry> parser() { 925 return PARSER; 926 } 927 928 @java.lang.Override getParserForType()929 public com.google.protobuf.Parser<ConfusionMatrixEntry> getParserForType() { 930 return PARSER; 931 } 932 933 @java.lang.Override 934 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry getDefaultInstanceForType()935 getDefaultInstanceForType() { 936 return DEFAULT_INSTANCE; 937 } 938 } 939 940 public interface RowOrBuilder 941 extends 942 // @@protoc_insertion_point(interface_extends:google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) 943 com.google.protobuf.MessageOrBuilder { 944 945 /** 946 * 947 * 948 * <pre> 949 * The annotation spec of the ground truth label for this row. 950 * </pre> 951 * 952 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 953 * 954 * @return Whether the annotationSpec field is set. 955 */ hasAnnotationSpec()956 boolean hasAnnotationSpec(); 957 /** 958 * 959 * 960 * <pre> 961 * The annotation spec of the ground truth label for this row. 962 * </pre> 963 * 964 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 965 * 966 * @return The annotationSpec. 967 */ getAnnotationSpec()968 com.google.cloud.datalabeling.v1beta1.AnnotationSpec getAnnotationSpec(); 969 /** 970 * 971 * 972 * <pre> 973 * The annotation spec of the ground truth label for this row. 974 * </pre> 975 * 976 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 977 */ getAnnotationSpecOrBuilder()978 com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder getAnnotationSpecOrBuilder(); 979 980 /** 981 * 982 * 983 * <pre> 984 * A list of the confusion matrix entries. One entry for each possible 985 * predicted label. 986 * </pre> 987 * 988 * <code> 989 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 990 * </code> 991 */ 992 java.util.List<com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry> getEntriesList()993 getEntriesList(); 994 /** 995 * 996 * 997 * <pre> 998 * A list of the confusion matrix entries. One entry for each possible 999 * predicted label. 1000 * </pre> 1001 * 1002 * <code> 1003 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1004 * </code> 1005 */ getEntries( int index)1006 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry getEntries( 1007 int index); 1008 /** 1009 * 1010 * 1011 * <pre> 1012 * A list of the confusion matrix entries. One entry for each possible 1013 * predicted label. 1014 * </pre> 1015 * 1016 * <code> 1017 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1018 * </code> 1019 */ getEntriesCount()1020 int getEntriesCount(); 1021 /** 1022 * 1023 * 1024 * <pre> 1025 * A list of the confusion matrix entries. One entry for each possible 1026 * predicted label. 1027 * </pre> 1028 * 1029 * <code> 1030 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1031 * </code> 1032 */ 1033 java.util.List< 1034 ? extends 1035 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntryOrBuilder> getEntriesOrBuilderList()1036 getEntriesOrBuilderList(); 1037 /** 1038 * 1039 * 1040 * <pre> 1041 * A list of the confusion matrix entries. One entry for each possible 1042 * predicted label. 1043 * </pre> 1044 * 1045 * <code> 1046 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1047 * </code> 1048 */ 1049 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntryOrBuilder getEntriesOrBuilder(int index)1050 getEntriesOrBuilder(int index); 1051 } 1052 /** 1053 * 1054 * 1055 * <pre> 1056 * A row in the confusion matrix. Each entry in this row has the same 1057 * ground truth label. 1058 * </pre> 1059 * 1060 * Protobuf type {@code google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row} 1061 */ 1062 public static final class Row extends com.google.protobuf.GeneratedMessageV3 1063 implements 1064 // @@protoc_insertion_point(message_implements:google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) 1065 RowOrBuilder { 1066 private static final long serialVersionUID = 0L; 1067 // Use Row.newBuilder() to construct. Row(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)1068 private Row(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 1069 super(builder); 1070 } 1071 Row()1072 private Row() { 1073 entries_ = java.util.Collections.emptyList(); 1074 } 1075 1076 @java.lang.Override 1077 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)1078 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 1079 return new Row(); 1080 } 1081 1082 @java.lang.Override getUnknownFields()1083 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 1084 return this.unknownFields; 1085 } 1086 getDescriptor()1087 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1088 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 1089 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_Row_descriptor; 1090 } 1091 1092 @java.lang.Override 1093 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1094 internalGetFieldAccessorTable() { 1095 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 1096 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_Row_fieldAccessorTable 1097 .ensureFieldAccessorsInitialized( 1098 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.class, 1099 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder.class); 1100 } 1101 1102 public static final int ANNOTATION_SPEC_FIELD_NUMBER = 1; 1103 private com.google.cloud.datalabeling.v1beta1.AnnotationSpec annotationSpec_; 1104 /** 1105 * 1106 * 1107 * <pre> 1108 * The annotation spec of the ground truth label for this row. 1109 * </pre> 1110 * 1111 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1112 * 1113 * @return Whether the annotationSpec field is set. 1114 */ 1115 @java.lang.Override hasAnnotationSpec()1116 public boolean hasAnnotationSpec() { 1117 return annotationSpec_ != null; 1118 } 1119 /** 1120 * 1121 * 1122 * <pre> 1123 * The annotation spec of the ground truth label for this row. 1124 * </pre> 1125 * 1126 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1127 * 1128 * @return The annotationSpec. 1129 */ 1130 @java.lang.Override getAnnotationSpec()1131 public com.google.cloud.datalabeling.v1beta1.AnnotationSpec getAnnotationSpec() { 1132 return annotationSpec_ == null 1133 ? com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance() 1134 : annotationSpec_; 1135 } 1136 /** 1137 * 1138 * 1139 * <pre> 1140 * The annotation spec of the ground truth label for this row. 1141 * </pre> 1142 * 1143 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1144 */ 1145 @java.lang.Override 1146 public com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder getAnnotationSpecOrBuilder()1147 getAnnotationSpecOrBuilder() { 1148 return annotationSpec_ == null 1149 ? com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance() 1150 : annotationSpec_; 1151 } 1152 1153 public static final int ENTRIES_FIELD_NUMBER = 2; 1154 1155 @SuppressWarnings("serial") 1156 private java.util.List< 1157 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry> 1158 entries_; 1159 /** 1160 * 1161 * 1162 * <pre> 1163 * A list of the confusion matrix entries. One entry for each possible 1164 * predicted label. 1165 * </pre> 1166 * 1167 * <code> 1168 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1169 * </code> 1170 */ 1171 @java.lang.Override 1172 public java.util.List< 1173 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry> getEntriesList()1174 getEntriesList() { 1175 return entries_; 1176 } 1177 /** 1178 * 1179 * 1180 * <pre> 1181 * A list of the confusion matrix entries. One entry for each possible 1182 * predicted label. 1183 * </pre> 1184 * 1185 * <code> 1186 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1187 * </code> 1188 */ 1189 @java.lang.Override 1190 public java.util.List< 1191 ? extends 1192 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntryOrBuilder> getEntriesOrBuilderList()1193 getEntriesOrBuilderList() { 1194 return entries_; 1195 } 1196 /** 1197 * 1198 * 1199 * <pre> 1200 * A list of the confusion matrix entries. One entry for each possible 1201 * predicted label. 1202 * </pre> 1203 * 1204 * <code> 1205 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1206 * </code> 1207 */ 1208 @java.lang.Override getEntriesCount()1209 public int getEntriesCount() { 1210 return entries_.size(); 1211 } 1212 /** 1213 * 1214 * 1215 * <pre> 1216 * A list of the confusion matrix entries. One entry for each possible 1217 * predicted label. 1218 * </pre> 1219 * 1220 * <code> 1221 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1222 * </code> 1223 */ 1224 @java.lang.Override getEntries( int index)1225 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry getEntries( 1226 int index) { 1227 return entries_.get(index); 1228 } 1229 /** 1230 * 1231 * 1232 * <pre> 1233 * A list of the confusion matrix entries. One entry for each possible 1234 * predicted label. 1235 * </pre> 1236 * 1237 * <code> 1238 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1239 * </code> 1240 */ 1241 @java.lang.Override 1242 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntryOrBuilder getEntriesOrBuilder(int index)1243 getEntriesOrBuilder(int index) { 1244 return entries_.get(index); 1245 } 1246 1247 private byte memoizedIsInitialized = -1; 1248 1249 @java.lang.Override isInitialized()1250 public final boolean isInitialized() { 1251 byte isInitialized = memoizedIsInitialized; 1252 if (isInitialized == 1) return true; 1253 if (isInitialized == 0) return false; 1254 1255 memoizedIsInitialized = 1; 1256 return true; 1257 } 1258 1259 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1260 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1261 if (annotationSpec_ != null) { 1262 output.writeMessage(1, getAnnotationSpec()); 1263 } 1264 for (int i = 0; i < entries_.size(); i++) { 1265 output.writeMessage(2, entries_.get(i)); 1266 } 1267 getUnknownFields().writeTo(output); 1268 } 1269 1270 @java.lang.Override getSerializedSize()1271 public int getSerializedSize() { 1272 int size = memoizedSize; 1273 if (size != -1) return size; 1274 1275 size = 0; 1276 if (annotationSpec_ != null) { 1277 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAnnotationSpec()); 1278 } 1279 for (int i = 0; i < entries_.size(); i++) { 1280 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, entries_.get(i)); 1281 } 1282 size += getUnknownFields().getSerializedSize(); 1283 memoizedSize = size; 1284 return size; 1285 } 1286 1287 @java.lang.Override equals(final java.lang.Object obj)1288 public boolean equals(final java.lang.Object obj) { 1289 if (obj == this) { 1290 return true; 1291 } 1292 if (!(obj instanceof com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row)) { 1293 return super.equals(obj); 1294 } 1295 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row other = 1296 (com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) obj; 1297 1298 if (hasAnnotationSpec() != other.hasAnnotationSpec()) return false; 1299 if (hasAnnotationSpec()) { 1300 if (!getAnnotationSpec().equals(other.getAnnotationSpec())) return false; 1301 } 1302 if (!getEntriesList().equals(other.getEntriesList())) return false; 1303 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1304 return true; 1305 } 1306 1307 @java.lang.Override hashCode()1308 public int hashCode() { 1309 if (memoizedHashCode != 0) { 1310 return memoizedHashCode; 1311 } 1312 int hash = 41; 1313 hash = (19 * hash) + getDescriptor().hashCode(); 1314 if (hasAnnotationSpec()) { 1315 hash = (37 * hash) + ANNOTATION_SPEC_FIELD_NUMBER; 1316 hash = (53 * hash) + getAnnotationSpec().hashCode(); 1317 } 1318 if (getEntriesCount() > 0) { 1319 hash = (37 * hash) + ENTRIES_FIELD_NUMBER; 1320 hash = (53 * hash) + getEntriesList().hashCode(); 1321 } 1322 hash = (29 * hash) + getUnknownFields().hashCode(); 1323 memoizedHashCode = hash; 1324 return hash; 1325 } 1326 parseFrom( java.nio.ByteBuffer data)1327 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom( 1328 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 1329 return PARSER.parseFrom(data); 1330 } 1331 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1332 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom( 1333 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1334 throws com.google.protobuf.InvalidProtocolBufferException { 1335 return PARSER.parseFrom(data, extensionRegistry); 1336 } 1337 parseFrom( com.google.protobuf.ByteString data)1338 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom( 1339 com.google.protobuf.ByteString data) 1340 throws com.google.protobuf.InvalidProtocolBufferException { 1341 return PARSER.parseFrom(data); 1342 } 1343 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1344 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom( 1345 com.google.protobuf.ByteString data, 1346 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1347 throws com.google.protobuf.InvalidProtocolBufferException { 1348 return PARSER.parseFrom(data, extensionRegistry); 1349 } 1350 parseFrom(byte[] data)1351 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom(byte[] data) 1352 throws com.google.protobuf.InvalidProtocolBufferException { 1353 return PARSER.parseFrom(data); 1354 } 1355 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1356 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom( 1357 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1358 throws com.google.protobuf.InvalidProtocolBufferException { 1359 return PARSER.parseFrom(data, extensionRegistry); 1360 } 1361 parseFrom( java.io.InputStream input)1362 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom( 1363 java.io.InputStream input) throws java.io.IOException { 1364 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1365 } 1366 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1367 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom( 1368 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1369 throws java.io.IOException { 1370 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1371 PARSER, input, extensionRegistry); 1372 } 1373 parseDelimitedFrom( java.io.InputStream input)1374 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseDelimitedFrom( 1375 java.io.InputStream input) throws java.io.IOException { 1376 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1377 } 1378 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1379 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseDelimitedFrom( 1380 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1381 throws java.io.IOException { 1382 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1383 PARSER, input, extensionRegistry); 1384 } 1385 parseFrom( com.google.protobuf.CodedInputStream input)1386 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom( 1387 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1388 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1389 } 1390 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1391 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row parseFrom( 1392 com.google.protobuf.CodedInputStream input, 1393 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1394 throws java.io.IOException { 1395 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1396 PARSER, input, extensionRegistry); 1397 } 1398 1399 @java.lang.Override newBuilderForType()1400 public Builder newBuilderForType() { 1401 return newBuilder(); 1402 } 1403 newBuilder()1404 public static Builder newBuilder() { 1405 return DEFAULT_INSTANCE.toBuilder(); 1406 } 1407 newBuilder( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row prototype)1408 public static Builder newBuilder( 1409 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row prototype) { 1410 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1411 } 1412 1413 @java.lang.Override toBuilder()1414 public Builder toBuilder() { 1415 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1416 } 1417 1418 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1419 protected Builder newBuilderForType( 1420 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1421 Builder builder = new Builder(parent); 1422 return builder; 1423 } 1424 /** 1425 * 1426 * 1427 * <pre> 1428 * A row in the confusion matrix. Each entry in this row has the same 1429 * ground truth label. 1430 * </pre> 1431 * 1432 * Protobuf type {@code google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row} 1433 */ 1434 public static final class Builder 1435 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1436 implements 1437 // @@protoc_insertion_point(builder_implements:google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) 1438 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.RowOrBuilder { getDescriptor()1439 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1440 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 1441 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_Row_descriptor; 1442 } 1443 1444 @java.lang.Override 1445 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1446 internalGetFieldAccessorTable() { 1447 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 1448 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_Row_fieldAccessorTable 1449 .ensureFieldAccessorsInitialized( 1450 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.class, 1451 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder.class); 1452 } 1453 1454 // Construct using com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.newBuilder() Builder()1455 private Builder() {} 1456 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1457 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1458 super(parent); 1459 } 1460 1461 @java.lang.Override clear()1462 public Builder clear() { 1463 super.clear(); 1464 bitField0_ = 0; 1465 annotationSpec_ = null; 1466 if (annotationSpecBuilder_ != null) { 1467 annotationSpecBuilder_.dispose(); 1468 annotationSpecBuilder_ = null; 1469 } 1470 if (entriesBuilder_ == null) { 1471 entries_ = java.util.Collections.emptyList(); 1472 } else { 1473 entries_ = null; 1474 entriesBuilder_.clear(); 1475 } 1476 bitField0_ = (bitField0_ & ~0x00000002); 1477 return this; 1478 } 1479 1480 @java.lang.Override getDescriptorForType()1481 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1482 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 1483 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_Row_descriptor; 1484 } 1485 1486 @java.lang.Override getDefaultInstanceForType()1487 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row getDefaultInstanceForType() { 1488 return com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.getDefaultInstance(); 1489 } 1490 1491 @java.lang.Override build()1492 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row build() { 1493 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row result = buildPartial(); 1494 if (!result.isInitialized()) { 1495 throw newUninitializedMessageException(result); 1496 } 1497 return result; 1498 } 1499 1500 @java.lang.Override buildPartial()1501 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row buildPartial() { 1502 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row result = 1503 new com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row(this); 1504 buildPartialRepeatedFields(result); 1505 if (bitField0_ != 0) { 1506 buildPartial0(result); 1507 } 1508 onBuilt(); 1509 return result; 1510 } 1511 buildPartialRepeatedFields( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row result)1512 private void buildPartialRepeatedFields( 1513 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row result) { 1514 if (entriesBuilder_ == null) { 1515 if (((bitField0_ & 0x00000002) != 0)) { 1516 entries_ = java.util.Collections.unmodifiableList(entries_); 1517 bitField0_ = (bitField0_ & ~0x00000002); 1518 } 1519 result.entries_ = entries_; 1520 } else { 1521 result.entries_ = entriesBuilder_.build(); 1522 } 1523 } 1524 buildPartial0(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row result)1525 private void buildPartial0(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row result) { 1526 int from_bitField0_ = bitField0_; 1527 if (((from_bitField0_ & 0x00000001) != 0)) { 1528 result.annotationSpec_ = 1529 annotationSpecBuilder_ == null ? annotationSpec_ : annotationSpecBuilder_.build(); 1530 } 1531 } 1532 1533 @java.lang.Override clone()1534 public Builder clone() { 1535 return super.clone(); 1536 } 1537 1538 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1539 public Builder setField( 1540 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1541 return super.setField(field, value); 1542 } 1543 1544 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1545 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1546 return super.clearField(field); 1547 } 1548 1549 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1550 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1551 return super.clearOneof(oneof); 1552 } 1553 1554 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1555 public Builder setRepeatedField( 1556 com.google.protobuf.Descriptors.FieldDescriptor field, 1557 int index, 1558 java.lang.Object value) { 1559 return super.setRepeatedField(field, index, value); 1560 } 1561 1562 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1563 public Builder addRepeatedField( 1564 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1565 return super.addRepeatedField(field, value); 1566 } 1567 1568 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1569 public Builder mergeFrom(com.google.protobuf.Message other) { 1570 if (other instanceof com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) { 1571 return mergeFrom((com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) other); 1572 } else { 1573 super.mergeFrom(other); 1574 return this; 1575 } 1576 } 1577 mergeFrom(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row other)1578 public Builder mergeFrom(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row other) { 1579 if (other == com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.getDefaultInstance()) 1580 return this; 1581 if (other.hasAnnotationSpec()) { 1582 mergeAnnotationSpec(other.getAnnotationSpec()); 1583 } 1584 if (entriesBuilder_ == null) { 1585 if (!other.entries_.isEmpty()) { 1586 if (entries_.isEmpty()) { 1587 entries_ = other.entries_; 1588 bitField0_ = (bitField0_ & ~0x00000002); 1589 } else { 1590 ensureEntriesIsMutable(); 1591 entries_.addAll(other.entries_); 1592 } 1593 onChanged(); 1594 } 1595 } else { 1596 if (!other.entries_.isEmpty()) { 1597 if (entriesBuilder_.isEmpty()) { 1598 entriesBuilder_.dispose(); 1599 entriesBuilder_ = null; 1600 entries_ = other.entries_; 1601 bitField0_ = (bitField0_ & ~0x00000002); 1602 entriesBuilder_ = 1603 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 1604 ? getEntriesFieldBuilder() 1605 : null; 1606 } else { 1607 entriesBuilder_.addAllMessages(other.entries_); 1608 } 1609 } 1610 } 1611 this.mergeUnknownFields(other.getUnknownFields()); 1612 onChanged(); 1613 return this; 1614 } 1615 1616 @java.lang.Override isInitialized()1617 public final boolean isInitialized() { 1618 return true; 1619 } 1620 1621 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1622 public Builder mergeFrom( 1623 com.google.protobuf.CodedInputStream input, 1624 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1625 throws java.io.IOException { 1626 if (extensionRegistry == null) { 1627 throw new java.lang.NullPointerException(); 1628 } 1629 try { 1630 boolean done = false; 1631 while (!done) { 1632 int tag = input.readTag(); 1633 switch (tag) { 1634 case 0: 1635 done = true; 1636 break; 1637 case 10: 1638 { 1639 input.readMessage( 1640 getAnnotationSpecFieldBuilder().getBuilder(), extensionRegistry); 1641 bitField0_ |= 0x00000001; 1642 break; 1643 } // case 10 1644 case 18: 1645 { 1646 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry m = 1647 input.readMessage( 1648 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry 1649 .parser(), 1650 extensionRegistry); 1651 if (entriesBuilder_ == null) { 1652 ensureEntriesIsMutable(); 1653 entries_.add(m); 1654 } else { 1655 entriesBuilder_.addMessage(m); 1656 } 1657 break; 1658 } // case 18 1659 default: 1660 { 1661 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1662 done = true; // was an endgroup tag 1663 } 1664 break; 1665 } // default: 1666 } // switch (tag) 1667 } // while (!done) 1668 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1669 throw e.unwrapIOException(); 1670 } finally { 1671 onChanged(); 1672 } // finally 1673 return this; 1674 } 1675 1676 private int bitField0_; 1677 1678 private com.google.cloud.datalabeling.v1beta1.AnnotationSpec annotationSpec_; 1679 private com.google.protobuf.SingleFieldBuilderV3< 1680 com.google.cloud.datalabeling.v1beta1.AnnotationSpec, 1681 com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder, 1682 com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder> 1683 annotationSpecBuilder_; 1684 /** 1685 * 1686 * 1687 * <pre> 1688 * The annotation spec of the ground truth label for this row. 1689 * </pre> 1690 * 1691 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1692 * 1693 * @return Whether the annotationSpec field is set. 1694 */ hasAnnotationSpec()1695 public boolean hasAnnotationSpec() { 1696 return ((bitField0_ & 0x00000001) != 0); 1697 } 1698 /** 1699 * 1700 * 1701 * <pre> 1702 * The annotation spec of the ground truth label for this row. 1703 * </pre> 1704 * 1705 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1706 * 1707 * @return The annotationSpec. 1708 */ getAnnotationSpec()1709 public com.google.cloud.datalabeling.v1beta1.AnnotationSpec getAnnotationSpec() { 1710 if (annotationSpecBuilder_ == null) { 1711 return annotationSpec_ == null 1712 ? com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance() 1713 : annotationSpec_; 1714 } else { 1715 return annotationSpecBuilder_.getMessage(); 1716 } 1717 } 1718 /** 1719 * 1720 * 1721 * <pre> 1722 * The annotation spec of the ground truth label for this row. 1723 * </pre> 1724 * 1725 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1726 */ setAnnotationSpec(com.google.cloud.datalabeling.v1beta1.AnnotationSpec value)1727 public Builder setAnnotationSpec(com.google.cloud.datalabeling.v1beta1.AnnotationSpec value) { 1728 if (annotationSpecBuilder_ == null) { 1729 if (value == null) { 1730 throw new NullPointerException(); 1731 } 1732 annotationSpec_ = value; 1733 } else { 1734 annotationSpecBuilder_.setMessage(value); 1735 } 1736 bitField0_ |= 0x00000001; 1737 onChanged(); 1738 return this; 1739 } 1740 /** 1741 * 1742 * 1743 * <pre> 1744 * The annotation spec of the ground truth label for this row. 1745 * </pre> 1746 * 1747 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1748 */ setAnnotationSpec( com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder builderForValue)1749 public Builder setAnnotationSpec( 1750 com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder builderForValue) { 1751 if (annotationSpecBuilder_ == null) { 1752 annotationSpec_ = builderForValue.build(); 1753 } else { 1754 annotationSpecBuilder_.setMessage(builderForValue.build()); 1755 } 1756 bitField0_ |= 0x00000001; 1757 onChanged(); 1758 return this; 1759 } 1760 /** 1761 * 1762 * 1763 * <pre> 1764 * The annotation spec of the ground truth label for this row. 1765 * </pre> 1766 * 1767 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1768 */ mergeAnnotationSpec( com.google.cloud.datalabeling.v1beta1.AnnotationSpec value)1769 public Builder mergeAnnotationSpec( 1770 com.google.cloud.datalabeling.v1beta1.AnnotationSpec value) { 1771 if (annotationSpecBuilder_ == null) { 1772 if (((bitField0_ & 0x00000001) != 0) 1773 && annotationSpec_ != null 1774 && annotationSpec_ 1775 != com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance()) { 1776 getAnnotationSpecBuilder().mergeFrom(value); 1777 } else { 1778 annotationSpec_ = value; 1779 } 1780 } else { 1781 annotationSpecBuilder_.mergeFrom(value); 1782 } 1783 bitField0_ |= 0x00000001; 1784 onChanged(); 1785 return this; 1786 } 1787 /** 1788 * 1789 * 1790 * <pre> 1791 * The annotation spec of the ground truth label for this row. 1792 * </pre> 1793 * 1794 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1795 */ clearAnnotationSpec()1796 public Builder clearAnnotationSpec() { 1797 bitField0_ = (bitField0_ & ~0x00000001); 1798 annotationSpec_ = null; 1799 if (annotationSpecBuilder_ != null) { 1800 annotationSpecBuilder_.dispose(); 1801 annotationSpecBuilder_ = null; 1802 } 1803 onChanged(); 1804 return this; 1805 } 1806 /** 1807 * 1808 * 1809 * <pre> 1810 * The annotation spec of the ground truth label for this row. 1811 * </pre> 1812 * 1813 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1814 */ 1815 public com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder getAnnotationSpecBuilder()1816 getAnnotationSpecBuilder() { 1817 bitField0_ |= 0x00000001; 1818 onChanged(); 1819 return getAnnotationSpecFieldBuilder().getBuilder(); 1820 } 1821 /** 1822 * 1823 * 1824 * <pre> 1825 * The annotation spec of the ground truth label for this row. 1826 * </pre> 1827 * 1828 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1829 */ 1830 public com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder getAnnotationSpecOrBuilder()1831 getAnnotationSpecOrBuilder() { 1832 if (annotationSpecBuilder_ != null) { 1833 return annotationSpecBuilder_.getMessageOrBuilder(); 1834 } else { 1835 return annotationSpec_ == null 1836 ? com.google.cloud.datalabeling.v1beta1.AnnotationSpec.getDefaultInstance() 1837 : annotationSpec_; 1838 } 1839 } 1840 /** 1841 * 1842 * 1843 * <pre> 1844 * The annotation spec of the ground truth label for this row. 1845 * </pre> 1846 * 1847 * <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code> 1848 */ 1849 private com.google.protobuf.SingleFieldBuilderV3< 1850 com.google.cloud.datalabeling.v1beta1.AnnotationSpec, 1851 com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder, 1852 com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder> getAnnotationSpecFieldBuilder()1853 getAnnotationSpecFieldBuilder() { 1854 if (annotationSpecBuilder_ == null) { 1855 annotationSpecBuilder_ = 1856 new com.google.protobuf.SingleFieldBuilderV3< 1857 com.google.cloud.datalabeling.v1beta1.AnnotationSpec, 1858 com.google.cloud.datalabeling.v1beta1.AnnotationSpec.Builder, 1859 com.google.cloud.datalabeling.v1beta1.AnnotationSpecOrBuilder>( 1860 getAnnotationSpec(), getParentForChildren(), isClean()); 1861 annotationSpec_ = null; 1862 } 1863 return annotationSpecBuilder_; 1864 } 1865 1866 private java.util.List< 1867 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry> 1868 entries_ = java.util.Collections.emptyList(); 1869 ensureEntriesIsMutable()1870 private void ensureEntriesIsMutable() { 1871 if (!((bitField0_ & 0x00000002) != 0)) { 1872 entries_ = 1873 new java.util.ArrayList< 1874 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry>( 1875 entries_); 1876 bitField0_ |= 0x00000002; 1877 } 1878 } 1879 1880 private com.google.protobuf.RepeatedFieldBuilderV3< 1881 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry, 1882 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder, 1883 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntryOrBuilder> 1884 entriesBuilder_; 1885 1886 /** 1887 * 1888 * 1889 * <pre> 1890 * A list of the confusion matrix entries. One entry for each possible 1891 * predicted label. 1892 * </pre> 1893 * 1894 * <code> 1895 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1896 * </code> 1897 */ 1898 public java.util.List< 1899 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry> getEntriesList()1900 getEntriesList() { 1901 if (entriesBuilder_ == null) { 1902 return java.util.Collections.unmodifiableList(entries_); 1903 } else { 1904 return entriesBuilder_.getMessageList(); 1905 } 1906 } 1907 /** 1908 * 1909 * 1910 * <pre> 1911 * A list of the confusion matrix entries. One entry for each possible 1912 * predicted label. 1913 * </pre> 1914 * 1915 * <code> 1916 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1917 * </code> 1918 */ getEntriesCount()1919 public int getEntriesCount() { 1920 if (entriesBuilder_ == null) { 1921 return entries_.size(); 1922 } else { 1923 return entriesBuilder_.getCount(); 1924 } 1925 } 1926 /** 1927 * 1928 * 1929 * <pre> 1930 * A list of the confusion matrix entries. One entry for each possible 1931 * predicted label. 1932 * </pre> 1933 * 1934 * <code> 1935 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1936 * </code> 1937 */ getEntries( int index)1938 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry getEntries( 1939 int index) { 1940 if (entriesBuilder_ == null) { 1941 return entries_.get(index); 1942 } else { 1943 return entriesBuilder_.getMessage(index); 1944 } 1945 } 1946 /** 1947 * 1948 * 1949 * <pre> 1950 * A list of the confusion matrix entries. One entry for each possible 1951 * predicted label. 1952 * </pre> 1953 * 1954 * <code> 1955 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1956 * </code> 1957 */ setEntries( int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry value)1958 public Builder setEntries( 1959 int index, 1960 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry value) { 1961 if (entriesBuilder_ == null) { 1962 if (value == null) { 1963 throw new NullPointerException(); 1964 } 1965 ensureEntriesIsMutable(); 1966 entries_.set(index, value); 1967 onChanged(); 1968 } else { 1969 entriesBuilder_.setMessage(index, value); 1970 } 1971 return this; 1972 } 1973 /** 1974 * 1975 * 1976 * <pre> 1977 * A list of the confusion matrix entries. One entry for each possible 1978 * predicted label. 1979 * </pre> 1980 * 1981 * <code> 1982 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 1983 * </code> 1984 */ setEntries( int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder builderForValue)1985 public Builder setEntries( 1986 int index, 1987 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder 1988 builderForValue) { 1989 if (entriesBuilder_ == null) { 1990 ensureEntriesIsMutable(); 1991 entries_.set(index, builderForValue.build()); 1992 onChanged(); 1993 } else { 1994 entriesBuilder_.setMessage(index, builderForValue.build()); 1995 } 1996 return this; 1997 } 1998 /** 1999 * 2000 * 2001 * <pre> 2002 * A list of the confusion matrix entries. One entry for each possible 2003 * predicted label. 2004 * </pre> 2005 * 2006 * <code> 2007 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2008 * </code> 2009 */ addEntries( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry value)2010 public Builder addEntries( 2011 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry value) { 2012 if (entriesBuilder_ == null) { 2013 if (value == null) { 2014 throw new NullPointerException(); 2015 } 2016 ensureEntriesIsMutable(); 2017 entries_.add(value); 2018 onChanged(); 2019 } else { 2020 entriesBuilder_.addMessage(value); 2021 } 2022 return this; 2023 } 2024 /** 2025 * 2026 * 2027 * <pre> 2028 * A list of the confusion matrix entries. One entry for each possible 2029 * predicted label. 2030 * </pre> 2031 * 2032 * <code> 2033 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2034 * </code> 2035 */ addEntries( int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry value)2036 public Builder addEntries( 2037 int index, 2038 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry value) { 2039 if (entriesBuilder_ == null) { 2040 if (value == null) { 2041 throw new NullPointerException(); 2042 } 2043 ensureEntriesIsMutable(); 2044 entries_.add(index, value); 2045 onChanged(); 2046 } else { 2047 entriesBuilder_.addMessage(index, value); 2048 } 2049 return this; 2050 } 2051 /** 2052 * 2053 * 2054 * <pre> 2055 * A list of the confusion matrix entries. One entry for each possible 2056 * predicted label. 2057 * </pre> 2058 * 2059 * <code> 2060 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2061 * </code> 2062 */ addEntries( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder builderForValue)2063 public Builder addEntries( 2064 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder 2065 builderForValue) { 2066 if (entriesBuilder_ == null) { 2067 ensureEntriesIsMutable(); 2068 entries_.add(builderForValue.build()); 2069 onChanged(); 2070 } else { 2071 entriesBuilder_.addMessage(builderForValue.build()); 2072 } 2073 return this; 2074 } 2075 /** 2076 * 2077 * 2078 * <pre> 2079 * A list of the confusion matrix entries. One entry for each possible 2080 * predicted label. 2081 * </pre> 2082 * 2083 * <code> 2084 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2085 * </code> 2086 */ addEntries( int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder builderForValue)2087 public Builder addEntries( 2088 int index, 2089 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder 2090 builderForValue) { 2091 if (entriesBuilder_ == null) { 2092 ensureEntriesIsMutable(); 2093 entries_.add(index, builderForValue.build()); 2094 onChanged(); 2095 } else { 2096 entriesBuilder_.addMessage(index, builderForValue.build()); 2097 } 2098 return this; 2099 } 2100 /** 2101 * 2102 * 2103 * <pre> 2104 * A list of the confusion matrix entries. One entry for each possible 2105 * predicted label. 2106 * </pre> 2107 * 2108 * <code> 2109 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2110 * </code> 2111 */ addAllEntries( java.lang.Iterable< ? extends com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry> values)2112 public Builder addAllEntries( 2113 java.lang.Iterable< 2114 ? extends 2115 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry> 2116 values) { 2117 if (entriesBuilder_ == null) { 2118 ensureEntriesIsMutable(); 2119 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entries_); 2120 onChanged(); 2121 } else { 2122 entriesBuilder_.addAllMessages(values); 2123 } 2124 return this; 2125 } 2126 /** 2127 * 2128 * 2129 * <pre> 2130 * A list of the confusion matrix entries. One entry for each possible 2131 * predicted label. 2132 * </pre> 2133 * 2134 * <code> 2135 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2136 * </code> 2137 */ clearEntries()2138 public Builder clearEntries() { 2139 if (entriesBuilder_ == null) { 2140 entries_ = java.util.Collections.emptyList(); 2141 bitField0_ = (bitField0_ & ~0x00000002); 2142 onChanged(); 2143 } else { 2144 entriesBuilder_.clear(); 2145 } 2146 return this; 2147 } 2148 /** 2149 * 2150 * 2151 * <pre> 2152 * A list of the confusion matrix entries. One entry for each possible 2153 * predicted label. 2154 * </pre> 2155 * 2156 * <code> 2157 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2158 * </code> 2159 */ removeEntries(int index)2160 public Builder removeEntries(int index) { 2161 if (entriesBuilder_ == null) { 2162 ensureEntriesIsMutable(); 2163 entries_.remove(index); 2164 onChanged(); 2165 } else { 2166 entriesBuilder_.remove(index); 2167 } 2168 return this; 2169 } 2170 /** 2171 * 2172 * 2173 * <pre> 2174 * A list of the confusion matrix entries. One entry for each possible 2175 * predicted label. 2176 * </pre> 2177 * 2178 * <code> 2179 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2180 * </code> 2181 */ 2182 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder getEntriesBuilder(int index)2183 getEntriesBuilder(int index) { 2184 return getEntriesFieldBuilder().getBuilder(index); 2185 } 2186 /** 2187 * 2188 * 2189 * <pre> 2190 * A list of the confusion matrix entries. One entry for each possible 2191 * predicted label. 2192 * </pre> 2193 * 2194 * <code> 2195 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2196 * </code> 2197 */ 2198 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntryOrBuilder getEntriesOrBuilder(int index)2199 getEntriesOrBuilder(int index) { 2200 if (entriesBuilder_ == null) { 2201 return entries_.get(index); 2202 } else { 2203 return entriesBuilder_.getMessageOrBuilder(index); 2204 } 2205 } 2206 /** 2207 * 2208 * 2209 * <pre> 2210 * A list of the confusion matrix entries. One entry for each possible 2211 * predicted label. 2212 * </pre> 2213 * 2214 * <code> 2215 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2216 * </code> 2217 */ 2218 public java.util.List< 2219 ? extends 2220 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix 2221 .ConfusionMatrixEntryOrBuilder> getEntriesOrBuilderList()2222 getEntriesOrBuilderList() { 2223 if (entriesBuilder_ != null) { 2224 return entriesBuilder_.getMessageOrBuilderList(); 2225 } else { 2226 return java.util.Collections.unmodifiableList(entries_); 2227 } 2228 } 2229 /** 2230 * 2231 * 2232 * <pre> 2233 * A list of the confusion matrix entries. One entry for each possible 2234 * predicted label. 2235 * </pre> 2236 * 2237 * <code> 2238 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2239 * </code> 2240 */ 2241 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder addEntriesBuilder()2242 addEntriesBuilder() { 2243 return getEntriesFieldBuilder() 2244 .addBuilder( 2245 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry 2246 .getDefaultInstance()); 2247 } 2248 /** 2249 * 2250 * 2251 * <pre> 2252 * A list of the confusion matrix entries. One entry for each possible 2253 * predicted label. 2254 * </pre> 2255 * 2256 * <code> 2257 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2258 * </code> 2259 */ 2260 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder addEntriesBuilder(int index)2261 addEntriesBuilder(int index) { 2262 return getEntriesFieldBuilder() 2263 .addBuilder( 2264 index, 2265 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry 2266 .getDefaultInstance()); 2267 } 2268 /** 2269 * 2270 * 2271 * <pre> 2272 * A list of the confusion matrix entries. One entry for each possible 2273 * predicted label. 2274 * </pre> 2275 * 2276 * <code> 2277 * repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry entries = 2; 2278 * </code> 2279 */ 2280 public java.util.List< 2281 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder> getEntriesBuilderList()2282 getEntriesBuilderList() { 2283 return getEntriesFieldBuilder().getBuilderList(); 2284 } 2285 2286 private com.google.protobuf.RepeatedFieldBuilderV3< 2287 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry, 2288 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.Builder, 2289 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntryOrBuilder> getEntriesFieldBuilder()2290 getEntriesFieldBuilder() { 2291 if (entriesBuilder_ == null) { 2292 entriesBuilder_ = 2293 new com.google.protobuf.RepeatedFieldBuilderV3< 2294 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry, 2295 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry 2296 .Builder, 2297 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix 2298 .ConfusionMatrixEntryOrBuilder>( 2299 entries_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); 2300 entries_ = null; 2301 } 2302 return entriesBuilder_; 2303 } 2304 2305 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2306 public final Builder setUnknownFields( 2307 final com.google.protobuf.UnknownFieldSet unknownFields) { 2308 return super.setUnknownFields(unknownFields); 2309 } 2310 2311 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2312 public final Builder mergeUnknownFields( 2313 final com.google.protobuf.UnknownFieldSet unknownFields) { 2314 return super.mergeUnknownFields(unknownFields); 2315 } 2316 2317 // @@protoc_insertion_point(builder_scope:google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) 2318 } 2319 2320 // @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) 2321 private static final com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row DEFAULT_INSTANCE; 2322 2323 static { 2324 DEFAULT_INSTANCE = new com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row(); 2325 } 2326 getDefaultInstance()2327 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row getDefaultInstance() { 2328 return DEFAULT_INSTANCE; 2329 } 2330 2331 private static final com.google.protobuf.Parser<Row> PARSER = 2332 new com.google.protobuf.AbstractParser<Row>() { 2333 @java.lang.Override 2334 public Row parsePartialFrom( 2335 com.google.protobuf.CodedInputStream input, 2336 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2337 throws com.google.protobuf.InvalidProtocolBufferException { 2338 Builder builder = newBuilder(); 2339 try { 2340 builder.mergeFrom(input, extensionRegistry); 2341 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2342 throw e.setUnfinishedMessage(builder.buildPartial()); 2343 } catch (com.google.protobuf.UninitializedMessageException e) { 2344 throw e.asInvalidProtocolBufferException() 2345 .setUnfinishedMessage(builder.buildPartial()); 2346 } catch (java.io.IOException e) { 2347 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2348 .setUnfinishedMessage(builder.buildPartial()); 2349 } 2350 return builder.buildPartial(); 2351 } 2352 }; 2353 parser()2354 public static com.google.protobuf.Parser<Row> parser() { 2355 return PARSER; 2356 } 2357 2358 @java.lang.Override getParserForType()2359 public com.google.protobuf.Parser<Row> getParserForType() { 2360 return PARSER; 2361 } 2362 2363 @java.lang.Override getDefaultInstanceForType()2364 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row getDefaultInstanceForType() { 2365 return DEFAULT_INSTANCE; 2366 } 2367 } 2368 2369 public static final int ROW_FIELD_NUMBER = 1; 2370 2371 @SuppressWarnings("serial") 2372 private java.util.List<com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row> row_; 2373 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ 2374 @java.lang.Override getRowList()2375 public java.util.List<com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row> getRowList() { 2376 return row_; 2377 } 2378 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ 2379 @java.lang.Override 2380 public java.util.List< 2381 ? extends com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.RowOrBuilder> getRowOrBuilderList()2382 getRowOrBuilderList() { 2383 return row_; 2384 } 2385 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ 2386 @java.lang.Override getRowCount()2387 public int getRowCount() { 2388 return row_.size(); 2389 } 2390 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ 2391 @java.lang.Override getRow(int index)2392 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row getRow(int index) { 2393 return row_.get(index); 2394 } 2395 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ 2396 @java.lang.Override getRowOrBuilder( int index)2397 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.RowOrBuilder getRowOrBuilder( 2398 int index) { 2399 return row_.get(index); 2400 } 2401 2402 private byte memoizedIsInitialized = -1; 2403 2404 @java.lang.Override isInitialized()2405 public final boolean isInitialized() { 2406 byte isInitialized = memoizedIsInitialized; 2407 if (isInitialized == 1) return true; 2408 if (isInitialized == 0) return false; 2409 2410 memoizedIsInitialized = 1; 2411 return true; 2412 } 2413 2414 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)2415 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 2416 for (int i = 0; i < row_.size(); i++) { 2417 output.writeMessage(1, row_.get(i)); 2418 } 2419 getUnknownFields().writeTo(output); 2420 } 2421 2422 @java.lang.Override getSerializedSize()2423 public int getSerializedSize() { 2424 int size = memoizedSize; 2425 if (size != -1) return size; 2426 2427 size = 0; 2428 for (int i = 0; i < row_.size(); i++) { 2429 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, row_.get(i)); 2430 } 2431 size += getUnknownFields().getSerializedSize(); 2432 memoizedSize = size; 2433 return size; 2434 } 2435 2436 @java.lang.Override equals(final java.lang.Object obj)2437 public boolean equals(final java.lang.Object obj) { 2438 if (obj == this) { 2439 return true; 2440 } 2441 if (!(obj instanceof com.google.cloud.datalabeling.v1beta1.ConfusionMatrix)) { 2442 return super.equals(obj); 2443 } 2444 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix other = 2445 (com.google.cloud.datalabeling.v1beta1.ConfusionMatrix) obj; 2446 2447 if (!getRowList().equals(other.getRowList())) return false; 2448 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 2449 return true; 2450 } 2451 2452 @java.lang.Override hashCode()2453 public int hashCode() { 2454 if (memoizedHashCode != 0) { 2455 return memoizedHashCode; 2456 } 2457 int hash = 41; 2458 hash = (19 * hash) + getDescriptor().hashCode(); 2459 if (getRowCount() > 0) { 2460 hash = (37 * hash) + ROW_FIELD_NUMBER; 2461 hash = (53 * hash) + getRowList().hashCode(); 2462 } 2463 hash = (29 * hash) + getUnknownFields().hashCode(); 2464 memoizedHashCode = hash; 2465 return hash; 2466 } 2467 parseFrom( java.nio.ByteBuffer data)2468 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom( 2469 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 2470 return PARSER.parseFrom(data); 2471 } 2472 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2473 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom( 2474 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2475 throws com.google.protobuf.InvalidProtocolBufferException { 2476 return PARSER.parseFrom(data, extensionRegistry); 2477 } 2478 parseFrom( com.google.protobuf.ByteString data)2479 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom( 2480 com.google.protobuf.ByteString data) 2481 throws com.google.protobuf.InvalidProtocolBufferException { 2482 return PARSER.parseFrom(data); 2483 } 2484 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2485 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom( 2486 com.google.protobuf.ByteString data, 2487 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2488 throws com.google.protobuf.InvalidProtocolBufferException { 2489 return PARSER.parseFrom(data, extensionRegistry); 2490 } 2491 parseFrom(byte[] data)2492 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom(byte[] data) 2493 throws com.google.protobuf.InvalidProtocolBufferException { 2494 return PARSER.parseFrom(data); 2495 } 2496 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2497 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom( 2498 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2499 throws com.google.protobuf.InvalidProtocolBufferException { 2500 return PARSER.parseFrom(data, extensionRegistry); 2501 } 2502 parseFrom( java.io.InputStream input)2503 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom( 2504 java.io.InputStream input) throws java.io.IOException { 2505 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 2506 } 2507 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2508 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom( 2509 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2510 throws java.io.IOException { 2511 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 2512 PARSER, input, extensionRegistry); 2513 } 2514 parseDelimitedFrom( java.io.InputStream input)2515 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseDelimitedFrom( 2516 java.io.InputStream input) throws java.io.IOException { 2517 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 2518 } 2519 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2520 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseDelimitedFrom( 2521 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2522 throws java.io.IOException { 2523 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 2524 PARSER, input, extensionRegistry); 2525 } 2526 parseFrom( com.google.protobuf.CodedInputStream input)2527 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom( 2528 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 2529 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 2530 } 2531 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2532 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix parseFrom( 2533 com.google.protobuf.CodedInputStream input, 2534 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2535 throws java.io.IOException { 2536 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 2537 PARSER, input, extensionRegistry); 2538 } 2539 2540 @java.lang.Override newBuilderForType()2541 public Builder newBuilderForType() { 2542 return newBuilder(); 2543 } 2544 newBuilder()2545 public static Builder newBuilder() { 2546 return DEFAULT_INSTANCE.toBuilder(); 2547 } 2548 newBuilder( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix prototype)2549 public static Builder newBuilder( 2550 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix prototype) { 2551 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 2552 } 2553 2554 @java.lang.Override toBuilder()2555 public Builder toBuilder() { 2556 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 2557 } 2558 2559 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2560 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 2561 Builder builder = new Builder(parent); 2562 return builder; 2563 } 2564 /** 2565 * 2566 * 2567 * <pre> 2568 * Confusion matrix of the model running the classification. Only applicable 2569 * when the metrics entry aggregates multiple labels. Not applicable when the 2570 * entry is for a single label. 2571 * </pre> 2572 * 2573 * Protobuf type {@code google.cloud.datalabeling.v1beta1.ConfusionMatrix} 2574 */ 2575 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 2576 implements 2577 // @@protoc_insertion_point(builder_implements:google.cloud.datalabeling.v1beta1.ConfusionMatrix) 2578 com.google.cloud.datalabeling.v1beta1.ConfusionMatrixOrBuilder { getDescriptor()2579 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 2580 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 2581 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_descriptor; 2582 } 2583 2584 @java.lang.Override 2585 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()2586 internalGetFieldAccessorTable() { 2587 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 2588 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_fieldAccessorTable 2589 .ensureFieldAccessorsInitialized( 2590 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.class, 2591 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Builder.class); 2592 } 2593 2594 // Construct using com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.newBuilder() Builder()2595 private Builder() {} 2596 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2597 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 2598 super(parent); 2599 } 2600 2601 @java.lang.Override clear()2602 public Builder clear() { 2603 super.clear(); 2604 bitField0_ = 0; 2605 if (rowBuilder_ == null) { 2606 row_ = java.util.Collections.emptyList(); 2607 } else { 2608 row_ = null; 2609 rowBuilder_.clear(); 2610 } 2611 bitField0_ = (bitField0_ & ~0x00000001); 2612 return this; 2613 } 2614 2615 @java.lang.Override getDescriptorForType()2616 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 2617 return com.google.cloud.datalabeling.v1beta1.EvaluationOuterClass 2618 .internal_static_google_cloud_datalabeling_v1beta1_ConfusionMatrix_descriptor; 2619 } 2620 2621 @java.lang.Override getDefaultInstanceForType()2622 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix getDefaultInstanceForType() { 2623 return com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.getDefaultInstance(); 2624 } 2625 2626 @java.lang.Override build()2627 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix build() { 2628 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix result = buildPartial(); 2629 if (!result.isInitialized()) { 2630 throw newUninitializedMessageException(result); 2631 } 2632 return result; 2633 } 2634 2635 @java.lang.Override buildPartial()2636 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix buildPartial() { 2637 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix result = 2638 new com.google.cloud.datalabeling.v1beta1.ConfusionMatrix(this); 2639 buildPartialRepeatedFields(result); 2640 if (bitField0_ != 0) { 2641 buildPartial0(result); 2642 } 2643 onBuilt(); 2644 return result; 2645 } 2646 buildPartialRepeatedFields( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix result)2647 private void buildPartialRepeatedFields( 2648 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix result) { 2649 if (rowBuilder_ == null) { 2650 if (((bitField0_ & 0x00000001) != 0)) { 2651 row_ = java.util.Collections.unmodifiableList(row_); 2652 bitField0_ = (bitField0_ & ~0x00000001); 2653 } 2654 result.row_ = row_; 2655 } else { 2656 result.row_ = rowBuilder_.build(); 2657 } 2658 } 2659 buildPartial0(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix result)2660 private void buildPartial0(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix result) { 2661 int from_bitField0_ = bitField0_; 2662 } 2663 2664 @java.lang.Override clone()2665 public Builder clone() { 2666 return super.clone(); 2667 } 2668 2669 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2670 public Builder setField( 2671 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2672 return super.setField(field, value); 2673 } 2674 2675 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2676 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 2677 return super.clearField(field); 2678 } 2679 2680 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2681 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 2682 return super.clearOneof(oneof); 2683 } 2684 2685 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2686 public Builder setRepeatedField( 2687 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 2688 return super.setRepeatedField(field, index, value); 2689 } 2690 2691 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2692 public Builder addRepeatedField( 2693 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2694 return super.addRepeatedField(field, value); 2695 } 2696 2697 @java.lang.Override mergeFrom(com.google.protobuf.Message other)2698 public Builder mergeFrom(com.google.protobuf.Message other) { 2699 if (other instanceof com.google.cloud.datalabeling.v1beta1.ConfusionMatrix) { 2700 return mergeFrom((com.google.cloud.datalabeling.v1beta1.ConfusionMatrix) other); 2701 } else { 2702 super.mergeFrom(other); 2703 return this; 2704 } 2705 } 2706 mergeFrom(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix other)2707 public Builder mergeFrom(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix other) { 2708 if (other == com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.getDefaultInstance()) 2709 return this; 2710 if (rowBuilder_ == null) { 2711 if (!other.row_.isEmpty()) { 2712 if (row_.isEmpty()) { 2713 row_ = other.row_; 2714 bitField0_ = (bitField0_ & ~0x00000001); 2715 } else { 2716 ensureRowIsMutable(); 2717 row_.addAll(other.row_); 2718 } 2719 onChanged(); 2720 } 2721 } else { 2722 if (!other.row_.isEmpty()) { 2723 if (rowBuilder_.isEmpty()) { 2724 rowBuilder_.dispose(); 2725 rowBuilder_ = null; 2726 row_ = other.row_; 2727 bitField0_ = (bitField0_ & ~0x00000001); 2728 rowBuilder_ = 2729 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 2730 ? getRowFieldBuilder() 2731 : null; 2732 } else { 2733 rowBuilder_.addAllMessages(other.row_); 2734 } 2735 } 2736 } 2737 this.mergeUnknownFields(other.getUnknownFields()); 2738 onChanged(); 2739 return this; 2740 } 2741 2742 @java.lang.Override isInitialized()2743 public final boolean isInitialized() { 2744 return true; 2745 } 2746 2747 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2748 public Builder mergeFrom( 2749 com.google.protobuf.CodedInputStream input, 2750 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2751 throws java.io.IOException { 2752 if (extensionRegistry == null) { 2753 throw new java.lang.NullPointerException(); 2754 } 2755 try { 2756 boolean done = false; 2757 while (!done) { 2758 int tag = input.readTag(); 2759 switch (tag) { 2760 case 0: 2761 done = true; 2762 break; 2763 case 10: 2764 { 2765 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row m = 2766 input.readMessage( 2767 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.parser(), 2768 extensionRegistry); 2769 if (rowBuilder_ == null) { 2770 ensureRowIsMutable(); 2771 row_.add(m); 2772 } else { 2773 rowBuilder_.addMessage(m); 2774 } 2775 break; 2776 } // case 10 2777 default: 2778 { 2779 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 2780 done = true; // was an endgroup tag 2781 } 2782 break; 2783 } // default: 2784 } // switch (tag) 2785 } // while (!done) 2786 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2787 throw e.unwrapIOException(); 2788 } finally { 2789 onChanged(); 2790 } // finally 2791 return this; 2792 } 2793 2794 private int bitField0_; 2795 2796 private java.util.List<com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row> row_ = 2797 java.util.Collections.emptyList(); 2798 ensureRowIsMutable()2799 private void ensureRowIsMutable() { 2800 if (!((bitField0_ & 0x00000001) != 0)) { 2801 row_ = 2802 new java.util.ArrayList<com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row>( 2803 row_); 2804 bitField0_ |= 0x00000001; 2805 } 2806 } 2807 2808 private com.google.protobuf.RepeatedFieldBuilderV3< 2809 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row, 2810 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder, 2811 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.RowOrBuilder> 2812 rowBuilder_; 2813 2814 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ getRowList()2815 public java.util.List<com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row> getRowList() { 2816 if (rowBuilder_ == null) { 2817 return java.util.Collections.unmodifiableList(row_); 2818 } else { 2819 return rowBuilder_.getMessageList(); 2820 } 2821 } 2822 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ getRowCount()2823 public int getRowCount() { 2824 if (rowBuilder_ == null) { 2825 return row_.size(); 2826 } else { 2827 return rowBuilder_.getCount(); 2828 } 2829 } 2830 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ getRow(int index)2831 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row getRow(int index) { 2832 if (rowBuilder_ == null) { 2833 return row_.get(index); 2834 } else { 2835 return rowBuilder_.getMessage(index); 2836 } 2837 } 2838 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ setRow( int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row value)2839 public Builder setRow( 2840 int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row value) { 2841 if (rowBuilder_ == null) { 2842 if (value == null) { 2843 throw new NullPointerException(); 2844 } 2845 ensureRowIsMutable(); 2846 row_.set(index, value); 2847 onChanged(); 2848 } else { 2849 rowBuilder_.setMessage(index, value); 2850 } 2851 return this; 2852 } 2853 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ setRow( int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder builderForValue)2854 public Builder setRow( 2855 int index, 2856 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder builderForValue) { 2857 if (rowBuilder_ == null) { 2858 ensureRowIsMutable(); 2859 row_.set(index, builderForValue.build()); 2860 onChanged(); 2861 } else { 2862 rowBuilder_.setMessage(index, builderForValue.build()); 2863 } 2864 return this; 2865 } 2866 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ addRow(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row value)2867 public Builder addRow(com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row value) { 2868 if (rowBuilder_ == null) { 2869 if (value == null) { 2870 throw new NullPointerException(); 2871 } 2872 ensureRowIsMutable(); 2873 row_.add(value); 2874 onChanged(); 2875 } else { 2876 rowBuilder_.addMessage(value); 2877 } 2878 return this; 2879 } 2880 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ addRow( int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row value)2881 public Builder addRow( 2882 int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row value) { 2883 if (rowBuilder_ == null) { 2884 if (value == null) { 2885 throw new NullPointerException(); 2886 } 2887 ensureRowIsMutable(); 2888 row_.add(index, value); 2889 onChanged(); 2890 } else { 2891 rowBuilder_.addMessage(index, value); 2892 } 2893 return this; 2894 } 2895 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ addRow( com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder builderForValue)2896 public Builder addRow( 2897 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder builderForValue) { 2898 if (rowBuilder_ == null) { 2899 ensureRowIsMutable(); 2900 row_.add(builderForValue.build()); 2901 onChanged(); 2902 } else { 2903 rowBuilder_.addMessage(builderForValue.build()); 2904 } 2905 return this; 2906 } 2907 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ addRow( int index, com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder builderForValue)2908 public Builder addRow( 2909 int index, 2910 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder builderForValue) { 2911 if (rowBuilder_ == null) { 2912 ensureRowIsMutable(); 2913 row_.add(index, builderForValue.build()); 2914 onChanged(); 2915 } else { 2916 rowBuilder_.addMessage(index, builderForValue.build()); 2917 } 2918 return this; 2919 } 2920 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ addAllRow( java.lang.Iterable<? extends com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row> values)2921 public Builder addAllRow( 2922 java.lang.Iterable<? extends com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row> 2923 values) { 2924 if (rowBuilder_ == null) { 2925 ensureRowIsMutable(); 2926 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, row_); 2927 onChanged(); 2928 } else { 2929 rowBuilder_.addAllMessages(values); 2930 } 2931 return this; 2932 } 2933 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ clearRow()2934 public Builder clearRow() { 2935 if (rowBuilder_ == null) { 2936 row_ = java.util.Collections.emptyList(); 2937 bitField0_ = (bitField0_ & ~0x00000001); 2938 onChanged(); 2939 } else { 2940 rowBuilder_.clear(); 2941 } 2942 return this; 2943 } 2944 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ removeRow(int index)2945 public Builder removeRow(int index) { 2946 if (rowBuilder_ == null) { 2947 ensureRowIsMutable(); 2948 row_.remove(index); 2949 onChanged(); 2950 } else { 2951 rowBuilder_.remove(index); 2952 } 2953 return this; 2954 } 2955 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ getRowBuilder( int index)2956 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder getRowBuilder( 2957 int index) { 2958 return getRowFieldBuilder().getBuilder(index); 2959 } 2960 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ getRowOrBuilder( int index)2961 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.RowOrBuilder getRowOrBuilder( 2962 int index) { 2963 if (rowBuilder_ == null) { 2964 return row_.get(index); 2965 } else { 2966 return rowBuilder_.getMessageOrBuilder(index); 2967 } 2968 } 2969 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ 2970 public java.util.List< 2971 ? extends com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.RowOrBuilder> getRowOrBuilderList()2972 getRowOrBuilderList() { 2973 if (rowBuilder_ != null) { 2974 return rowBuilder_.getMessageOrBuilderList(); 2975 } else { 2976 return java.util.Collections.unmodifiableList(row_); 2977 } 2978 } 2979 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ addRowBuilder()2980 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder addRowBuilder() { 2981 return getRowFieldBuilder() 2982 .addBuilder( 2983 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.getDefaultInstance()); 2984 } 2985 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ addRowBuilder( int index)2986 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder addRowBuilder( 2987 int index) { 2988 return getRowFieldBuilder() 2989 .addBuilder( 2990 index, 2991 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.getDefaultInstance()); 2992 } 2993 /** <code>repeated .google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row row = 1;</code> */ 2994 public java.util.List<com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder> getRowBuilderList()2995 getRowBuilderList() { 2996 return getRowFieldBuilder().getBuilderList(); 2997 } 2998 2999 private com.google.protobuf.RepeatedFieldBuilderV3< 3000 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row, 3001 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder, 3002 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.RowOrBuilder> getRowFieldBuilder()3003 getRowFieldBuilder() { 3004 if (rowBuilder_ == null) { 3005 rowBuilder_ = 3006 new com.google.protobuf.RepeatedFieldBuilderV3< 3007 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row, 3008 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.Builder, 3009 com.google.cloud.datalabeling.v1beta1.ConfusionMatrix.RowOrBuilder>( 3010 row_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); 3011 row_ = null; 3012 } 3013 return rowBuilder_; 3014 } 3015 3016 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)3017 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 3018 return super.setUnknownFields(unknownFields); 3019 } 3020 3021 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3022 public final Builder mergeUnknownFields( 3023 final com.google.protobuf.UnknownFieldSet unknownFields) { 3024 return super.mergeUnknownFields(unknownFields); 3025 } 3026 3027 // @@protoc_insertion_point(builder_scope:google.cloud.datalabeling.v1beta1.ConfusionMatrix) 3028 } 3029 3030 // @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ConfusionMatrix) 3031 private static final com.google.cloud.datalabeling.v1beta1.ConfusionMatrix DEFAULT_INSTANCE; 3032 3033 static { 3034 DEFAULT_INSTANCE = new com.google.cloud.datalabeling.v1beta1.ConfusionMatrix(); 3035 } 3036 getDefaultInstance()3037 public static com.google.cloud.datalabeling.v1beta1.ConfusionMatrix getDefaultInstance() { 3038 return DEFAULT_INSTANCE; 3039 } 3040 3041 private static final com.google.protobuf.Parser<ConfusionMatrix> PARSER = 3042 new com.google.protobuf.AbstractParser<ConfusionMatrix>() { 3043 @java.lang.Override 3044 public ConfusionMatrix parsePartialFrom( 3045 com.google.protobuf.CodedInputStream input, 3046 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3047 throws com.google.protobuf.InvalidProtocolBufferException { 3048 Builder builder = newBuilder(); 3049 try { 3050 builder.mergeFrom(input, extensionRegistry); 3051 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 3052 throw e.setUnfinishedMessage(builder.buildPartial()); 3053 } catch (com.google.protobuf.UninitializedMessageException e) { 3054 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 3055 } catch (java.io.IOException e) { 3056 throw new com.google.protobuf.InvalidProtocolBufferException(e) 3057 .setUnfinishedMessage(builder.buildPartial()); 3058 } 3059 return builder.buildPartial(); 3060 } 3061 }; 3062 parser()3063 public static com.google.protobuf.Parser<ConfusionMatrix> parser() { 3064 return PARSER; 3065 } 3066 3067 @java.lang.Override getParserForType()3068 public com.google.protobuf.Parser<ConfusionMatrix> getParserForType() { 3069 return PARSER; 3070 } 3071 3072 @java.lang.Override getDefaultInstanceForType()3073 public com.google.cloud.datalabeling.v1beta1.ConfusionMatrix getDefaultInstanceForType() { 3074 return DEFAULT_INSTANCE; 3075 } 3076 } 3077