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