| 123 |
ashish |
1 |
/**
|
|
|
2 |
* Autogenerated by Thrift
|
|
|
3 |
*
|
|
|
4 |
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
|
5 |
*/
|
|
|
6 |
package in.shop2020.payments;
|
|
|
7 |
|
|
|
8 |
import java.util.List;
|
|
|
9 |
import java.util.ArrayList;
|
|
|
10 |
import java.util.Map;
|
|
|
11 |
import java.util.HashMap;
|
|
|
12 |
import java.util.EnumMap;
|
|
|
13 |
import java.util.Set;
|
|
|
14 |
import java.util.HashSet;
|
|
|
15 |
import java.util.EnumSet;
|
|
|
16 |
import java.util.Collections;
|
|
|
17 |
import java.util.BitSet;
|
|
|
18 |
import java.util.Arrays;
|
|
|
19 |
import org.slf4j.Logger;
|
|
|
20 |
import org.slf4j.LoggerFactory;
|
|
|
21 |
|
|
|
22 |
import org.apache.thrift.*;
|
|
|
23 |
import org.apache.thrift.meta_data.*;
|
|
|
24 |
import org.apache.thrift.protocol.*;
|
|
|
25 |
|
|
|
26 |
public class PaymentRequest implements TBase<PaymentRequest._Fields>, java.io.Serializable, Cloneable, Comparable<PaymentRequest> {
|
|
|
27 |
private static final TStruct STRUCT_DESC = new TStruct("PaymentRequest");
|
|
|
28 |
|
|
|
29 |
private static final TField REQUEST_ID_FIELD_DESC = new TField("request_id", TType.I64, (short)1);
|
|
|
30 |
private static final TField APPLICATION_ID_FIELD_DESC = new TField("application_id", TType.I64, (short)2);
|
|
|
31 |
private static final TField REQUEST_STATUS_FIELD_DESC = new TField("requestStatus", TType.I32, (short)3);
|
|
|
32 |
private static final TField RECEIVING_TIMESTAMP_FIELD_DESC = new TField("receiving_timestamp", TType.I64, (short)4);
|
|
|
33 |
private static final TField SENDING_TIMESTAMP_FIELD_DESC = new TField("sending_timestamp", TType.I64, (short)5);
|
|
|
34 |
private static final TField PARAMS_FIELD_DESC = new TField("params", TType.LIST, (short)6);
|
|
|
35 |
private static final TField MERCHANT_TX_ID_FIELD_DESC = new TField("merchant_tx_id", TType.I64, (short)7);
|
|
|
36 |
|
|
|
37 |
private long request_id;
|
|
|
38 |
private long application_id;
|
|
|
39 |
private RequestStatus requestStatus;
|
|
|
40 |
private long receiving_timestamp;
|
|
|
41 |
private long sending_timestamp;
|
|
|
42 |
private List<Param> params;
|
|
|
43 |
private long merchant_tx_id;
|
|
|
44 |
|
|
|
45 |
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
|
|
46 |
public enum _Fields implements TFieldIdEnum {
|
|
|
47 |
REQUEST_ID((short)1, "request_id"),
|
|
|
48 |
APPLICATION_ID((short)2, "application_id"),
|
|
|
49 |
/**
|
|
|
50 |
*
|
|
|
51 |
* @see RequestStatus
|
|
|
52 |
*/
|
|
|
53 |
REQUEST_STATUS((short)3, "requestStatus"),
|
|
|
54 |
RECEIVING_TIMESTAMP((short)4, "receiving_timestamp"),
|
|
|
55 |
SENDING_TIMESTAMP((short)5, "sending_timestamp"),
|
|
|
56 |
PARAMS((short)6, "params"),
|
|
|
57 |
MERCHANT_TX_ID((short)7, "merchant_tx_id");
|
|
|
58 |
|
|
|
59 |
private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
|
|
|
60 |
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
|
|
61 |
|
|
|
62 |
static {
|
|
|
63 |
for (_Fields field : EnumSet.allOf(_Fields.class)) {
|
|
|
64 |
byId.put((int)field._thriftId, field);
|
|
|
65 |
byName.put(field.getFieldName(), field);
|
|
|
66 |
}
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
/**
|
|
|
70 |
* Find the _Fields constant that matches fieldId, or null if its not found.
|
|
|
71 |
*/
|
|
|
72 |
public static _Fields findByThriftId(int fieldId) {
|
|
|
73 |
return byId.get(fieldId);
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
/**
|
|
|
77 |
* Find the _Fields constant that matches fieldId, throwing an exception
|
|
|
78 |
* if it is not found.
|
|
|
79 |
*/
|
|
|
80 |
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
|
|
81 |
_Fields fields = findByThriftId(fieldId);
|
|
|
82 |
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
|
|
83 |
return fields;
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
/**
|
|
|
87 |
* Find the _Fields constant that matches name, or null if its not found.
|
|
|
88 |
*/
|
|
|
89 |
public static _Fields findByName(String name) {
|
|
|
90 |
return byName.get(name);
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
private final short _thriftId;
|
|
|
94 |
private final String _fieldName;
|
|
|
95 |
|
|
|
96 |
_Fields(short thriftId, String fieldName) {
|
|
|
97 |
_thriftId = thriftId;
|
|
|
98 |
_fieldName = fieldName;
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
public short getThriftFieldId() {
|
|
|
102 |
return _thriftId;
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
public String getFieldName() {
|
|
|
106 |
return _fieldName;
|
|
|
107 |
}
|
|
|
108 |
}
|
|
|
109 |
|
|
|
110 |
// isset id assignments
|
|
|
111 |
private static final int __REQUEST_ID_ISSET_ID = 0;
|
|
|
112 |
private static final int __APPLICATION_ID_ISSET_ID = 1;
|
|
|
113 |
private static final int __RECEIVING_TIMESTAMP_ISSET_ID = 2;
|
|
|
114 |
private static final int __SENDING_TIMESTAMP_ISSET_ID = 3;
|
|
|
115 |
private static final int __MERCHANT_TX_ID_ISSET_ID = 4;
|
|
|
116 |
private BitSet __isset_bit_vector = new BitSet(5);
|
|
|
117 |
|
|
|
118 |
public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
|
|
|
119 |
put(_Fields.REQUEST_ID, new FieldMetaData("request_id", TFieldRequirementType.DEFAULT,
|
|
|
120 |
new FieldValueMetaData(TType.I64)));
|
|
|
121 |
put(_Fields.APPLICATION_ID, new FieldMetaData("application_id", TFieldRequirementType.DEFAULT,
|
|
|
122 |
new FieldValueMetaData(TType.I64)));
|
|
|
123 |
put(_Fields.REQUEST_STATUS, new FieldMetaData("requestStatus", TFieldRequirementType.DEFAULT,
|
|
|
124 |
new EnumMetaData(TType.ENUM, RequestStatus.class)));
|
|
|
125 |
put(_Fields.RECEIVING_TIMESTAMP, new FieldMetaData("receiving_timestamp", TFieldRequirementType.DEFAULT,
|
|
|
126 |
new FieldValueMetaData(TType.I64)));
|
|
|
127 |
put(_Fields.SENDING_TIMESTAMP, new FieldMetaData("sending_timestamp", TFieldRequirementType.DEFAULT,
|
|
|
128 |
new FieldValueMetaData(TType.I64)));
|
|
|
129 |
put(_Fields.PARAMS, new FieldMetaData("params", TFieldRequirementType.DEFAULT,
|
|
|
130 |
new ListMetaData(TType.LIST,
|
|
|
131 |
new StructMetaData(TType.STRUCT, Param.class))));
|
|
|
132 |
put(_Fields.MERCHANT_TX_ID, new FieldMetaData("merchant_tx_id", TFieldRequirementType.DEFAULT,
|
|
|
133 |
new FieldValueMetaData(TType.I64)));
|
|
|
134 |
}});
|
|
|
135 |
|
|
|
136 |
static {
|
|
|
137 |
FieldMetaData.addStructMetaDataMap(PaymentRequest.class, metaDataMap);
|
|
|
138 |
}
|
|
|
139 |
|
|
|
140 |
public PaymentRequest() {
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
public PaymentRequest(
|
|
|
144 |
long request_id,
|
|
|
145 |
long application_id,
|
|
|
146 |
RequestStatus requestStatus,
|
|
|
147 |
long receiving_timestamp,
|
|
|
148 |
long sending_timestamp,
|
|
|
149 |
List<Param> params,
|
|
|
150 |
long merchant_tx_id)
|
|
|
151 |
{
|
|
|
152 |
this();
|
|
|
153 |
this.request_id = request_id;
|
|
|
154 |
setRequest_idIsSet(true);
|
|
|
155 |
this.application_id = application_id;
|
|
|
156 |
setApplication_idIsSet(true);
|
|
|
157 |
this.requestStatus = requestStatus;
|
|
|
158 |
this.receiving_timestamp = receiving_timestamp;
|
|
|
159 |
setReceiving_timestampIsSet(true);
|
|
|
160 |
this.sending_timestamp = sending_timestamp;
|
|
|
161 |
setSending_timestampIsSet(true);
|
|
|
162 |
this.params = params;
|
|
|
163 |
this.merchant_tx_id = merchant_tx_id;
|
|
|
164 |
setMerchant_tx_idIsSet(true);
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
/**
|
|
|
168 |
* Performs a deep copy on <i>other</i>.
|
|
|
169 |
*/
|
|
|
170 |
public PaymentRequest(PaymentRequest other) {
|
|
|
171 |
__isset_bit_vector.clear();
|
|
|
172 |
__isset_bit_vector.or(other.__isset_bit_vector);
|
|
|
173 |
this.request_id = other.request_id;
|
|
|
174 |
this.application_id = other.application_id;
|
|
|
175 |
if (other.isSetRequestStatus()) {
|
|
|
176 |
this.requestStatus = other.requestStatus;
|
|
|
177 |
}
|
|
|
178 |
this.receiving_timestamp = other.receiving_timestamp;
|
|
|
179 |
this.sending_timestamp = other.sending_timestamp;
|
|
|
180 |
if (other.isSetParams()) {
|
|
|
181 |
List<Param> __this__params = new ArrayList<Param>();
|
|
|
182 |
for (Param other_element : other.params) {
|
|
|
183 |
__this__params.add(new Param(other_element));
|
|
|
184 |
}
|
|
|
185 |
this.params = __this__params;
|
|
|
186 |
}
|
|
|
187 |
this.merchant_tx_id = other.merchant_tx_id;
|
|
|
188 |
}
|
|
|
189 |
|
|
|
190 |
public PaymentRequest deepCopy() {
|
|
|
191 |
return new PaymentRequest(this);
|
|
|
192 |
}
|
|
|
193 |
|
|
|
194 |
@Deprecated
|
|
|
195 |
public PaymentRequest clone() {
|
|
|
196 |
return new PaymentRequest(this);
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
public long getRequest_id() {
|
|
|
200 |
return this.request_id;
|
|
|
201 |
}
|
|
|
202 |
|
|
|
203 |
public PaymentRequest setRequest_id(long request_id) {
|
|
|
204 |
this.request_id = request_id;
|
|
|
205 |
setRequest_idIsSet(true);
|
|
|
206 |
return this;
|
|
|
207 |
}
|
|
|
208 |
|
|
|
209 |
public void unsetRequest_id() {
|
|
|
210 |
__isset_bit_vector.clear(__REQUEST_ID_ISSET_ID);
|
|
|
211 |
}
|
|
|
212 |
|
|
|
213 |
/** Returns true if field request_id is set (has been asigned a value) and false otherwise */
|
|
|
214 |
public boolean isSetRequest_id() {
|
|
|
215 |
return __isset_bit_vector.get(__REQUEST_ID_ISSET_ID);
|
|
|
216 |
}
|
|
|
217 |
|
|
|
218 |
public void setRequest_idIsSet(boolean value) {
|
|
|
219 |
__isset_bit_vector.set(__REQUEST_ID_ISSET_ID, value);
|
|
|
220 |
}
|
|
|
221 |
|
|
|
222 |
public long getApplication_id() {
|
|
|
223 |
return this.application_id;
|
|
|
224 |
}
|
|
|
225 |
|
|
|
226 |
public PaymentRequest setApplication_id(long application_id) {
|
|
|
227 |
this.application_id = application_id;
|
|
|
228 |
setApplication_idIsSet(true);
|
|
|
229 |
return this;
|
|
|
230 |
}
|
|
|
231 |
|
|
|
232 |
public void unsetApplication_id() {
|
|
|
233 |
__isset_bit_vector.clear(__APPLICATION_ID_ISSET_ID);
|
|
|
234 |
}
|
|
|
235 |
|
|
|
236 |
/** Returns true if field application_id is set (has been asigned a value) and false otherwise */
|
|
|
237 |
public boolean isSetApplication_id() {
|
|
|
238 |
return __isset_bit_vector.get(__APPLICATION_ID_ISSET_ID);
|
|
|
239 |
}
|
|
|
240 |
|
|
|
241 |
public void setApplication_idIsSet(boolean value) {
|
|
|
242 |
__isset_bit_vector.set(__APPLICATION_ID_ISSET_ID, value);
|
|
|
243 |
}
|
|
|
244 |
|
|
|
245 |
/**
|
|
|
246 |
*
|
|
|
247 |
* @see RequestStatus
|
|
|
248 |
*/
|
|
|
249 |
public RequestStatus getRequestStatus() {
|
|
|
250 |
return this.requestStatus;
|
|
|
251 |
}
|
|
|
252 |
|
|
|
253 |
/**
|
|
|
254 |
*
|
|
|
255 |
* @see RequestStatus
|
|
|
256 |
*/
|
|
|
257 |
public PaymentRequest setRequestStatus(RequestStatus requestStatus) {
|
|
|
258 |
this.requestStatus = requestStatus;
|
|
|
259 |
return this;
|
|
|
260 |
}
|
|
|
261 |
|
|
|
262 |
public void unsetRequestStatus() {
|
|
|
263 |
this.requestStatus = null;
|
|
|
264 |
}
|
|
|
265 |
|
|
|
266 |
/** Returns true if field requestStatus is set (has been asigned a value) and false otherwise */
|
|
|
267 |
public boolean isSetRequestStatus() {
|
|
|
268 |
return this.requestStatus != null;
|
|
|
269 |
}
|
|
|
270 |
|
|
|
271 |
public void setRequestStatusIsSet(boolean value) {
|
|
|
272 |
if (!value) {
|
|
|
273 |
this.requestStatus = null;
|
|
|
274 |
}
|
|
|
275 |
}
|
|
|
276 |
|
|
|
277 |
public long getReceiving_timestamp() {
|
|
|
278 |
return this.receiving_timestamp;
|
|
|
279 |
}
|
|
|
280 |
|
|
|
281 |
public PaymentRequest setReceiving_timestamp(long receiving_timestamp) {
|
|
|
282 |
this.receiving_timestamp = receiving_timestamp;
|
|
|
283 |
setReceiving_timestampIsSet(true);
|
|
|
284 |
return this;
|
|
|
285 |
}
|
|
|
286 |
|
|
|
287 |
public void unsetReceiving_timestamp() {
|
|
|
288 |
__isset_bit_vector.clear(__RECEIVING_TIMESTAMP_ISSET_ID);
|
|
|
289 |
}
|
|
|
290 |
|
|
|
291 |
/** Returns true if field receiving_timestamp is set (has been asigned a value) and false otherwise */
|
|
|
292 |
public boolean isSetReceiving_timestamp() {
|
|
|
293 |
return __isset_bit_vector.get(__RECEIVING_TIMESTAMP_ISSET_ID);
|
|
|
294 |
}
|
|
|
295 |
|
|
|
296 |
public void setReceiving_timestampIsSet(boolean value) {
|
|
|
297 |
__isset_bit_vector.set(__RECEIVING_TIMESTAMP_ISSET_ID, value);
|
|
|
298 |
}
|
|
|
299 |
|
|
|
300 |
public long getSending_timestamp() {
|
|
|
301 |
return this.sending_timestamp;
|
|
|
302 |
}
|
|
|
303 |
|
|
|
304 |
public PaymentRequest setSending_timestamp(long sending_timestamp) {
|
|
|
305 |
this.sending_timestamp = sending_timestamp;
|
|
|
306 |
setSending_timestampIsSet(true);
|
|
|
307 |
return this;
|
|
|
308 |
}
|
|
|
309 |
|
|
|
310 |
public void unsetSending_timestamp() {
|
|
|
311 |
__isset_bit_vector.clear(__SENDING_TIMESTAMP_ISSET_ID);
|
|
|
312 |
}
|
|
|
313 |
|
|
|
314 |
/** Returns true if field sending_timestamp is set (has been asigned a value) and false otherwise */
|
|
|
315 |
public boolean isSetSending_timestamp() {
|
|
|
316 |
return __isset_bit_vector.get(__SENDING_TIMESTAMP_ISSET_ID);
|
|
|
317 |
}
|
|
|
318 |
|
|
|
319 |
public void setSending_timestampIsSet(boolean value) {
|
|
|
320 |
__isset_bit_vector.set(__SENDING_TIMESTAMP_ISSET_ID, value);
|
|
|
321 |
}
|
|
|
322 |
|
|
|
323 |
public int getParamsSize() {
|
|
|
324 |
return (this.params == null) ? 0 : this.params.size();
|
|
|
325 |
}
|
|
|
326 |
|
|
|
327 |
public java.util.Iterator<Param> getParamsIterator() {
|
|
|
328 |
return (this.params == null) ? null : this.params.iterator();
|
|
|
329 |
}
|
|
|
330 |
|
|
|
331 |
public void addToParams(Param elem) {
|
|
|
332 |
if (this.params == null) {
|
|
|
333 |
this.params = new ArrayList<Param>();
|
|
|
334 |
}
|
|
|
335 |
this.params.add(elem);
|
|
|
336 |
}
|
|
|
337 |
|
|
|
338 |
public List<Param> getParams() {
|
|
|
339 |
return this.params;
|
|
|
340 |
}
|
|
|
341 |
|
|
|
342 |
public PaymentRequest setParams(List<Param> params) {
|
|
|
343 |
this.params = params;
|
|
|
344 |
return this;
|
|
|
345 |
}
|
|
|
346 |
|
|
|
347 |
public void unsetParams() {
|
|
|
348 |
this.params = null;
|
|
|
349 |
}
|
|
|
350 |
|
|
|
351 |
/** Returns true if field params is set (has been asigned a value) and false otherwise */
|
|
|
352 |
public boolean isSetParams() {
|
|
|
353 |
return this.params != null;
|
|
|
354 |
}
|
|
|
355 |
|
|
|
356 |
public void setParamsIsSet(boolean value) {
|
|
|
357 |
if (!value) {
|
|
|
358 |
this.params = null;
|
|
|
359 |
}
|
|
|
360 |
}
|
|
|
361 |
|
|
|
362 |
public long getMerchant_tx_id() {
|
|
|
363 |
return this.merchant_tx_id;
|
|
|
364 |
}
|
|
|
365 |
|
|
|
366 |
public PaymentRequest setMerchant_tx_id(long merchant_tx_id) {
|
|
|
367 |
this.merchant_tx_id = merchant_tx_id;
|
|
|
368 |
setMerchant_tx_idIsSet(true);
|
|
|
369 |
return this;
|
|
|
370 |
}
|
|
|
371 |
|
|
|
372 |
public void unsetMerchant_tx_id() {
|
|
|
373 |
__isset_bit_vector.clear(__MERCHANT_TX_ID_ISSET_ID);
|
|
|
374 |
}
|
|
|
375 |
|
|
|
376 |
/** Returns true if field merchant_tx_id is set (has been asigned a value) and false otherwise */
|
|
|
377 |
public boolean isSetMerchant_tx_id() {
|
|
|
378 |
return __isset_bit_vector.get(__MERCHANT_TX_ID_ISSET_ID);
|
|
|
379 |
}
|
|
|
380 |
|
|
|
381 |
public void setMerchant_tx_idIsSet(boolean value) {
|
|
|
382 |
__isset_bit_vector.set(__MERCHANT_TX_ID_ISSET_ID, value);
|
|
|
383 |
}
|
|
|
384 |
|
|
|
385 |
public void setFieldValue(_Fields field, Object value) {
|
|
|
386 |
switch (field) {
|
|
|
387 |
case REQUEST_ID:
|
|
|
388 |
if (value == null) {
|
|
|
389 |
unsetRequest_id();
|
|
|
390 |
} else {
|
|
|
391 |
setRequest_id((Long)value);
|
|
|
392 |
}
|
|
|
393 |
break;
|
|
|
394 |
|
|
|
395 |
case APPLICATION_ID:
|
|
|
396 |
if (value == null) {
|
|
|
397 |
unsetApplication_id();
|
|
|
398 |
} else {
|
|
|
399 |
setApplication_id((Long)value);
|
|
|
400 |
}
|
|
|
401 |
break;
|
|
|
402 |
|
|
|
403 |
case REQUEST_STATUS:
|
|
|
404 |
if (value == null) {
|
|
|
405 |
unsetRequestStatus();
|
|
|
406 |
} else {
|
|
|
407 |
setRequestStatus((RequestStatus)value);
|
|
|
408 |
}
|
|
|
409 |
break;
|
|
|
410 |
|
|
|
411 |
case RECEIVING_TIMESTAMP:
|
|
|
412 |
if (value == null) {
|
|
|
413 |
unsetReceiving_timestamp();
|
|
|
414 |
} else {
|
|
|
415 |
setReceiving_timestamp((Long)value);
|
|
|
416 |
}
|
|
|
417 |
break;
|
|
|
418 |
|
|
|
419 |
case SENDING_TIMESTAMP:
|
|
|
420 |
if (value == null) {
|
|
|
421 |
unsetSending_timestamp();
|
|
|
422 |
} else {
|
|
|
423 |
setSending_timestamp((Long)value);
|
|
|
424 |
}
|
|
|
425 |
break;
|
|
|
426 |
|
|
|
427 |
case PARAMS:
|
|
|
428 |
if (value == null) {
|
|
|
429 |
unsetParams();
|
|
|
430 |
} else {
|
|
|
431 |
setParams((List<Param>)value);
|
|
|
432 |
}
|
|
|
433 |
break;
|
|
|
434 |
|
|
|
435 |
case MERCHANT_TX_ID:
|
|
|
436 |
if (value == null) {
|
|
|
437 |
unsetMerchant_tx_id();
|
|
|
438 |
} else {
|
|
|
439 |
setMerchant_tx_id((Long)value);
|
|
|
440 |
}
|
|
|
441 |
break;
|
|
|
442 |
|
|
|
443 |
}
|
|
|
444 |
}
|
|
|
445 |
|
|
|
446 |
public void setFieldValue(int fieldID, Object value) {
|
|
|
447 |
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
|
|
|
448 |
}
|
|
|
449 |
|
|
|
450 |
public Object getFieldValue(_Fields field) {
|
|
|
451 |
switch (field) {
|
|
|
452 |
case REQUEST_ID:
|
|
|
453 |
return new Long(getRequest_id());
|
|
|
454 |
|
|
|
455 |
case APPLICATION_ID:
|
|
|
456 |
return new Long(getApplication_id());
|
|
|
457 |
|
|
|
458 |
case REQUEST_STATUS:
|
|
|
459 |
return getRequestStatus();
|
|
|
460 |
|
|
|
461 |
case RECEIVING_TIMESTAMP:
|
|
|
462 |
return new Long(getReceiving_timestamp());
|
|
|
463 |
|
|
|
464 |
case SENDING_TIMESTAMP:
|
|
|
465 |
return new Long(getSending_timestamp());
|
|
|
466 |
|
|
|
467 |
case PARAMS:
|
|
|
468 |
return getParams();
|
|
|
469 |
|
|
|
470 |
case MERCHANT_TX_ID:
|
|
|
471 |
return new Long(getMerchant_tx_id());
|
|
|
472 |
|
|
|
473 |
}
|
|
|
474 |
throw new IllegalStateException();
|
|
|
475 |
}
|
|
|
476 |
|
|
|
477 |
public Object getFieldValue(int fieldId) {
|
|
|
478 |
return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
|
|
|
479 |
}
|
|
|
480 |
|
|
|
481 |
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
|
|
|
482 |
public boolean isSet(_Fields field) {
|
|
|
483 |
switch (field) {
|
|
|
484 |
case REQUEST_ID:
|
|
|
485 |
return isSetRequest_id();
|
|
|
486 |
case APPLICATION_ID:
|
|
|
487 |
return isSetApplication_id();
|
|
|
488 |
case REQUEST_STATUS:
|
|
|
489 |
return isSetRequestStatus();
|
|
|
490 |
case RECEIVING_TIMESTAMP:
|
|
|
491 |
return isSetReceiving_timestamp();
|
|
|
492 |
case SENDING_TIMESTAMP:
|
|
|
493 |
return isSetSending_timestamp();
|
|
|
494 |
case PARAMS:
|
|
|
495 |
return isSetParams();
|
|
|
496 |
case MERCHANT_TX_ID:
|
|
|
497 |
return isSetMerchant_tx_id();
|
|
|
498 |
}
|
|
|
499 |
throw new IllegalStateException();
|
|
|
500 |
}
|
|
|
501 |
|
|
|
502 |
public boolean isSet(int fieldID) {
|
|
|
503 |
return isSet(_Fields.findByThriftIdOrThrow(fieldID));
|
|
|
504 |
}
|
|
|
505 |
|
|
|
506 |
@Override
|
|
|
507 |
public boolean equals(Object that) {
|
|
|
508 |
if (that == null)
|
|
|
509 |
return false;
|
|
|
510 |
if (that instanceof PaymentRequest)
|
|
|
511 |
return this.equals((PaymentRequest)that);
|
|
|
512 |
return false;
|
|
|
513 |
}
|
|
|
514 |
|
|
|
515 |
public boolean equals(PaymentRequest that) {
|
|
|
516 |
if (that == null)
|
|
|
517 |
return false;
|
|
|
518 |
|
|
|
519 |
boolean this_present_request_id = true;
|
|
|
520 |
boolean that_present_request_id = true;
|
|
|
521 |
if (this_present_request_id || that_present_request_id) {
|
|
|
522 |
if (!(this_present_request_id && that_present_request_id))
|
|
|
523 |
return false;
|
|
|
524 |
if (this.request_id != that.request_id)
|
|
|
525 |
return false;
|
|
|
526 |
}
|
|
|
527 |
|
|
|
528 |
boolean this_present_application_id = true;
|
|
|
529 |
boolean that_present_application_id = true;
|
|
|
530 |
if (this_present_application_id || that_present_application_id) {
|
|
|
531 |
if (!(this_present_application_id && that_present_application_id))
|
|
|
532 |
return false;
|
|
|
533 |
if (this.application_id != that.application_id)
|
|
|
534 |
return false;
|
|
|
535 |
}
|
|
|
536 |
|
|
|
537 |
boolean this_present_requestStatus = true && this.isSetRequestStatus();
|
|
|
538 |
boolean that_present_requestStatus = true && that.isSetRequestStatus();
|
|
|
539 |
if (this_present_requestStatus || that_present_requestStatus) {
|
|
|
540 |
if (!(this_present_requestStatus && that_present_requestStatus))
|
|
|
541 |
return false;
|
|
|
542 |
if (!this.requestStatus.equals(that.requestStatus))
|
|
|
543 |
return false;
|
|
|
544 |
}
|
|
|
545 |
|
|
|
546 |
boolean this_present_receiving_timestamp = true;
|
|
|
547 |
boolean that_present_receiving_timestamp = true;
|
|
|
548 |
if (this_present_receiving_timestamp || that_present_receiving_timestamp) {
|
|
|
549 |
if (!(this_present_receiving_timestamp && that_present_receiving_timestamp))
|
|
|
550 |
return false;
|
|
|
551 |
if (this.receiving_timestamp != that.receiving_timestamp)
|
|
|
552 |
return false;
|
|
|
553 |
}
|
|
|
554 |
|
|
|
555 |
boolean this_present_sending_timestamp = true;
|
|
|
556 |
boolean that_present_sending_timestamp = true;
|
|
|
557 |
if (this_present_sending_timestamp || that_present_sending_timestamp) {
|
|
|
558 |
if (!(this_present_sending_timestamp && that_present_sending_timestamp))
|
|
|
559 |
return false;
|
|
|
560 |
if (this.sending_timestamp != that.sending_timestamp)
|
|
|
561 |
return false;
|
|
|
562 |
}
|
|
|
563 |
|
|
|
564 |
boolean this_present_params = true && this.isSetParams();
|
|
|
565 |
boolean that_present_params = true && that.isSetParams();
|
|
|
566 |
if (this_present_params || that_present_params) {
|
|
|
567 |
if (!(this_present_params && that_present_params))
|
|
|
568 |
return false;
|
|
|
569 |
if (!this.params.equals(that.params))
|
|
|
570 |
return false;
|
|
|
571 |
}
|
|
|
572 |
|
|
|
573 |
boolean this_present_merchant_tx_id = true;
|
|
|
574 |
boolean that_present_merchant_tx_id = true;
|
|
|
575 |
if (this_present_merchant_tx_id || that_present_merchant_tx_id) {
|
|
|
576 |
if (!(this_present_merchant_tx_id && that_present_merchant_tx_id))
|
|
|
577 |
return false;
|
|
|
578 |
if (this.merchant_tx_id != that.merchant_tx_id)
|
|
|
579 |
return false;
|
|
|
580 |
}
|
|
|
581 |
|
|
|
582 |
return true;
|
|
|
583 |
}
|
|
|
584 |
|
|
|
585 |
@Override
|
|
|
586 |
public int hashCode() {
|
|
|
587 |
return 0;
|
|
|
588 |
}
|
|
|
589 |
|
|
|
590 |
public int compareTo(PaymentRequest other) {
|
|
|
591 |
if (!getClass().equals(other.getClass())) {
|
|
|
592 |
return getClass().getName().compareTo(other.getClass().getName());
|
|
|
593 |
}
|
|
|
594 |
|
|
|
595 |
int lastComparison = 0;
|
|
|
596 |
PaymentRequest typedOther = (PaymentRequest)other;
|
|
|
597 |
|
|
|
598 |
lastComparison = Boolean.valueOf(isSetRequest_id()).compareTo(isSetRequest_id());
|
|
|
599 |
if (lastComparison != 0) {
|
|
|
600 |
return lastComparison;
|
|
|
601 |
}
|
|
|
602 |
lastComparison = TBaseHelper.compareTo(request_id, typedOther.request_id);
|
|
|
603 |
if (lastComparison != 0) {
|
|
|
604 |
return lastComparison;
|
|
|
605 |
}
|
|
|
606 |
lastComparison = Boolean.valueOf(isSetApplication_id()).compareTo(isSetApplication_id());
|
|
|
607 |
if (lastComparison != 0) {
|
|
|
608 |
return lastComparison;
|
|
|
609 |
}
|
|
|
610 |
lastComparison = TBaseHelper.compareTo(application_id, typedOther.application_id);
|
|
|
611 |
if (lastComparison != 0) {
|
|
|
612 |
return lastComparison;
|
|
|
613 |
}
|
|
|
614 |
lastComparison = Boolean.valueOf(isSetRequestStatus()).compareTo(isSetRequestStatus());
|
|
|
615 |
if (lastComparison != 0) {
|
|
|
616 |
return lastComparison;
|
|
|
617 |
}
|
|
|
618 |
lastComparison = TBaseHelper.compareTo(requestStatus, typedOther.requestStatus);
|
|
|
619 |
if (lastComparison != 0) {
|
|
|
620 |
return lastComparison;
|
|
|
621 |
}
|
|
|
622 |
lastComparison = Boolean.valueOf(isSetReceiving_timestamp()).compareTo(isSetReceiving_timestamp());
|
|
|
623 |
if (lastComparison != 0) {
|
|
|
624 |
return lastComparison;
|
|
|
625 |
}
|
|
|
626 |
lastComparison = TBaseHelper.compareTo(receiving_timestamp, typedOther.receiving_timestamp);
|
|
|
627 |
if (lastComparison != 0) {
|
|
|
628 |
return lastComparison;
|
|
|
629 |
}
|
|
|
630 |
lastComparison = Boolean.valueOf(isSetSending_timestamp()).compareTo(isSetSending_timestamp());
|
|
|
631 |
if (lastComparison != 0) {
|
|
|
632 |
return lastComparison;
|
|
|
633 |
}
|
|
|
634 |
lastComparison = TBaseHelper.compareTo(sending_timestamp, typedOther.sending_timestamp);
|
|
|
635 |
if (lastComparison != 0) {
|
|
|
636 |
return lastComparison;
|
|
|
637 |
}
|
|
|
638 |
lastComparison = Boolean.valueOf(isSetParams()).compareTo(isSetParams());
|
|
|
639 |
if (lastComparison != 0) {
|
|
|
640 |
return lastComparison;
|
|
|
641 |
}
|
|
|
642 |
lastComparison = TBaseHelper.compareTo(params, typedOther.params);
|
|
|
643 |
if (lastComparison != 0) {
|
|
|
644 |
return lastComparison;
|
|
|
645 |
}
|
|
|
646 |
lastComparison = Boolean.valueOf(isSetMerchant_tx_id()).compareTo(isSetMerchant_tx_id());
|
|
|
647 |
if (lastComparison != 0) {
|
|
|
648 |
return lastComparison;
|
|
|
649 |
}
|
|
|
650 |
lastComparison = TBaseHelper.compareTo(merchant_tx_id, typedOther.merchant_tx_id);
|
|
|
651 |
if (lastComparison != 0) {
|
|
|
652 |
return lastComparison;
|
|
|
653 |
}
|
|
|
654 |
return 0;
|
|
|
655 |
}
|
|
|
656 |
|
|
|
657 |
public void read(TProtocol iprot) throws TException {
|
|
|
658 |
TField field;
|
|
|
659 |
iprot.readStructBegin();
|
|
|
660 |
while (true)
|
|
|
661 |
{
|
|
|
662 |
field = iprot.readFieldBegin();
|
|
|
663 |
if (field.type == TType.STOP) {
|
|
|
664 |
break;
|
|
|
665 |
}
|
|
|
666 |
_Fields fieldId = _Fields.findByThriftId(field.id);
|
|
|
667 |
if (fieldId == null) {
|
|
|
668 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
669 |
} else {
|
|
|
670 |
switch (fieldId) {
|
|
|
671 |
case REQUEST_ID:
|
|
|
672 |
if (field.type == TType.I64) {
|
|
|
673 |
this.request_id = iprot.readI64();
|
|
|
674 |
setRequest_idIsSet(true);
|
|
|
675 |
} else {
|
|
|
676 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
677 |
}
|
|
|
678 |
break;
|
|
|
679 |
case APPLICATION_ID:
|
|
|
680 |
if (field.type == TType.I64) {
|
|
|
681 |
this.application_id = iprot.readI64();
|
|
|
682 |
setApplication_idIsSet(true);
|
|
|
683 |
} else {
|
|
|
684 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
685 |
}
|
|
|
686 |
break;
|
|
|
687 |
case REQUEST_STATUS:
|
|
|
688 |
if (field.type == TType.I32) {
|
|
|
689 |
this.requestStatus = RequestStatus.findByValue(iprot.readI32());
|
|
|
690 |
} else {
|
|
|
691 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
692 |
}
|
|
|
693 |
break;
|
|
|
694 |
case RECEIVING_TIMESTAMP:
|
|
|
695 |
if (field.type == TType.I64) {
|
|
|
696 |
this.receiving_timestamp = iprot.readI64();
|
|
|
697 |
setReceiving_timestampIsSet(true);
|
|
|
698 |
} else {
|
|
|
699 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
700 |
}
|
|
|
701 |
break;
|
|
|
702 |
case SENDING_TIMESTAMP:
|
|
|
703 |
if (field.type == TType.I64) {
|
|
|
704 |
this.sending_timestamp = iprot.readI64();
|
|
|
705 |
setSending_timestampIsSet(true);
|
|
|
706 |
} else {
|
|
|
707 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
708 |
}
|
|
|
709 |
break;
|
|
|
710 |
case PARAMS:
|
|
|
711 |
if (field.type == TType.LIST) {
|
|
|
712 |
{
|
| 420 |
ashish |
713 |
TList _list10 = iprot.readListBegin();
|
|
|
714 |
this.params = new ArrayList<Param>(_list10.size);
|
|
|
715 |
for (int _i11 = 0; _i11 < _list10.size; ++_i11)
|
| 123 |
ashish |
716 |
{
|
| 420 |
ashish |
717 |
Param _elem12;
|
|
|
718 |
_elem12 = new Param();
|
|
|
719 |
_elem12.read(iprot);
|
|
|
720 |
this.params.add(_elem12);
|
| 123 |
ashish |
721 |
}
|
|
|
722 |
iprot.readListEnd();
|
|
|
723 |
}
|
|
|
724 |
} else {
|
|
|
725 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
726 |
}
|
|
|
727 |
break;
|
|
|
728 |
case MERCHANT_TX_ID:
|
|
|
729 |
if (field.type == TType.I64) {
|
|
|
730 |
this.merchant_tx_id = iprot.readI64();
|
|
|
731 |
setMerchant_tx_idIsSet(true);
|
|
|
732 |
} else {
|
|
|
733 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
734 |
}
|
|
|
735 |
break;
|
|
|
736 |
}
|
|
|
737 |
iprot.readFieldEnd();
|
|
|
738 |
}
|
|
|
739 |
}
|
|
|
740 |
iprot.readStructEnd();
|
|
|
741 |
validate();
|
|
|
742 |
}
|
|
|
743 |
|
|
|
744 |
public void write(TProtocol oprot) throws TException {
|
|
|
745 |
validate();
|
|
|
746 |
|
|
|
747 |
oprot.writeStructBegin(STRUCT_DESC);
|
|
|
748 |
oprot.writeFieldBegin(REQUEST_ID_FIELD_DESC);
|
|
|
749 |
oprot.writeI64(this.request_id);
|
|
|
750 |
oprot.writeFieldEnd();
|
|
|
751 |
oprot.writeFieldBegin(APPLICATION_ID_FIELD_DESC);
|
|
|
752 |
oprot.writeI64(this.application_id);
|
|
|
753 |
oprot.writeFieldEnd();
|
|
|
754 |
if (this.requestStatus != null) {
|
|
|
755 |
oprot.writeFieldBegin(REQUEST_STATUS_FIELD_DESC);
|
|
|
756 |
oprot.writeI32(this.requestStatus.getValue());
|
|
|
757 |
oprot.writeFieldEnd();
|
|
|
758 |
}
|
|
|
759 |
oprot.writeFieldBegin(RECEIVING_TIMESTAMP_FIELD_DESC);
|
|
|
760 |
oprot.writeI64(this.receiving_timestamp);
|
|
|
761 |
oprot.writeFieldEnd();
|
|
|
762 |
oprot.writeFieldBegin(SENDING_TIMESTAMP_FIELD_DESC);
|
|
|
763 |
oprot.writeI64(this.sending_timestamp);
|
|
|
764 |
oprot.writeFieldEnd();
|
|
|
765 |
if (this.params != null) {
|
|
|
766 |
oprot.writeFieldBegin(PARAMS_FIELD_DESC);
|
|
|
767 |
{
|
|
|
768 |
oprot.writeListBegin(new TList(TType.STRUCT, this.params.size()));
|
| 420 |
ashish |
769 |
for (Param _iter13 : this.params)
|
| 123 |
ashish |
770 |
{
|
| 420 |
ashish |
771 |
_iter13.write(oprot);
|
| 123 |
ashish |
772 |
}
|
|
|
773 |
oprot.writeListEnd();
|
|
|
774 |
}
|
|
|
775 |
oprot.writeFieldEnd();
|
|
|
776 |
}
|
|
|
777 |
oprot.writeFieldBegin(MERCHANT_TX_ID_FIELD_DESC);
|
|
|
778 |
oprot.writeI64(this.merchant_tx_id);
|
|
|
779 |
oprot.writeFieldEnd();
|
|
|
780 |
oprot.writeFieldStop();
|
|
|
781 |
oprot.writeStructEnd();
|
|
|
782 |
}
|
|
|
783 |
|
|
|
784 |
@Override
|
|
|
785 |
public String toString() {
|
|
|
786 |
StringBuilder sb = new StringBuilder("PaymentRequest(");
|
|
|
787 |
boolean first = true;
|
|
|
788 |
|
|
|
789 |
sb.append("request_id:");
|
|
|
790 |
sb.append(this.request_id);
|
|
|
791 |
first = false;
|
|
|
792 |
if (!first) sb.append(", ");
|
|
|
793 |
sb.append("application_id:");
|
|
|
794 |
sb.append(this.application_id);
|
|
|
795 |
first = false;
|
|
|
796 |
if (!first) sb.append(", ");
|
|
|
797 |
sb.append("requestStatus:");
|
|
|
798 |
if (this.requestStatus == null) {
|
|
|
799 |
sb.append("null");
|
|
|
800 |
} else {
|
|
|
801 |
String requestStatus_name = requestStatus.name();
|
|
|
802 |
if (requestStatus_name != null) {
|
|
|
803 |
sb.append(requestStatus_name);
|
|
|
804 |
sb.append(" (");
|
|
|
805 |
}
|
|
|
806 |
sb.append(this.requestStatus);
|
|
|
807 |
if (requestStatus_name != null) {
|
|
|
808 |
sb.append(")");
|
|
|
809 |
}
|
|
|
810 |
}
|
|
|
811 |
first = false;
|
|
|
812 |
if (!first) sb.append(", ");
|
|
|
813 |
sb.append("receiving_timestamp:");
|
|
|
814 |
sb.append(this.receiving_timestamp);
|
|
|
815 |
first = false;
|
|
|
816 |
if (!first) sb.append(", ");
|
|
|
817 |
sb.append("sending_timestamp:");
|
|
|
818 |
sb.append(this.sending_timestamp);
|
|
|
819 |
first = false;
|
|
|
820 |
if (!first) sb.append(", ");
|
|
|
821 |
sb.append("params:");
|
|
|
822 |
if (this.params == null) {
|
|
|
823 |
sb.append("null");
|
|
|
824 |
} else {
|
|
|
825 |
sb.append(this.params);
|
|
|
826 |
}
|
|
|
827 |
first = false;
|
|
|
828 |
if (!first) sb.append(", ");
|
|
|
829 |
sb.append("merchant_tx_id:");
|
|
|
830 |
sb.append(this.merchant_tx_id);
|
|
|
831 |
first = false;
|
|
|
832 |
sb.append(")");
|
|
|
833 |
return sb.toString();
|
|
|
834 |
}
|
|
|
835 |
|
|
|
836 |
public void validate() throws TException {
|
|
|
837 |
// check for required fields
|
|
|
838 |
}
|
|
|
839 |
|
|
|
840 |
}
|
|
|
841 |
|