5
5
*/
6
6
package com .baeldung .apache .avro .generated ;
7
7
8
+ import org .apache .avro .generic .GenericArray ;
8
9
import org .apache .avro .specific .SpecificData ;
10
+ import org .apache .avro .util .Utf8 ;
9
11
import org .apache .avro .message .BinaryMessageEncoder ;
10
12
import org .apache .avro .message .BinaryMessageDecoder ;
11
13
import org .apache .avro .message .SchemaStore ;
12
14
13
15
@ org .apache .avro .specific .AvroGenerated
14
16
public class Car extends org .apache .avro .specific .SpecificRecordBase implements org .apache .avro .specific .SpecificRecord {
15
- private static final long serialVersionUID = - 8258229058542686289L ;
17
+ private static final long serialVersionUID = 5432057678575069597L ;
16
18
17
19
18
- public static final org .apache .avro .Schema SCHEMA$ = new org .apache .avro .Schema .Parser ().parse ("{\" type\" :\" record\" ,\" name\" :\" Car\" ,\" namespace\" :\" generated. avro\" ,\" fields\" :[{\" name\" :\" brand\" ,\" type\" :{\" type\" :\" string\" ,\" avro.java.string\" :\" String\" },\" default\" :\" Dacia\" },{\" name\" :\" number_of_doors\" ,\" type\" :\" int\" ,\" default\" :4},{\" name\" :\" color\" ,\" type\" :[\" null\" ,{\" type\" :\" string\" ,\" avro.java.string\" :\" String\" }],\" default\" :null}]}" );
20
+ public static final org .apache .avro .Schema SCHEMA$ = new org .apache .avro .Schema .Parser ().parse ("{\" type\" :\" record\" ,\" name\" :\" Car\" ,\" namespace\" :\" com.baeldung.apache. avro.generated \" ,\" fields\" :[{\" name\" :\" brand\" ,\" type\" :{\" type\" :\" string\" ,\" avro.java.string\" :\" String\" },\" default\" :\" Dacia\" },{\" name\" :\" number_of_doors\" ,\" type\" :\" int\" ,\" default\" :4},{\" name\" :\" color\" ,\" type\" :[\" null\" ,{\" type\" :\" string\" ,\" avro.java.string\" :\" String\" }],\" default\" :null}]}" );
19
21
public static org .apache .avro .Schema getClassSchema () { return SCHEMA$ ; }
20
22
21
23
private static final SpecificData MODEL$ = new SpecificData ();
@@ -178,20 +180,20 @@ public void setColor(java.lang.String value) {
178
180
* Creates a new Car RecordBuilder.
179
181
* @return A new Car RecordBuilder
180
182
*/
181
- public static Car .Builder newBuilder () {
182
- return new Car .Builder ();
183
+ public static com . baeldung . apache . avro . generated . Car .Builder newBuilder () {
184
+ return new com . baeldung . apache . avro . generated . Car .Builder ();
183
185
}
184
186
185
187
/**
186
188
* Creates a new Car RecordBuilder by copying an existing Builder.
187
189
* @param other The existing builder to copy.
188
190
* @return A new Car RecordBuilder
189
191
*/
190
- public static Car .Builder newBuilder (Car .Builder other ) {
192
+ public static com . baeldung . apache . avro . generated . Car .Builder newBuilder (com . baeldung . apache . avro . generated . Car .Builder other ) {
191
193
if (other == null ) {
192
- return new Car .Builder ();
194
+ return new com . baeldung . apache . avro . generated . Car .Builder ();
193
195
} else {
194
- return new Car .Builder (other );
196
+ return new com . baeldung . apache . avro . generated . Car .Builder (other );
195
197
}
196
198
}
197
199
@@ -200,11 +202,11 @@ public static Car.Builder newBuilder(Car.Builder other) {
200
202
* @param other The existing instance to copy.
201
203
* @return A new Car RecordBuilder
202
204
*/
203
- public static Car .Builder newBuilder (Car other ) {
205
+ public static com . baeldung . apache . avro . generated . Car .Builder newBuilder (com . baeldung . apache . avro . generated . Car other ) {
204
206
if (other == null ) {
205
- return new Car .Builder ();
207
+ return new com . baeldung . apache . avro . generated . Car .Builder ();
206
208
} else {
207
- return new Car .Builder (other );
209
+ return new com . baeldung . apache . avro . generated . Car .Builder (other );
208
210
}
209
211
}
210
212
@@ -228,7 +230,7 @@ private Builder() {
228
230
* Creates a Builder by copying an existing Builder.
229
231
* @param other The existing Builder to copy.
230
232
*/
231
- private Builder (Car .Builder other ) {
233
+ private Builder (com . baeldung . apache . avro . generated . Car .Builder other ) {
232
234
super (other );
233
235
if (isValidValue (fields ()[0 ], other .brand )) {
234
236
this .brand = data ().deepCopy (fields ()[0 ].schema (), other .brand );
@@ -248,7 +250,7 @@ private Builder(Car.Builder other) {
248
250
* Creates a Builder by copying an existing Car instance
249
251
* @param other The existing instance to copy.
250
252
*/
251
- private Builder (Car other ) {
253
+ private Builder (com . baeldung . apache . avro . generated . Car other ) {
252
254
super (SCHEMA$ , MODEL$ );
253
255
if (isValidValue (fields ()[0 ], other .brand )) {
254
256
this .brand = data ().deepCopy (fields ()[0 ].schema (), other .brand );
@@ -278,7 +280,7 @@ public java.lang.String getBrand() {
278
280
* @param value The value of 'brand'.
279
281
* @return This builder.
280
282
*/
281
- public Car .Builder setBrand (java .lang .String value ) {
283
+ public com . baeldung . apache . avro . generated . Car .Builder setBrand (java .lang .String value ) {
282
284
validate (fields ()[0 ], value );
283
285
this .brand = value ;
284
286
fieldSetFlags ()[0 ] = true ;
@@ -298,7 +300,7 @@ public boolean hasBrand() {
298
300
* Clears the value of the 'brand' field.
299
301
* @return This builder.
300
302
*/
301
- public Car .Builder clearBrand () {
303
+ public com . baeldung . apache . avro . generated . Car .Builder clearBrand () {
302
304
brand = null ;
303
305
fieldSetFlags ()[0 ] = false ;
304
306
return this ;
@@ -318,7 +320,7 @@ public int getNumberOfDoors() {
318
320
* @param value The value of 'number_of_doors'.
319
321
* @return This builder.
320
322
*/
321
- public Car .Builder setNumberOfDoors (int value ) {
323
+ public com . baeldung . apache . avro . generated . Car .Builder setNumberOfDoors (int value ) {
322
324
validate (fields ()[1 ], value );
323
325
this .number_of_doors = value ;
324
326
fieldSetFlags ()[1 ] = true ;
@@ -338,7 +340,7 @@ public boolean hasNumberOfDoors() {
338
340
* Clears the value of the 'number_of_doors' field.
339
341
* @return This builder.
340
342
*/
341
- public Car .Builder clearNumberOfDoors () {
343
+ public com . baeldung . apache . avro . generated . Car .Builder clearNumberOfDoors () {
342
344
fieldSetFlags ()[1 ] = false ;
343
345
return this ;
344
346
}
@@ -357,7 +359,7 @@ public java.lang.String getColor() {
357
359
* @param value The value of 'color'.
358
360
* @return This builder.
359
361
*/
360
- public Car .Builder setColor (java .lang .String value ) {
362
+ public com . baeldung . apache . avro . generated . Car .Builder setColor (java .lang .String value ) {
361
363
validate (fields ()[2 ], value );
362
364
this .color = value ;
363
365
fieldSetFlags ()[2 ] = true ;
@@ -377,7 +379,7 @@ public boolean hasColor() {
377
379
* Clears the value of the 'color' field.
378
380
* @return This builder.
379
381
*/
380
- public Car .Builder clearColor () {
382
+ public com . baeldung . apache . avro . generated . Car .Builder clearColor () {
381
383
color = null ;
382
384
fieldSetFlags ()[2 ] = false ;
383
385
return this ;
0 commit comments