@@ -59,132 +59,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
59
59
return this .unknownFields ;
60
60
}
61
61
62
- private Budget (
63
- com .google .protobuf .CodedInputStream input ,
64
- com .google .protobuf .ExtensionRegistryLite extensionRegistry )
65
- throws com .google .protobuf .InvalidProtocolBufferException {
66
- this ();
67
- if (extensionRegistry == null ) {
68
- throw new java .lang .NullPointerException ();
69
- }
70
- int mutable_bitField0_ = 0 ;
71
- com .google .protobuf .UnknownFieldSet .Builder unknownFields =
72
- com .google .protobuf .UnknownFieldSet .newBuilder ();
73
- try {
74
- boolean done = false ;
75
- while (!done ) {
76
- int tag = input .readTag ();
77
- switch (tag ) {
78
- case 0 :
79
- done = true ;
80
- break ;
81
- case 10 :
82
- {
83
- java .lang .String s = input .readStringRequireUtf8 ();
84
-
85
- name_ = s ;
86
- break ;
87
- }
88
- case 18 :
89
- {
90
- java .lang .String s = input .readStringRequireUtf8 ();
91
-
92
- displayName_ = s ;
93
- break ;
94
- }
95
- case 26 :
96
- {
97
- com .google .cloud .billing .budgets .v1 .Filter .Builder subBuilder = null ;
98
- if (budgetFilter_ != null ) {
99
- subBuilder = budgetFilter_ .toBuilder ();
100
- }
101
- budgetFilter_ =
102
- input .readMessage (
103
- com .google .cloud .billing .budgets .v1 .Filter .parser (), extensionRegistry );
104
- if (subBuilder != null ) {
105
- subBuilder .mergeFrom (budgetFilter_ );
106
- budgetFilter_ = subBuilder .buildPartial ();
107
- }
108
-
109
- break ;
110
- }
111
- case 34 :
112
- {
113
- com .google .cloud .billing .budgets .v1 .BudgetAmount .Builder subBuilder = null ;
114
- if (amount_ != null ) {
115
- subBuilder = amount_ .toBuilder ();
116
- }
117
- amount_ =
118
- input .readMessage (
119
- com .google .cloud .billing .budgets .v1 .BudgetAmount .parser (), extensionRegistry );
120
- if (subBuilder != null ) {
121
- subBuilder .mergeFrom (amount_ );
122
- amount_ = subBuilder .buildPartial ();
123
- }
124
-
125
- break ;
126
- }
127
- case 42 :
128
- {
129
- if (!((mutable_bitField0_ & 0x00000001 ) != 0 )) {
130
- thresholdRules_ =
131
- new java .util .ArrayList <com .google .cloud .billing .budgets .v1 .ThresholdRule >();
132
- mutable_bitField0_ |= 0x00000001 ;
133
- }
134
- thresholdRules_ .add (
135
- input .readMessage (
136
- com .google .cloud .billing .budgets .v1 .ThresholdRule .parser (),
137
- extensionRegistry ));
138
- break ;
139
- }
140
- case 50 :
141
- {
142
- com .google .cloud .billing .budgets .v1 .NotificationsRule .Builder subBuilder = null ;
143
- if (notificationsRule_ != null ) {
144
- subBuilder = notificationsRule_ .toBuilder ();
145
- }
146
- notificationsRule_ =
147
- input .readMessage (
148
- com .google .cloud .billing .budgets .v1 .NotificationsRule .parser (),
149
- extensionRegistry );
150
- if (subBuilder != null ) {
151
- subBuilder .mergeFrom (notificationsRule_ );
152
- notificationsRule_ = subBuilder .buildPartial ();
153
- }
154
-
155
- break ;
156
- }
157
- case 58 :
158
- {
159
- java .lang .String s = input .readStringRequireUtf8 ();
160
-
161
- etag_ = s ;
162
- break ;
163
- }
164
- default :
165
- {
166
- if (!parseUnknownField (input , unknownFields , extensionRegistry , tag )) {
167
- done = true ;
168
- }
169
- break ;
170
- }
171
- }
172
- }
173
- } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
174
- throw e .setUnfinishedMessage (this );
175
- } catch (com .google .protobuf .UninitializedMessageException e ) {
176
- throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (this );
177
- } catch (java .io .IOException e ) {
178
- throw new com .google .protobuf .InvalidProtocolBufferException (e ).setUnfinishedMessage (this );
179
- } finally {
180
- if (((mutable_bitField0_ & 0x00000001 ) != 0 )) {
181
- thresholdRules_ = java .util .Collections .unmodifiableList (thresholdRules_ );
182
- }
183
- this .unknownFields = unknownFields .build ();
184
- makeExtensionsImmutable ();
185
- }
186
- }
187
-
188
62
public static final com .google .protobuf .Descriptors .Descriptor getDescriptor () {
189
63
return com .google .cloud .billing .budgets .v1 .BudgetModelProto
190
64
.internal_static_google_cloud_billing_budgets_v1_Budget_descriptor ;
@@ -649,7 +523,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
649
523
if (!com .google .protobuf .GeneratedMessageV3 .isStringEmpty (etag_ )) {
650
524
com .google .protobuf .GeneratedMessageV3 .writeString (output , 7 , etag_ );
651
525
}
652
- unknownFields .writeTo (output );
526
+ getUnknownFields () .writeTo (output );
653
527
}
654
528
655
529
@ java .lang .Override
@@ -679,7 +553,7 @@ public int getSerializedSize() {
679
553
if (!com .google .protobuf .GeneratedMessageV3 .isStringEmpty (etag_ )) {
680
554
size += com .google .protobuf .GeneratedMessageV3 .computeStringSize (7 , etag_ );
681
555
}
682
- size += unknownFields .getSerializedSize ();
556
+ size += getUnknownFields () .getSerializedSize ();
683
557
memoizedSize = size ;
684
558
return size ;
685
559
}
@@ -711,7 +585,7 @@ public boolean equals(final java.lang.Object obj) {
711
585
if (!getNotificationsRule ().equals (other .getNotificationsRule ())) return false ;
712
586
}
713
587
if (!getEtag ().equals (other .getEtag ())) return false ;
714
- if (!unknownFields .equals (other .unknownFields )) return false ;
588
+ if (!getUnknownFields () .equals (other .getUnknownFields () )) return false ;
715
589
return true ;
716
590
}
717
591
@@ -744,7 +618,7 @@ public int hashCode() {
744
618
}
745
619
hash = (37 * hash ) + ETAG_FIELD_NUMBER ;
746
620
hash = (53 * hash ) + getEtag ().hashCode ();
747
- hash = (29 * hash ) + unknownFields .hashCode ();
621
+ hash = (29 * hash ) + getUnknownFields () .hashCode ();
748
622
memoizedHashCode = hash ;
749
623
return hash ;
750
624
}
@@ -877,19 +751,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
877
751
}
878
752
879
753
// Construct using com.google.cloud.billing.budgets.v1.Budget.newBuilder()
880
- private Builder () {
881
- maybeForceBuilderInitialization ();
882
- }
754
+ private Builder () {}
883
755
884
756
private Builder (com .google .protobuf .GeneratedMessageV3 .BuilderParent parent ) {
885
757
super (parent );
886
- maybeForceBuilderInitialization ();
887
- }
888
-
889
- private void maybeForceBuilderInitialization () {
890
- if (com .google .protobuf .GeneratedMessageV3 .alwaysUseFieldBuilders ) {
891
- getThresholdRulesFieldBuilder ();
892
- }
893
758
}
894
759
895
760
@ java .lang .Override
@@ -913,10 +778,11 @@ public Builder clear() {
913
778
}
914
779
if (thresholdRulesBuilder_ == null ) {
915
780
thresholdRules_ = java .util .Collections .emptyList ();
916
- bitField0_ = (bitField0_ & ~0x00000001 );
917
781
} else {
782
+ thresholdRules_ = null ;
918
783
thresholdRulesBuilder_ .clear ();
919
784
}
785
+ bitField0_ = (bitField0_ & ~0x00000001 );
920
786
if (notificationsRuleBuilder_ == null ) {
921
787
notificationsRule_ = null ;
922
788
} else {
@@ -1077,7 +943,7 @@ public Builder mergeFrom(com.google.cloud.billing.budgets.v1.Budget other) {
1077
943
etag_ = other .etag_ ;
1078
944
onChanged ();
1079
945
}
1080
- this .mergeUnknownFields (other .unknownFields );
946
+ this .mergeUnknownFields (other .getUnknownFields () );
1081
947
onChanged ();
1082
948
return this ;
1083
949
}
@@ -1092,17 +958,82 @@ public Builder mergeFrom(
1092
958
com .google .protobuf .CodedInputStream input ,
1093
959
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
1094
960
throws java .io .IOException {
1095
- com .google .cloud .billing .budgets .v1 .Budget parsedMessage = null ;
961
+ if (extensionRegistry == null ) {
962
+ throw new java .lang .NullPointerException ();
963
+ }
1096
964
try {
1097
- parsedMessage = PARSER .parsePartialFrom (input , extensionRegistry );
965
+ boolean done = false ;
966
+ while (!done ) {
967
+ int tag = input .readTag ();
968
+ switch (tag ) {
969
+ case 0 :
970
+ done = true ;
971
+ break ;
972
+ case 10 :
973
+ {
974
+ name_ = input .readStringRequireUtf8 ();
975
+
976
+ break ;
977
+ } // case 10
978
+ case 18 :
979
+ {
980
+ displayName_ = input .readStringRequireUtf8 ();
981
+
982
+ break ;
983
+ } // case 18
984
+ case 26 :
985
+ {
986
+ input .readMessage (getBudgetFilterFieldBuilder ().getBuilder (), extensionRegistry );
987
+
988
+ break ;
989
+ } // case 26
990
+ case 34 :
991
+ {
992
+ input .readMessage (getAmountFieldBuilder ().getBuilder (), extensionRegistry );
993
+
994
+ break ;
995
+ } // case 34
996
+ case 42 :
997
+ {
998
+ com .google .cloud .billing .budgets .v1 .ThresholdRule m =
999
+ input .readMessage (
1000
+ com .google .cloud .billing .budgets .v1 .ThresholdRule .parser (),
1001
+ extensionRegistry );
1002
+ if (thresholdRulesBuilder_ == null ) {
1003
+ ensureThresholdRulesIsMutable ();
1004
+ thresholdRules_ .add (m );
1005
+ } else {
1006
+ thresholdRulesBuilder_ .addMessage (m );
1007
+ }
1008
+ break ;
1009
+ } // case 42
1010
+ case 50 :
1011
+ {
1012
+ input .readMessage (
1013
+ getNotificationsRuleFieldBuilder ().getBuilder (), extensionRegistry );
1014
+
1015
+ break ;
1016
+ } // case 50
1017
+ case 58 :
1018
+ {
1019
+ etag_ = input .readStringRequireUtf8 ();
1020
+
1021
+ break ;
1022
+ } // case 58
1023
+ default :
1024
+ {
1025
+ if (!super .parseUnknownField (input , extensionRegistry , tag )) {
1026
+ done = true ; // was an endgroup tag
1027
+ }
1028
+ break ;
1029
+ } // default:
1030
+ } // switch (tag)
1031
+ } // while (!done)
1098
1032
} catch (com .google .protobuf .InvalidProtocolBufferException e ) {
1099
- parsedMessage = (com .google .cloud .billing .budgets .v1 .Budget ) e .getUnfinishedMessage ();
1100
1033
throw e .unwrapIOException ();
1101
1034
} finally {
1102
- if (parsedMessage != null ) {
1103
- mergeFrom (parsedMessage );
1104
- }
1105
- }
1035
+ onChanged ();
1036
+ } // finally
1106
1037
return this ;
1107
1038
}
1108
1039
@@ -2542,7 +2473,18 @@ public Budget parsePartialFrom(
2542
2473
com .google .protobuf .CodedInputStream input ,
2543
2474
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
2544
2475
throws com .google .protobuf .InvalidProtocolBufferException {
2545
- return new Budget (input , extensionRegistry );
2476
+ Builder builder = newBuilder ();
2477
+ try {
2478
+ builder .mergeFrom (input , extensionRegistry );
2479
+ } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
2480
+ throw e .setUnfinishedMessage (builder .buildPartial ());
2481
+ } catch (com .google .protobuf .UninitializedMessageException e ) {
2482
+ throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (builder .buildPartial ());
2483
+ } catch (java .io .IOException e ) {
2484
+ throw new com .google .protobuf .InvalidProtocolBufferException (e )
2485
+ .setUnfinishedMessage (builder .buildPartial ());
2486
+ }
2487
+ return builder .buildPartial ();
2546
2488
}
2547
2489
};
2548
2490
0 commit comments