@@ -53,59 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
53
53
return this .unknownFields ;
54
54
}
55
55
56
- private AddProductToProductSetRequest (
57
- com .google .protobuf .CodedInputStream input ,
58
- com .google .protobuf .ExtensionRegistryLite extensionRegistry )
59
- throws com .google .protobuf .InvalidProtocolBufferException {
60
- this ();
61
- if (extensionRegistry == null ) {
62
- throw new java .lang .NullPointerException ();
63
- }
64
- com .google .protobuf .UnknownFieldSet .Builder unknownFields =
65
- com .google .protobuf .UnknownFieldSet .newBuilder ();
66
- try {
67
- boolean done = false ;
68
- while (!done ) {
69
- int tag = input .readTag ();
70
- switch (tag ) {
71
- case 0 :
72
- done = true ;
73
- break ;
74
- case 10 :
75
- {
76
- java .lang .String s = input .readStringRequireUtf8 ();
77
-
78
- name_ = s ;
79
- break ;
80
- }
81
- case 18 :
82
- {
83
- java .lang .String s = input .readStringRequireUtf8 ();
84
-
85
- product_ = s ;
86
- break ;
87
- }
88
- default :
89
- {
90
- if (!parseUnknownField (input , unknownFields , extensionRegistry , tag )) {
91
- done = true ;
92
- }
93
- break ;
94
- }
95
- }
96
- }
97
- } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
98
- throw e .setUnfinishedMessage (this );
99
- } catch (com .google .protobuf .UninitializedMessageException e ) {
100
- throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (this );
101
- } catch (java .io .IOException e ) {
102
- throw new com .google .protobuf .InvalidProtocolBufferException (e ).setUnfinishedMessage (this );
103
- } finally {
104
- this .unknownFields = unknownFields .build ();
105
- makeExtensionsImmutable ();
106
- }
107
- }
108
-
109
56
public static final com .google .protobuf .Descriptors .Descriptor getDescriptor () {
110
57
return com .google .cloud .vision .v1 .ProductSearchServiceProto
111
58
.internal_static_google_cloud_vision_v1_AddProductToProductSetRequest_descriptor ;
@@ -255,7 +202,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
255
202
if (!com .google .protobuf .GeneratedMessageV3 .isStringEmpty (product_ )) {
256
203
com .google .protobuf .GeneratedMessageV3 .writeString (output , 2 , product_ );
257
204
}
258
- unknownFields .writeTo (output );
205
+ getUnknownFields () .writeTo (output );
259
206
}
260
207
261
208
@ java .lang .Override
@@ -270,7 +217,7 @@ public int getSerializedSize() {
270
217
if (!com .google .protobuf .GeneratedMessageV3 .isStringEmpty (product_ )) {
271
218
size += com .google .protobuf .GeneratedMessageV3 .computeStringSize (2 , product_ );
272
219
}
273
- size += unknownFields .getSerializedSize ();
220
+ size += getUnknownFields () .getSerializedSize ();
274
221
memoizedSize = size ;
275
222
return size ;
276
223
}
@@ -288,7 +235,7 @@ public boolean equals(final java.lang.Object obj) {
288
235
289
236
if (!getName ().equals (other .getName ())) return false ;
290
237
if (!getProduct ().equals (other .getProduct ())) return false ;
291
- if (!unknownFields .equals (other .unknownFields )) return false ;
238
+ if (!getUnknownFields () .equals (other .getUnknownFields () )) return false ;
292
239
return true ;
293
240
}
294
241
@@ -303,7 +250,7 @@ public int hashCode() {
303
250
hash = (53 * hash ) + getName ().hashCode ();
304
251
hash = (37 * hash ) + PRODUCT_FIELD_NUMBER ;
305
252
hash = (53 * hash ) + getProduct ().hashCode ();
306
- hash = (29 * hash ) + unknownFields .hashCode ();
253
+ hash = (29 * hash ) + getUnknownFields () .hashCode ();
307
254
memoizedHashCode = hash ;
308
255
return hash ;
309
256
}
@@ -433,17 +380,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
433
380
}
434
381
435
382
// Construct using com.google.cloud.vision.v1.AddProductToProductSetRequest.newBuilder()
436
- private Builder () {
437
- maybeForceBuilderInitialization ();
438
- }
383
+ private Builder () {}
439
384
440
385
private Builder (com .google .protobuf .GeneratedMessageV3 .BuilderParent parent ) {
441
386
super (parent );
442
- maybeForceBuilderInitialization ();
443
- }
444
-
445
- private void maybeForceBuilderInitialization () {
446
- if (com .google .protobuf .GeneratedMessageV3 .alwaysUseFieldBuilders ) {}
447
387
}
448
388
449
389
@ java .lang .Override
@@ -540,7 +480,7 @@ public Builder mergeFrom(com.google.cloud.vision.v1.AddProductToProductSetReques
540
480
product_ = other .product_ ;
541
481
onChanged ();
542
482
}
543
- this .mergeUnknownFields (other .unknownFields );
483
+ this .mergeUnknownFields (other .getUnknownFields () );
544
484
onChanged ();
545
485
return this ;
546
486
}
@@ -555,18 +495,43 @@ public Builder mergeFrom(
555
495
com .google .protobuf .CodedInputStream input ,
556
496
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
557
497
throws java .io .IOException {
558
- com .google .cloud .vision .v1 .AddProductToProductSetRequest parsedMessage = null ;
498
+ if (extensionRegistry == null ) {
499
+ throw new java .lang .NullPointerException ();
500
+ }
559
501
try {
560
- parsedMessage = PARSER .parsePartialFrom (input , extensionRegistry );
502
+ boolean done = false ;
503
+ while (!done ) {
504
+ int tag = input .readTag ();
505
+ switch (tag ) {
506
+ case 0 :
507
+ done = true ;
508
+ break ;
509
+ case 10 :
510
+ {
511
+ name_ = input .readStringRequireUtf8 ();
512
+
513
+ break ;
514
+ } // case 10
515
+ case 18 :
516
+ {
517
+ product_ = input .readStringRequireUtf8 ();
518
+
519
+ break ;
520
+ } // case 18
521
+ default :
522
+ {
523
+ if (!super .parseUnknownField (input , extensionRegistry , tag )) {
524
+ done = true ; // was an endgroup tag
525
+ }
526
+ break ;
527
+ } // default:
528
+ } // switch (tag)
529
+ } // while (!done)
561
530
} catch (com .google .protobuf .InvalidProtocolBufferException e ) {
562
- parsedMessage =
563
- (com .google .cloud .vision .v1 .AddProductToProductSetRequest ) e .getUnfinishedMessage ();
564
531
throw e .unwrapIOException ();
565
532
} finally {
566
- if (parsedMessage != null ) {
567
- mergeFrom (parsedMessage );
568
- }
569
- }
533
+ onChanged ();
534
+ } // finally
570
535
return this ;
571
536
}
572
537
@@ -854,7 +819,18 @@ public AddProductToProductSetRequest parsePartialFrom(
854
819
com .google .protobuf .CodedInputStream input ,
855
820
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
856
821
throws com .google .protobuf .InvalidProtocolBufferException {
857
- return new AddProductToProductSetRequest (input , extensionRegistry );
822
+ Builder builder = newBuilder ();
823
+ try {
824
+ builder .mergeFrom (input , extensionRegistry );
825
+ } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
826
+ throw e .setUnfinishedMessage (builder .buildPartial ());
827
+ } catch (com .google .protobuf .UninitializedMessageException e ) {
828
+ throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (builder .buildPartial ());
829
+ } catch (java .io .IOException e ) {
830
+ throw new com .google .protobuf .InvalidProtocolBufferException (e )
831
+ .setUnfinishedMessage (builder .buildPartial ());
832
+ }
833
+ return builder .buildPartial ();
858
834
}
859
835
};
860
836
0 commit comments