-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPaymentCreatedEvent.java
307 lines (270 loc) · 9.81 KB
/
PaymentCreatedEvent.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
/*
* Autogenerated by Avro
* <p>
* DO NOT EDIT DIRECTLY
*/
package payment.event;
import org.apache.avro.specific.SpecificData;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class PaymentCreatedEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = -2252098323115404215L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PaymentCreatedEvent\",\"namespace\":\"payment.event\",\"fields\":[{\"name\":\"checkoutCode\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"paymentCode\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"}]}]}");
public static org.apache.avro.Schema getClassSchema() {
return SCHEMA$;
}
@Deprecated
public java.lang.Object checkoutCode;
@Deprecated
public java.lang.Object paymentCode;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use <code>newBuilder()</code>.
*/
public PaymentCreatedEvent() {
}
/**
* All-args constructor.
*
* @param checkoutCode The new value for checkoutCode
* @param paymentCode The new value for paymentCode
*/
public PaymentCreatedEvent(java.lang.Object checkoutCode, java.lang.Object paymentCode) {
this.checkoutCode = checkoutCode;
this.paymentCode = paymentCode;
}
public org.apache.avro.Schema getSchema() {
return SCHEMA$;
}
// Used by DatumWriter. Applications should not call.
public java.lang.Object get(int field$) {
switch (field$) {
case 0:
return checkoutCode;
case 1:
return paymentCode;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0:
checkoutCode = (java.lang.Object) value$;
break;
case 1:
paymentCode = (java.lang.Object) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'checkoutCode' field.
*
* @return The value of the 'checkoutCode' field.
*/
public java.lang.Object getCheckoutCode() {
return checkoutCode;
}
/**
* Sets the value of the 'checkoutCode' field.
*
* @param value the value to set.
*/
public void setCheckoutCode(java.lang.Object value) {
this.checkoutCode = value;
}
/**
* Gets the value of the 'paymentCode' field.
*
* @return The value of the 'paymentCode' field.
*/
public java.lang.Object getPaymentCode() {
return paymentCode;
}
/**
* Sets the value of the 'paymentCode' field.
*
* @param value the value to set.
*/
public void setPaymentCode(java.lang.Object value) {
this.paymentCode = value;
}
/**
* Creates a new PaymentCreatedEvent RecordBuilder.
*
* @return A new PaymentCreatedEvent RecordBuilder
*/
public static payment.event.PaymentCreatedEvent.Builder newBuilder() {
return new payment.event.PaymentCreatedEvent.Builder();
}
/**
* Creates a new PaymentCreatedEvent RecordBuilder by copying an existing Builder.
*
* @param other The existing builder to copy.
* @return A new PaymentCreatedEvent RecordBuilder
*/
public static payment.event.PaymentCreatedEvent.Builder newBuilder(payment.event.PaymentCreatedEvent.Builder other) {
return new payment.event.PaymentCreatedEvent.Builder(other);
}
/**
* Creates a new PaymentCreatedEvent RecordBuilder by copying an existing PaymentCreatedEvent instance.
*
* @param other The existing instance to copy.
* @return A new PaymentCreatedEvent RecordBuilder
*/
public static payment.event.PaymentCreatedEvent.Builder newBuilder(payment.event.PaymentCreatedEvent other) {
return new payment.event.PaymentCreatedEvent.Builder(other);
}
/**
* RecordBuilder for PaymentCreatedEvent instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PaymentCreatedEvent>
implements org.apache.avro.data.RecordBuilder<PaymentCreatedEvent> {
private java.lang.Object checkoutCode;
private java.lang.Object paymentCode;
/**
* Creates a new Builder
*/
private Builder() {
super(SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder.
*
* @param other The existing Builder to copy.
*/
private Builder(payment.event.PaymentCreatedEvent.Builder other) {
super(other);
if (isValidValue(fields()[0], other.checkoutCode)) {
this.checkoutCode = data().deepCopy(fields()[0].schema(), other.checkoutCode);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.paymentCode)) {
this.paymentCode = data().deepCopy(fields()[1].schema(), other.paymentCode);
fieldSetFlags()[1] = true;
}
}
/**
* Creates a Builder by copying an existing PaymentCreatedEvent instance
*
* @param other The existing instance to copy.
*/
private Builder(payment.event.PaymentCreatedEvent other) {
super(SCHEMA$);
if (isValidValue(fields()[0], other.checkoutCode)) {
this.checkoutCode = data().deepCopy(fields()[0].schema(), other.checkoutCode);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.paymentCode)) {
this.paymentCode = data().deepCopy(fields()[1].schema(), other.paymentCode);
fieldSetFlags()[1] = true;
}
}
/**
* Gets the value of the 'checkoutCode' field.
*
* @return The value.
*/
public java.lang.Object getCheckoutCode() {
return checkoutCode;
}
/**
* Sets the value of the 'checkoutCode' field.
*
* @param value The value of 'checkoutCode'.
* @return This builder.
*/
public payment.event.PaymentCreatedEvent.Builder setCheckoutCode(java.lang.Object value) {
validate(fields()[0], value);
this.checkoutCode = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'checkoutCode' field has been set.
*
* @return True if the 'checkoutCode' field has been set, false otherwise.
*/
public boolean hasCheckoutCode() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'checkoutCode' field.
*
* @return This builder.
*/
public payment.event.PaymentCreatedEvent.Builder clearCheckoutCode() {
checkoutCode = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'paymentCode' field.
*
* @return The value.
*/
public java.lang.Object getPaymentCode() {
return paymentCode;
}
/**
* Sets the value of the 'paymentCode' field.
*
* @param value The value of 'paymentCode'.
* @return This builder.
*/
public payment.event.PaymentCreatedEvent.Builder setPaymentCode(java.lang.Object value) {
validate(fields()[1], value);
this.paymentCode = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'paymentCode' field has been set.
*
* @return True if the 'paymentCode' field has been set, false otherwise.
*/
public boolean hasPaymentCode() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'paymentCode' field.
*
* @return This builder.
*/
public payment.event.PaymentCreatedEvent.Builder clearPaymentCode() {
paymentCode = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public PaymentCreatedEvent build() {
try {
PaymentCreatedEvent record = new PaymentCreatedEvent();
record.checkoutCode = fieldSetFlags()[0] ? this.checkoutCode : (java.lang.Object) defaultValue(fields()[0]);
record.paymentCode = fieldSetFlags()[1] ? this.paymentCode : (java.lang.Object) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
private static final org.apache.avro.io.DatumWriter
WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
@Override
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException {
WRITER$.write(this, SpecificData.getEncoder(out));
}
private static final org.apache.avro.io.DatumReader
READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
@Override
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException {
READER$.read(this, SpecificData.getDecoder(in));
}
}