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