forked from googleapis/java-spanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSingerProto.java
1191 lines (1091 loc) · 36.4 KB
/
SingerProto.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: samples/snippets/src/main/resources/com/example/spanner/singer.proto
// Protobuf Java Version: 3.25.1
package com.example.spanner;
public final class SingerProto {
private SingerProto() {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
}
/** Protobuf enum {@code examples.spanner.music.Genre} */
public enum Genre implements com.google.protobuf.ProtocolMessageEnum {
/** <code>POP = 0;</code> */
POP(0),
/** <code>JAZZ = 1;</code> */
JAZZ(1),
/** <code>FOLK = 2;</code> */
FOLK(2),
/** <code>ROCK = 3;</code> */
ROCK(3),
UNRECOGNIZED(-1),
;
/** <code>POP = 0;</code> */
public static final int POP_VALUE = 0;
/** <code>JAZZ = 1;</code> */
public static final int JAZZ_VALUE = 1;
/** <code>FOLK = 2;</code> */
public static final int FOLK_VALUE = 2;
/** <code>ROCK = 3;</code> */
public static final int ROCK_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new IllegalArgumentException("Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@Deprecated
public static Genre valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Genre forNumber(int value) {
switch (value) {
case 0:
return POP;
case 1:
return JAZZ;
case 2:
return FOLK;
case 3:
return ROCK;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<Genre> internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<Genre> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<Genre>() {
public Genre findValueByNumber(int number) {
return Genre.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new IllegalStateException("Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return SingerProto.getDescriptor().getEnumTypes().get(0);
}
private static final Genre[] VALUES = values();
public static Genre valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Genre(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:examples.spanner.music.Genre)
}
public interface SingerInfoOrBuilder
extends
// @@protoc_insertion_point(interface_extends:examples.spanner.music.SingerInfo)
com.google.protobuf.MessageOrBuilder {
/**
* <code>optional int64 singer_id = 1;</code>
*
* @return Whether the singerId field is set.
*/
boolean hasSingerId();
/**
* <code>optional int64 singer_id = 1;</code>
*
* @return The singerId.
*/
long getSingerId();
/**
* <code>optional string birth_date = 2;</code>
*
* @return Whether the birthDate field is set.
*/
boolean hasBirthDate();
/**
* <code>optional string birth_date = 2;</code>
*
* @return The birthDate.
*/
String getBirthDate();
/**
* <code>optional string birth_date = 2;</code>
*
* @return The bytes for birthDate.
*/
com.google.protobuf.ByteString getBirthDateBytes();
/**
* <code>optional string nationality = 3;</code>
*
* @return Whether the nationality field is set.
*/
boolean hasNationality();
/**
* <code>optional string nationality = 3;</code>
*
* @return The nationality.
*/
String getNationality();
/**
* <code>optional string nationality = 3;</code>
*
* @return The bytes for nationality.
*/
com.google.protobuf.ByteString getNationalityBytes();
/**
* <code>optional .examples.spanner.music.Genre genre = 4;</code>
*
* @return Whether the genre field is set.
*/
boolean hasGenre();
/**
* <code>optional .examples.spanner.music.Genre genre = 4;</code>
*
* @return The enum numeric value on the wire for genre.
*/
int getGenreValue();
/**
* <code>optional .examples.spanner.music.Genre genre = 4;</code>
*
* @return The genre.
*/
Genre getGenre();
}
/** Protobuf type {@code examples.spanner.music.SingerInfo} */
public static final class SingerInfo extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:examples.spanner.music.SingerInfo)
SingerInfoOrBuilder {
private static final long serialVersionUID = 0L;
// Use SingerInfo.newBuilder() to construct.
private SingerInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private SingerInfo() {
birthDate_ = "";
nationality_ = "";
genre_ = 0;
}
@Override
@SuppressWarnings({"unused"})
protected Object newInstance(UnusedPrivateParameter unused) {
return new SingerInfo();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return SingerProto.internal_static_examples_spanner_music_SingerInfo_descriptor;
}
@Override
protected FieldAccessorTable internalGetFieldAccessorTable() {
return SingerProto.internal_static_examples_spanner_music_SingerInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(SingerInfo.class, Builder.class);
}
private int bitField0_;
public static final int SINGER_ID_FIELD_NUMBER = 1;
private long singerId_ = 0L;
/**
* <code>optional int64 singer_id = 1;</code>
*
* @return Whether the singerId field is set.
*/
@Override
public boolean hasSingerId() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>optional int64 singer_id = 1;</code>
*
* @return The singerId.
*/
@Override
public long getSingerId() {
return singerId_;
}
public static final int BIRTH_DATE_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile Object birthDate_ = "";
/**
* <code>optional string birth_date = 2;</code>
*
* @return Whether the birthDate field is set.
*/
@Override
public boolean hasBirthDate() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>optional string birth_date = 2;</code>
*
* @return The birthDate.
*/
@Override
public String getBirthDate() {
Object ref = birthDate_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
birthDate_ = s;
return s;
}
}
/**
* <code>optional string birth_date = 2;</code>
*
* @return The bytes for birthDate.
*/
@Override
public com.google.protobuf.ByteString getBirthDateBytes() {
Object ref = birthDate_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
birthDate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int NATIONALITY_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile Object nationality_ = "";
/**
* <code>optional string nationality = 3;</code>
*
* @return Whether the nationality field is set.
*/
@Override
public boolean hasNationality() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <code>optional string nationality = 3;</code>
*
* @return The nationality.
*/
@Override
public String getNationality() {
Object ref = nationality_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
nationality_ = s;
return s;
}
}
/**
* <code>optional string nationality = 3;</code>
*
* @return The bytes for nationality.
*/
@Override
public com.google.protobuf.ByteString getNationalityBytes() {
Object ref = nationality_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
nationality_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int GENRE_FIELD_NUMBER = 4;
private int genre_ = 0;
/**
* <code>optional .examples.spanner.music.Genre genre = 4;</code>
*
* @return Whether the genre field is set.
*/
@Override
public boolean hasGenre() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
* <code>optional .examples.spanner.music.Genre genre = 4;</code>
*
* @return The enum numeric value on the wire for genre.
*/
@Override
public int getGenreValue() {
return genre_;
}
/**
* <code>optional .examples.spanner.music.Genre genre = 4;</code>
*
* @return The genre.
*/
@Override
public Genre getGenre() {
Genre result = Genre.forNumber(genre_);
return result == null ? Genre.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeInt64(1, singerId_);
}
if (((bitField0_ & 0x00000002) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, birthDate_);
}
if (((bitField0_ & 0x00000004) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nationality_);
}
if (((bitField0_ & 0x00000008) != 0)) {
output.writeEnum(4, genre_);
}
getUnknownFields().writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, singerId_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, birthDate_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nationality_);
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, genre_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof SingerInfo)) {
return super.equals(obj);
}
SingerInfo other = (SingerInfo) obj;
if (hasSingerId() != other.hasSingerId()) return false;
if (hasSingerId()) {
if (getSingerId() != other.getSingerId()) return false;
}
if (hasBirthDate() != other.hasBirthDate()) return false;
if (hasBirthDate()) {
if (!getBirthDate().equals(other.getBirthDate())) return false;
}
if (hasNationality() != other.hasNationality()) return false;
if (hasNationality()) {
if (!getNationality().equals(other.getNationality())) return false;
}
if (hasGenre() != other.hasGenre()) return false;
if (hasGenre()) {
if (genre_ != other.genre_) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasSingerId()) {
hash = (37 * hash) + SINGER_ID_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSingerId());
}
if (hasBirthDate()) {
hash = (37 * hash) + BIRTH_DATE_FIELD_NUMBER;
hash = (53 * hash) + getBirthDate().hashCode();
}
if (hasNationality()) {
hash = (37 * hash) + NATIONALITY_FIELD_NUMBER;
hash = (53 * hash) + getNationality().hashCode();
}
if (hasGenre()) {
hash = (37 * hash) + GENRE_FIELD_NUMBER;
hash = (53 * hash) + genre_;
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static SingerInfo parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static SingerInfo parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static SingerInfo parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static SingerInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static SingerInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static SingerInfo parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static SingerInfo parseFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static SingerInfo parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static SingerInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static SingerInfo parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static SingerInfo parseFrom(com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static SingerInfo parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(SingerInfo prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/** Protobuf type {@code examples.spanner.music.SingerInfo} */
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:examples.spanner.music.SingerInfo)
SingerInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return SingerProto.internal_static_examples_spanner_music_SingerInfo_descriptor;
}
@Override
protected FieldAccessorTable internalGetFieldAccessorTable() {
return SingerProto.internal_static_examples_spanner_music_SingerInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(SingerInfo.class, Builder.class);
}
// Construct using com.example.spanner.SingerProto.SingerInfo.newBuilder()
private Builder() {}
private Builder(BuilderParent parent) {
super(parent);
}
@Override
public Builder clear() {
super.clear();
bitField0_ = 0;
singerId_ = 0L;
birthDate_ = "";
nationality_ = "";
genre_ = 0;
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return SingerProto.internal_static_examples_spanner_music_SingerInfo_descriptor;
}
@Override
public SingerInfo getDefaultInstanceForType() {
return SingerInfo.getDefaultInstance();
}
@Override
public SingerInfo build() {
SingerInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public SingerInfo buildPartial() {
SingerInfo result = new SingerInfo(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(SingerInfo result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.singerId_ = singerId_;
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.birthDate_ = birthDate_;
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.nationality_ = nationality_;
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.genre_ = genre_;
to_bitField0_ |= 0x00000008;
}
result.bitField0_ |= to_bitField0_;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof SingerInfo) {
return mergeFrom((SingerInfo) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(SingerInfo other) {
if (other == SingerInfo.getDefaultInstance()) return this;
if (other.hasSingerId()) {
setSingerId(other.getSingerId());
}
if (other.hasBirthDate()) {
birthDate_ = other.birthDate_;
bitField0_ |= 0x00000002;
onChanged();
}
if (other.hasNationality()) {
nationality_ = other.nationality_;
bitField0_ |= 0x00000004;
onChanged();
}
if (other.hasGenre()) {
setGenre(other.getGenre());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8:
{
singerId_ = input.readInt64();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18:
{
birthDate_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
nationality_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 26
case 32:
{
genre_ = input.readEnum();
bitField0_ |= 0x00000008;
break;
} // case 32
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private long singerId_;
/**
* <code>optional int64 singer_id = 1;</code>
*
* @return Whether the singerId field is set.
*/
@Override
public boolean hasSingerId() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>optional int64 singer_id = 1;</code>
*
* @return The singerId.
*/
@Override
public long getSingerId() {
return singerId_;
}
/**
* <code>optional int64 singer_id = 1;</code>
*
* @param value The singerId to set.
* @return This builder for chaining.
*/
public Builder setSingerId(long value) {
singerId_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>optional int64 singer_id = 1;</code>
*
* @return This builder for chaining.
*/
public Builder clearSingerId() {
bitField0_ = (bitField0_ & ~0x00000001);
singerId_ = 0L;
onChanged();
return this;
}
private Object birthDate_ = "";
/**
* <code>optional string birth_date = 2;</code>
*
* @return Whether the birthDate field is set.
*/
public boolean hasBirthDate() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>optional string birth_date = 2;</code>
*
* @return The birthDate.
*/
public String getBirthDate() {
Object ref = birthDate_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
birthDate_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>optional string birth_date = 2;</code>
*
* @return The bytes for birthDate.
*/
public com.google.protobuf.ByteString getBirthDateBytes() {
Object ref = birthDate_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
birthDate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string birth_date = 2;</code>
*
* @param value The birthDate to set.
* @return This builder for chaining.
*/
public Builder setBirthDate(String value) {
if (value == null) {
throw new NullPointerException();
}
birthDate_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>optional string birth_date = 2;</code>
*
* @return This builder for chaining.
*/
public Builder clearBirthDate() {
birthDate_ = getDefaultInstance().getBirthDate();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
* <code>optional string birth_date = 2;</code>
*
* @param value The bytes for birthDate to set.
* @return This builder for chaining.
*/
public Builder setBirthDateBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
birthDate_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private Object nationality_ = "";
/**
* <code>optional string nationality = 3;</code>
*
* @return Whether the nationality field is set.
*/
public boolean hasNationality() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <code>optional string nationality = 3;</code>
*
* @return The nationality.
*/
public String getNationality() {
Object ref = nationality_;
if (!(ref instanceof String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
nationality_ = s;
return s;
} else {
return (String) ref;
}
}
/**
* <code>optional string nationality = 3;</code>
*
* @return The bytes for nationality.
*/
public com.google.protobuf.ByteString getNationalityBytes() {
Object ref = nationality_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
nationality_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string nationality = 3;</code>
*
* @param value The nationality to set.
* @return This builder for chaining.
*/
public Builder setNationality(String value) {
if (value == null) {
throw new NullPointerException();
}
nationality_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
* <code>optional string nationality = 3;</code>
*
* @return This builder for chaining.
*/
public Builder clearNationality() {
nationality_ = getDefaultInstance().getNationality();