/
ProfileSyncRequest.java
304 lines (268 loc) · 11.5 KB
/
ProfileSyncRequest.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
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.common.endpoint.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class ProfileSyncRequest extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ProfileSyncRequest\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"endpointPublicKey\",\"type\":[\"bytes\",\"null\"]},{\"name\":\"profileBody\",\"type\":\"bytes\"},{\"name\":\"sdkToken\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"endpointAccessToken\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]}],\"direction\":\"out\"}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private java.nio.ByteBuffer endpointPublicKey;
private java.nio.ByteBuffer profileBody;
private java.lang.String sdkToken;
private java.lang.String endpointAccessToken;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use {@link \#newBuilder()}.
*/
public ProfileSyncRequest() {}
/**
* All-args constructor.
*/
public ProfileSyncRequest(java.nio.ByteBuffer endpointPublicKey, java.nio.ByteBuffer profileBody, java.lang.String sdkToken, java.lang.String endpointAccessToken) {
this.endpointPublicKey = endpointPublicKey;
this.profileBody = profileBody;
this.sdkToken = sdkToken;
this.endpointAccessToken = endpointAccessToken;
}
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 endpointPublicKey;
case 1: return profileBody;
case 2: return sdkToken;
case 3: return endpointAccessToken;
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: endpointPublicKey = (java.nio.ByteBuffer)value$; break;
case 1: profileBody = (java.nio.ByteBuffer)value$; break;
case 2: sdkToken = (java.lang.String)value$; break;
case 3: endpointAccessToken = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'endpointPublicKey' field.
*/
public java.nio.ByteBuffer getEndpointPublicKey() {
return endpointPublicKey;
}
/**
* Sets the value of the 'endpointPublicKey' field.
* @param value the value to set.
*/
public void setEndpointPublicKey(java.nio.ByteBuffer value) {
this.endpointPublicKey = value;
}
/**
* Gets the value of the 'profileBody' field.
*/
public java.nio.ByteBuffer getProfileBody() {
return profileBody;
}
/**
* Sets the value of the 'profileBody' field.
* @param value the value to set.
*/
public void setProfileBody(java.nio.ByteBuffer value) {
this.profileBody = value;
}
/**
* Gets the value of the 'sdkToken' field.
*/
public java.lang.String getSdkToken() {
return sdkToken;
}
/**
* Sets the value of the 'sdkToken' field.
* @param value the value to set.
*/
public void setSdkToken(java.lang.String value) {
this.sdkToken = value;
}
/**
* Gets the value of the 'endpointAccessToken' field.
*/
public java.lang.String getEndpointAccessToken() {
return endpointAccessToken;
}
/**
* Sets the value of the 'endpointAccessToken' field.
* @param value the value to set.
*/
public void setEndpointAccessToken(java.lang.String value) {
this.endpointAccessToken = value;
}
/** Creates a new ProfileSyncRequest RecordBuilder */
public static org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder newBuilder() {
return new org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder();
}
/** Creates a new ProfileSyncRequest RecordBuilder by copying an existing Builder */
public static org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder other) {
return new org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder(other);
}
/** Creates a new ProfileSyncRequest RecordBuilder by copying an existing ProfileSyncRequest instance */
public static org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest other) {
return new org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder(other);
}
/**
* RecordBuilder for ProfileSyncRequest instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<ProfileSyncRequest>
implements org.apache.avro.data.RecordBuilder<ProfileSyncRequest> {
private java.nio.ByteBuffer endpointPublicKey;
private java.nio.ByteBuffer profileBody;
private java.lang.String sdkToken;
private java.lang.String endpointAccessToken;
/** Creates a new Builder */
private Builder() {
super(org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder other) {
super(other);
if (isValidValue(fields()[0], other.endpointPublicKey)) {
this.endpointPublicKey = data().deepCopy(fields()[0].schema(), other.endpointPublicKey);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.profileBody)) {
this.profileBody = data().deepCopy(fields()[1].schema(), other.profileBody);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.sdkToken)) {
this.sdkToken = data().deepCopy(fields()[2].schema(), other.sdkToken);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.endpointAccessToken)) {
this.endpointAccessToken = data().deepCopy(fields()[3].schema(), other.endpointAccessToken);
fieldSetFlags()[3] = true;
}
}
/** Creates a Builder by copying an existing ProfileSyncRequest instance */
private Builder(org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest other) {
super(org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.SCHEMA$);
if (isValidValue(fields()[0], other.endpointPublicKey)) {
this.endpointPublicKey = data().deepCopy(fields()[0].schema(), other.endpointPublicKey);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.profileBody)) {
this.profileBody = data().deepCopy(fields()[1].schema(), other.profileBody);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.sdkToken)) {
this.sdkToken = data().deepCopy(fields()[2].schema(), other.sdkToken);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.endpointAccessToken)) {
this.endpointAccessToken = data().deepCopy(fields()[3].schema(), other.endpointAccessToken);
fieldSetFlags()[3] = true;
}
}
/** Gets the value of the 'endpointPublicKey' field */
public java.nio.ByteBuffer getEndpointPublicKey() {
return endpointPublicKey;
}
/** Sets the value of the 'endpointPublicKey' field */
public org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder setEndpointPublicKey(java.nio.ByteBuffer value) {
validate(fields()[0], value);
this.endpointPublicKey = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'endpointPublicKey' field has been set */
public boolean hasEndpointPublicKey() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'endpointPublicKey' field */
public org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder clearEndpointPublicKey() {
endpointPublicKey = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'profileBody' field */
public java.nio.ByteBuffer getProfileBody() {
return profileBody;
}
/** Sets the value of the 'profileBody' field */
public org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder setProfileBody(java.nio.ByteBuffer value) {
validate(fields()[1], value);
this.profileBody = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'profileBody' field has been set */
public boolean hasProfileBody() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'profileBody' field */
public org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder clearProfileBody() {
profileBody = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'sdkToken' field */
public java.lang.String getSdkToken() {
return sdkToken;
}
/** Sets the value of the 'sdkToken' field */
public org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder setSdkToken(java.lang.String value) {
validate(fields()[2], value);
this.sdkToken = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'sdkToken' field has been set */
public boolean hasSdkToken() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'sdkToken' field */
public org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder clearSdkToken() {
sdkToken = null;
fieldSetFlags()[2] = false;
return this;
}
/** Gets the value of the 'endpointAccessToken' field */
public java.lang.String getEndpointAccessToken() {
return endpointAccessToken;
}
/** Sets the value of the 'endpointAccessToken' field */
public org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder setEndpointAccessToken(java.lang.String value) {
validate(fields()[3], value);
this.endpointAccessToken = value;
fieldSetFlags()[3] = true;
return this;
}
/** Checks whether the 'endpointAccessToken' field has been set */
public boolean hasEndpointAccessToken() {
return fieldSetFlags()[3];
}
/** Clears the value of the 'endpointAccessToken' field */
public org.kaaproject.kaa.common.endpoint.gen.ProfileSyncRequest.Builder clearEndpointAccessToken() {
endpointAccessToken = null;
fieldSetFlags()[3] = false;
return this;
}
@Override
public ProfileSyncRequest build() {
try {
ProfileSyncRequest record = new ProfileSyncRequest();
record.endpointPublicKey = fieldSetFlags()[0] ? this.endpointPublicKey : (java.nio.ByteBuffer) defaultValue(fields()[0]);
record.profileBody = fieldSetFlags()[1] ? this.profileBody : (java.nio.ByteBuffer) defaultValue(fields()[1]);
record.sdkToken = fieldSetFlags()[2] ? this.sdkToken : (java.lang.String) defaultValue(fields()[2]);
record.endpointAccessToken = fieldSetFlags()[3] ? this.endpointAccessToken : (java.lang.String) defaultValue(fields()[3]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}