@@ -54,66 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
54
54
return this .unknownFields ;
55
55
}
56
56
57
- private Barcode (
58
- com .google .protobuf .CodedInputStream input ,
59
- com .google .protobuf .ExtensionRegistryLite extensionRegistry )
60
- throws com .google .protobuf .InvalidProtocolBufferException {
61
- this ();
62
- if (extensionRegistry == null ) {
63
- throw new java .lang .NullPointerException ();
64
- }
65
- com .google .protobuf .UnknownFieldSet .Builder unknownFields =
66
- com .google .protobuf .UnknownFieldSet .newBuilder ();
67
- try {
68
- boolean done = false ;
69
- while (!done ) {
70
- int tag = input .readTag ();
71
- switch (tag ) {
72
- case 0 :
73
- done = true ;
74
- break ;
75
- case 10 :
76
- {
77
- java .lang .String s = input .readStringRequireUtf8 ();
78
-
79
- format_ = s ;
80
- break ;
81
- }
82
- case 18 :
83
- {
84
- java .lang .String s = input .readStringRequireUtf8 ();
85
-
86
- valueFormat_ = s ;
87
- break ;
88
- }
89
- case 26 :
90
- {
91
- java .lang .String s = input .readStringRequireUtf8 ();
92
-
93
- rawValue_ = s ;
94
- break ;
95
- }
96
- default :
97
- {
98
- if (!parseUnknownField (input , unknownFields , extensionRegistry , tag )) {
99
- done = true ;
100
- }
101
- break ;
102
- }
103
- }
104
- }
105
- } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
106
- throw e .setUnfinishedMessage (this );
107
- } catch (com .google .protobuf .UninitializedMessageException e ) {
108
- throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (this );
109
- } catch (java .io .IOException e ) {
110
- throw new com .google .protobuf .InvalidProtocolBufferException (e ).setUnfinishedMessage (this );
111
- } finally {
112
- this .unknownFields = unknownFields .build ();
113
- makeExtensionsImmutable ();
114
- }
115
- }
116
-
117
57
public static final com .google .protobuf .Descriptors .Descriptor getDescriptor () {
118
58
return com .google .cloud .documentai .v1 .BarcodeProto
119
59
.internal_static_google_cloud_documentai_v1_Barcode_descriptor ;
@@ -359,7 +299,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
359
299
if (!com .google .protobuf .GeneratedMessageV3 .isStringEmpty (rawValue_ )) {
360
300
com .google .protobuf .GeneratedMessageV3 .writeString (output , 3 , rawValue_ );
361
301
}
362
- unknownFields .writeTo (output );
302
+ getUnknownFields () .writeTo (output );
363
303
}
364
304
365
305
@ java .lang .Override
@@ -377,7 +317,7 @@ public int getSerializedSize() {
377
317
if (!com .google .protobuf .GeneratedMessageV3 .isStringEmpty (rawValue_ )) {
378
318
size += com .google .protobuf .GeneratedMessageV3 .computeStringSize (3 , rawValue_ );
379
319
}
380
- size += unknownFields .getSerializedSize ();
320
+ size += getUnknownFields () .getSerializedSize ();
381
321
memoizedSize = size ;
382
322
return size ;
383
323
}
@@ -395,7 +335,7 @@ public boolean equals(final java.lang.Object obj) {
395
335
if (!getFormat ().equals (other .getFormat ())) return false ;
396
336
if (!getValueFormat ().equals (other .getValueFormat ())) return false ;
397
337
if (!getRawValue ().equals (other .getRawValue ())) return false ;
398
- if (!unknownFields .equals (other .unknownFields )) return false ;
338
+ if (!getUnknownFields () .equals (other .getUnknownFields () )) return false ;
399
339
return true ;
400
340
}
401
341
@@ -412,7 +352,7 @@ public int hashCode() {
412
352
hash = (53 * hash ) + getValueFormat ().hashCode ();
413
353
hash = (37 * hash ) + RAW_VALUE_FIELD_NUMBER ;
414
354
hash = (53 * hash ) + getRawValue ().hashCode ();
415
- hash = (29 * hash ) + unknownFields .hashCode ();
355
+ hash = (29 * hash ) + getUnknownFields () .hashCode ();
416
356
memoizedHashCode = hash ;
417
357
return hash ;
418
358
}
@@ -541,17 +481,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
541
481
}
542
482
543
483
// Construct using com.google.cloud.documentai.v1.Barcode.newBuilder()
544
- private Builder () {
545
- maybeForceBuilderInitialization ();
546
- }
484
+ private Builder () {}
547
485
548
486
private Builder (com .google .protobuf .GeneratedMessageV3 .BuilderParent parent ) {
549
487
super (parent );
550
- maybeForceBuilderInitialization ();
551
- }
552
-
553
- private void maybeForceBuilderInitialization () {
554
- if (com .google .protobuf .GeneratedMessageV3 .alwaysUseFieldBuilders ) {}
555
488
}
556
489
557
490
@ java .lang .Override
@@ -654,7 +587,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.Barcode other) {
654
587
rawValue_ = other .rawValue_ ;
655
588
onChanged ();
656
589
}
657
- this .mergeUnknownFields (other .unknownFields );
590
+ this .mergeUnknownFields (other .getUnknownFields () );
658
591
onChanged ();
659
592
return this ;
660
593
}
@@ -669,17 +602,49 @@ public Builder mergeFrom(
669
602
com .google .protobuf .CodedInputStream input ,
670
603
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
671
604
throws java .io .IOException {
672
- com .google .cloud .documentai .v1 .Barcode parsedMessage = null ;
605
+ if (extensionRegistry == null ) {
606
+ throw new java .lang .NullPointerException ();
607
+ }
673
608
try {
674
- parsedMessage = PARSER .parsePartialFrom (input , extensionRegistry );
609
+ boolean done = false ;
610
+ while (!done ) {
611
+ int tag = input .readTag ();
612
+ switch (tag ) {
613
+ case 0 :
614
+ done = true ;
615
+ break ;
616
+ case 10 :
617
+ {
618
+ format_ = input .readStringRequireUtf8 ();
619
+
620
+ break ;
621
+ } // case 10
622
+ case 18 :
623
+ {
624
+ valueFormat_ = input .readStringRequireUtf8 ();
625
+
626
+ break ;
627
+ } // case 18
628
+ case 26 :
629
+ {
630
+ rawValue_ = input .readStringRequireUtf8 ();
631
+
632
+ break ;
633
+ } // case 26
634
+ default :
635
+ {
636
+ if (!super .parseUnknownField (input , extensionRegistry , tag )) {
637
+ done = true ; // was an endgroup tag
638
+ }
639
+ break ;
640
+ } // default:
641
+ } // switch (tag)
642
+ } // while (!done)
675
643
} catch (com .google .protobuf .InvalidProtocolBufferException e ) {
676
- parsedMessage = (com .google .cloud .documentai .v1 .Barcode ) e .getUnfinishedMessage ();
677
644
throw e .unwrapIOException ();
678
645
} finally {
679
- if (parsedMessage != null ) {
680
- mergeFrom (parsedMessage );
681
- }
682
- }
646
+ onChanged ();
647
+ } // finally
683
648
return this ;
684
649
}
685
650
@@ -1183,7 +1148,18 @@ public Barcode parsePartialFrom(
1183
1148
com .google .protobuf .CodedInputStream input ,
1184
1149
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
1185
1150
throws com .google .protobuf .InvalidProtocolBufferException {
1186
- return new Barcode (input , extensionRegistry );
1151
+ Builder builder = newBuilder ();
1152
+ try {
1153
+ builder .mergeFrom (input , extensionRegistry );
1154
+ } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
1155
+ throw e .setUnfinishedMessage (builder .buildPartial ());
1156
+ } catch (com .google .protobuf .UninitializedMessageException e ) {
1157
+ throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (builder .buildPartial ());
1158
+ } catch (java .io .IOException e ) {
1159
+ throw new com .google .protobuf .InvalidProtocolBufferException (e )
1160
+ .setUnfinishedMessage (builder .buildPartial ());
1161
+ }
1162
+ return builder .buildPartial ();
1187
1163
}
1188
1164
};
1189
1165
0 commit comments