| 6000 |
mandeep.dh |
1 |
/**
|
|
|
2 |
* Autogenerated by Thrift Compiler (0.7.0)
|
|
|
3 |
*
|
|
|
4 |
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
|
5 |
*/
|
|
|
6 |
package in.shop2020.model.v1.order;
|
|
|
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.nio.ByteBuffer;
|
|
|
19 |
import java.util.Arrays;
|
|
|
20 |
import org.slf4j.Logger;
|
|
|
21 |
import org.slf4j.LoggerFactory;
|
|
|
22 |
|
|
|
23 |
public class RechargeResponse implements org.apache.thrift.TBase<RechargeResponse, RechargeResponse._Fields>, java.io.Serializable, Cloneable {
|
|
|
24 |
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RechargeResponse");
|
|
|
25 |
|
|
|
26 |
private static final org.apache.thrift.protocol.TField NEW_COUPON_CREATED_FIELD_DESC = new org.apache.thrift.protocol.TField("newCouponCreated", org.apache.thrift.protocol.TType.STRUCT, (short)1);
|
|
|
27 |
private static final org.apache.thrift.protocol.TField IS_SUCCESSFUL_FIELD_DESC = new org.apache.thrift.protocol.TField("isSuccessful", org.apache.thrift.protocol.TType.BOOL, (short)2);
|
|
|
28 |
private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)3);
|
|
|
29 |
private static final org.apache.thrift.protocol.TField INVALID_COUPONS_FIELD_DESC = new org.apache.thrift.protocol.TField("invalidCoupons", org.apache.thrift.protocol.TType.LIST, (short)4);
|
|
|
30 |
|
|
|
31 |
private RechargeCoupon newCouponCreated; // required
|
|
|
32 |
private boolean isSuccessful; // required
|
|
|
33 |
private String errorMessage; // required
|
|
|
34 |
private List<RechargeCoupon> invalidCoupons; // required
|
|
|
35 |
|
|
|
36 |
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
|
|
37 |
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
|
|
38 |
NEW_COUPON_CREATED((short)1, "newCouponCreated"),
|
|
|
39 |
IS_SUCCESSFUL((short)2, "isSuccessful"),
|
|
|
40 |
ERROR_MESSAGE((short)3, "errorMessage"),
|
|
|
41 |
INVALID_COUPONS((short)4, "invalidCoupons");
|
|
|
42 |
|
|
|
43 |
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
|
|
44 |
|
|
|
45 |
static {
|
|
|
46 |
for (_Fields field : EnumSet.allOf(_Fields.class)) {
|
|
|
47 |
byName.put(field.getFieldName(), field);
|
|
|
48 |
}
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
/**
|
|
|
52 |
* Find the _Fields constant that matches fieldId, or null if its not found.
|
|
|
53 |
*/
|
|
|
54 |
public static _Fields findByThriftId(int fieldId) {
|
|
|
55 |
switch(fieldId) {
|
|
|
56 |
case 1: // NEW_COUPON_CREATED
|
|
|
57 |
return NEW_COUPON_CREATED;
|
|
|
58 |
case 2: // IS_SUCCESSFUL
|
|
|
59 |
return IS_SUCCESSFUL;
|
|
|
60 |
case 3: // ERROR_MESSAGE
|
|
|
61 |
return ERROR_MESSAGE;
|
|
|
62 |
case 4: // INVALID_COUPONS
|
|
|
63 |
return INVALID_COUPONS;
|
|
|
64 |
default:
|
|
|
65 |
return null;
|
|
|
66 |
}
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
/**
|
|
|
70 |
* Find the _Fields constant that matches fieldId, throwing an exception
|
|
|
71 |
* if it is not found.
|
|
|
72 |
*/
|
|
|
73 |
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
|
|
74 |
_Fields fields = findByThriftId(fieldId);
|
|
|
75 |
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
|
|
76 |
return fields;
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
/**
|
|
|
80 |
* Find the _Fields constant that matches name, or null if its not found.
|
|
|
81 |
*/
|
|
|
82 |
public static _Fields findByName(String name) {
|
|
|
83 |
return byName.get(name);
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
private final short _thriftId;
|
|
|
87 |
private final String _fieldName;
|
|
|
88 |
|
|
|
89 |
_Fields(short thriftId, String fieldName) {
|
|
|
90 |
_thriftId = thriftId;
|
|
|
91 |
_fieldName = fieldName;
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
public short getThriftFieldId() {
|
|
|
95 |
return _thriftId;
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
public String getFieldName() {
|
|
|
99 |
return _fieldName;
|
|
|
100 |
}
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
// isset id assignments
|
|
|
104 |
private static final int __ISSUCCESSFUL_ISSET_ID = 0;
|
|
|
105 |
private BitSet __isset_bit_vector = new BitSet(1);
|
|
|
106 |
|
|
|
107 |
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
|
|
|
108 |
static {
|
|
|
109 |
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
|
|
|
110 |
tmpMap.put(_Fields.NEW_COUPON_CREATED, new org.apache.thrift.meta_data.FieldMetaData("newCouponCreated", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
111 |
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RechargeCoupon.class)));
|
|
|
112 |
tmpMap.put(_Fields.IS_SUCCESSFUL, new org.apache.thrift.meta_data.FieldMetaData("isSuccessful", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
113 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
|
|
|
114 |
tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
115 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
|
|
116 |
tmpMap.put(_Fields.INVALID_COUPONS, new org.apache.thrift.meta_data.FieldMetaData("invalidCoupons", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
117 |
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
|
|
|
118 |
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RechargeCoupon.class))));
|
|
|
119 |
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
|
|
120 |
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RechargeResponse.class, metaDataMap);
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
public RechargeResponse() {
|
|
|
124 |
}
|
|
|
125 |
|
|
|
126 |
public RechargeResponse(
|
|
|
127 |
RechargeCoupon newCouponCreated,
|
|
|
128 |
boolean isSuccessful,
|
|
|
129 |
String errorMessage,
|
|
|
130 |
List<RechargeCoupon> invalidCoupons)
|
|
|
131 |
{
|
|
|
132 |
this();
|
|
|
133 |
this.newCouponCreated = newCouponCreated;
|
|
|
134 |
this.isSuccessful = isSuccessful;
|
|
|
135 |
setIsSuccessfulIsSet(true);
|
|
|
136 |
this.errorMessage = errorMessage;
|
|
|
137 |
this.invalidCoupons = invalidCoupons;
|
|
|
138 |
}
|
|
|
139 |
|
|
|
140 |
/**
|
|
|
141 |
* Performs a deep copy on <i>other</i>.
|
|
|
142 |
*/
|
|
|
143 |
public RechargeResponse(RechargeResponse other) {
|
|
|
144 |
__isset_bit_vector.clear();
|
|
|
145 |
__isset_bit_vector.or(other.__isset_bit_vector);
|
|
|
146 |
if (other.isSetNewCouponCreated()) {
|
|
|
147 |
this.newCouponCreated = new RechargeCoupon(other.newCouponCreated);
|
|
|
148 |
}
|
|
|
149 |
this.isSuccessful = other.isSuccessful;
|
|
|
150 |
if (other.isSetErrorMessage()) {
|
|
|
151 |
this.errorMessage = other.errorMessage;
|
|
|
152 |
}
|
|
|
153 |
if (other.isSetInvalidCoupons()) {
|
|
|
154 |
List<RechargeCoupon> __this__invalidCoupons = new ArrayList<RechargeCoupon>();
|
|
|
155 |
for (RechargeCoupon other_element : other.invalidCoupons) {
|
|
|
156 |
__this__invalidCoupons.add(new RechargeCoupon(other_element));
|
|
|
157 |
}
|
|
|
158 |
this.invalidCoupons = __this__invalidCoupons;
|
|
|
159 |
}
|
|
|
160 |
}
|
|
|
161 |
|
|
|
162 |
public RechargeResponse deepCopy() {
|
|
|
163 |
return new RechargeResponse(this);
|
|
|
164 |
}
|
|
|
165 |
|
|
|
166 |
@Override
|
|
|
167 |
public void clear() {
|
|
|
168 |
this.newCouponCreated = null;
|
|
|
169 |
setIsSuccessfulIsSet(false);
|
|
|
170 |
this.isSuccessful = false;
|
|
|
171 |
this.errorMessage = null;
|
|
|
172 |
this.invalidCoupons = null;
|
|
|
173 |
}
|
|
|
174 |
|
|
|
175 |
public RechargeCoupon getNewCouponCreated() {
|
|
|
176 |
return this.newCouponCreated;
|
|
|
177 |
}
|
|
|
178 |
|
|
|
179 |
public void setNewCouponCreated(RechargeCoupon newCouponCreated) {
|
|
|
180 |
this.newCouponCreated = newCouponCreated;
|
|
|
181 |
}
|
|
|
182 |
|
|
|
183 |
public void unsetNewCouponCreated() {
|
|
|
184 |
this.newCouponCreated = null;
|
|
|
185 |
}
|
|
|
186 |
|
|
|
187 |
/** Returns true if field newCouponCreated is set (has been assigned a value) and false otherwise */
|
|
|
188 |
public boolean isSetNewCouponCreated() {
|
|
|
189 |
return this.newCouponCreated != null;
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
public void setNewCouponCreatedIsSet(boolean value) {
|
|
|
193 |
if (!value) {
|
|
|
194 |
this.newCouponCreated = null;
|
|
|
195 |
}
|
|
|
196 |
}
|
|
|
197 |
|
|
|
198 |
public boolean isIsSuccessful() {
|
|
|
199 |
return this.isSuccessful;
|
|
|
200 |
}
|
|
|
201 |
|
|
|
202 |
public void setIsSuccessful(boolean isSuccessful) {
|
|
|
203 |
this.isSuccessful = isSuccessful;
|
|
|
204 |
setIsSuccessfulIsSet(true);
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
public void unsetIsSuccessful() {
|
|
|
208 |
__isset_bit_vector.clear(__ISSUCCESSFUL_ISSET_ID);
|
|
|
209 |
}
|
|
|
210 |
|
|
|
211 |
/** Returns true if field isSuccessful is set (has been assigned a value) and false otherwise */
|
|
|
212 |
public boolean isSetIsSuccessful() {
|
|
|
213 |
return __isset_bit_vector.get(__ISSUCCESSFUL_ISSET_ID);
|
|
|
214 |
}
|
|
|
215 |
|
|
|
216 |
public void setIsSuccessfulIsSet(boolean value) {
|
|
|
217 |
__isset_bit_vector.set(__ISSUCCESSFUL_ISSET_ID, value);
|
|
|
218 |
}
|
|
|
219 |
|
|
|
220 |
public String getErrorMessage() {
|
|
|
221 |
return this.errorMessage;
|
|
|
222 |
}
|
|
|
223 |
|
|
|
224 |
public void setErrorMessage(String errorMessage) {
|
|
|
225 |
this.errorMessage = errorMessage;
|
|
|
226 |
}
|
|
|
227 |
|
|
|
228 |
public void unsetErrorMessage() {
|
|
|
229 |
this.errorMessage = null;
|
|
|
230 |
}
|
|
|
231 |
|
|
|
232 |
/** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */
|
|
|
233 |
public boolean isSetErrorMessage() {
|
|
|
234 |
return this.errorMessage != null;
|
|
|
235 |
}
|
|
|
236 |
|
|
|
237 |
public void setErrorMessageIsSet(boolean value) {
|
|
|
238 |
if (!value) {
|
|
|
239 |
this.errorMessage = null;
|
|
|
240 |
}
|
|
|
241 |
}
|
|
|
242 |
|
|
|
243 |
public int getInvalidCouponsSize() {
|
|
|
244 |
return (this.invalidCoupons == null) ? 0 : this.invalidCoupons.size();
|
|
|
245 |
}
|
|
|
246 |
|
|
|
247 |
public java.util.Iterator<RechargeCoupon> getInvalidCouponsIterator() {
|
|
|
248 |
return (this.invalidCoupons == null) ? null : this.invalidCoupons.iterator();
|
|
|
249 |
}
|
|
|
250 |
|
|
|
251 |
public void addToInvalidCoupons(RechargeCoupon elem) {
|
|
|
252 |
if (this.invalidCoupons == null) {
|
|
|
253 |
this.invalidCoupons = new ArrayList<RechargeCoupon>();
|
|
|
254 |
}
|
|
|
255 |
this.invalidCoupons.add(elem);
|
|
|
256 |
}
|
|
|
257 |
|
|
|
258 |
public List<RechargeCoupon> getInvalidCoupons() {
|
|
|
259 |
return this.invalidCoupons;
|
|
|
260 |
}
|
|
|
261 |
|
|
|
262 |
public void setInvalidCoupons(List<RechargeCoupon> invalidCoupons) {
|
|
|
263 |
this.invalidCoupons = invalidCoupons;
|
|
|
264 |
}
|
|
|
265 |
|
|
|
266 |
public void unsetInvalidCoupons() {
|
|
|
267 |
this.invalidCoupons = null;
|
|
|
268 |
}
|
|
|
269 |
|
|
|
270 |
/** Returns true if field invalidCoupons is set (has been assigned a value) and false otherwise */
|
|
|
271 |
public boolean isSetInvalidCoupons() {
|
|
|
272 |
return this.invalidCoupons != null;
|
|
|
273 |
}
|
|
|
274 |
|
|
|
275 |
public void setInvalidCouponsIsSet(boolean value) {
|
|
|
276 |
if (!value) {
|
|
|
277 |
this.invalidCoupons = null;
|
|
|
278 |
}
|
|
|
279 |
}
|
|
|
280 |
|
|
|
281 |
public void setFieldValue(_Fields field, Object value) {
|
|
|
282 |
switch (field) {
|
|
|
283 |
case NEW_COUPON_CREATED:
|
|
|
284 |
if (value == null) {
|
|
|
285 |
unsetNewCouponCreated();
|
|
|
286 |
} else {
|
|
|
287 |
setNewCouponCreated((RechargeCoupon)value);
|
|
|
288 |
}
|
|
|
289 |
break;
|
|
|
290 |
|
|
|
291 |
case IS_SUCCESSFUL:
|
|
|
292 |
if (value == null) {
|
|
|
293 |
unsetIsSuccessful();
|
|
|
294 |
} else {
|
|
|
295 |
setIsSuccessful((Boolean)value);
|
|
|
296 |
}
|
|
|
297 |
break;
|
|
|
298 |
|
|
|
299 |
case ERROR_MESSAGE:
|
|
|
300 |
if (value == null) {
|
|
|
301 |
unsetErrorMessage();
|
|
|
302 |
} else {
|
|
|
303 |
setErrorMessage((String)value);
|
|
|
304 |
}
|
|
|
305 |
break;
|
|
|
306 |
|
|
|
307 |
case INVALID_COUPONS:
|
|
|
308 |
if (value == null) {
|
|
|
309 |
unsetInvalidCoupons();
|
|
|
310 |
} else {
|
|
|
311 |
setInvalidCoupons((List<RechargeCoupon>)value);
|
|
|
312 |
}
|
|
|
313 |
break;
|
|
|
314 |
|
|
|
315 |
}
|
|
|
316 |
}
|
|
|
317 |
|
|
|
318 |
public Object getFieldValue(_Fields field) {
|
|
|
319 |
switch (field) {
|
|
|
320 |
case NEW_COUPON_CREATED:
|
|
|
321 |
return getNewCouponCreated();
|
|
|
322 |
|
|
|
323 |
case IS_SUCCESSFUL:
|
|
|
324 |
return Boolean.valueOf(isIsSuccessful());
|
|
|
325 |
|
|
|
326 |
case ERROR_MESSAGE:
|
|
|
327 |
return getErrorMessage();
|
|
|
328 |
|
|
|
329 |
case INVALID_COUPONS:
|
|
|
330 |
return getInvalidCoupons();
|
|
|
331 |
|
|
|
332 |
}
|
|
|
333 |
throw new IllegalStateException();
|
|
|
334 |
}
|
|
|
335 |
|
|
|
336 |
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
|
|
|
337 |
public boolean isSet(_Fields field) {
|
|
|
338 |
if (field == null) {
|
|
|
339 |
throw new IllegalArgumentException();
|
|
|
340 |
}
|
|
|
341 |
|
|
|
342 |
switch (field) {
|
|
|
343 |
case NEW_COUPON_CREATED:
|
|
|
344 |
return isSetNewCouponCreated();
|
|
|
345 |
case IS_SUCCESSFUL:
|
|
|
346 |
return isSetIsSuccessful();
|
|
|
347 |
case ERROR_MESSAGE:
|
|
|
348 |
return isSetErrorMessage();
|
|
|
349 |
case INVALID_COUPONS:
|
|
|
350 |
return isSetInvalidCoupons();
|
|
|
351 |
}
|
|
|
352 |
throw new IllegalStateException();
|
|
|
353 |
}
|
|
|
354 |
|
|
|
355 |
@Override
|
|
|
356 |
public boolean equals(Object that) {
|
|
|
357 |
if (that == null)
|
|
|
358 |
return false;
|
|
|
359 |
if (that instanceof RechargeResponse)
|
|
|
360 |
return this.equals((RechargeResponse)that);
|
|
|
361 |
return false;
|
|
|
362 |
}
|
|
|
363 |
|
|
|
364 |
public boolean equals(RechargeResponse that) {
|
|
|
365 |
if (that == null)
|
|
|
366 |
return false;
|
|
|
367 |
|
|
|
368 |
boolean this_present_newCouponCreated = true && this.isSetNewCouponCreated();
|
|
|
369 |
boolean that_present_newCouponCreated = true && that.isSetNewCouponCreated();
|
|
|
370 |
if (this_present_newCouponCreated || that_present_newCouponCreated) {
|
|
|
371 |
if (!(this_present_newCouponCreated && that_present_newCouponCreated))
|
|
|
372 |
return false;
|
|
|
373 |
if (!this.newCouponCreated.equals(that.newCouponCreated))
|
|
|
374 |
return false;
|
|
|
375 |
}
|
|
|
376 |
|
|
|
377 |
boolean this_present_isSuccessful = true;
|
|
|
378 |
boolean that_present_isSuccessful = true;
|
|
|
379 |
if (this_present_isSuccessful || that_present_isSuccessful) {
|
|
|
380 |
if (!(this_present_isSuccessful && that_present_isSuccessful))
|
|
|
381 |
return false;
|
|
|
382 |
if (this.isSuccessful != that.isSuccessful)
|
|
|
383 |
return false;
|
|
|
384 |
}
|
|
|
385 |
|
|
|
386 |
boolean this_present_errorMessage = true && this.isSetErrorMessage();
|
|
|
387 |
boolean that_present_errorMessage = true && that.isSetErrorMessage();
|
|
|
388 |
if (this_present_errorMessage || that_present_errorMessage) {
|
|
|
389 |
if (!(this_present_errorMessage && that_present_errorMessage))
|
|
|
390 |
return false;
|
|
|
391 |
if (!this.errorMessage.equals(that.errorMessage))
|
|
|
392 |
return false;
|
|
|
393 |
}
|
|
|
394 |
|
|
|
395 |
boolean this_present_invalidCoupons = true && this.isSetInvalidCoupons();
|
|
|
396 |
boolean that_present_invalidCoupons = true && that.isSetInvalidCoupons();
|
|
|
397 |
if (this_present_invalidCoupons || that_present_invalidCoupons) {
|
|
|
398 |
if (!(this_present_invalidCoupons && that_present_invalidCoupons))
|
|
|
399 |
return false;
|
|
|
400 |
if (!this.invalidCoupons.equals(that.invalidCoupons))
|
|
|
401 |
return false;
|
|
|
402 |
}
|
|
|
403 |
|
|
|
404 |
return true;
|
|
|
405 |
}
|
|
|
406 |
|
|
|
407 |
@Override
|
|
|
408 |
public int hashCode() {
|
|
|
409 |
return 0;
|
|
|
410 |
}
|
|
|
411 |
|
|
|
412 |
public int compareTo(RechargeResponse other) {
|
|
|
413 |
if (!getClass().equals(other.getClass())) {
|
|
|
414 |
return getClass().getName().compareTo(other.getClass().getName());
|
|
|
415 |
}
|
|
|
416 |
|
|
|
417 |
int lastComparison = 0;
|
|
|
418 |
RechargeResponse typedOther = (RechargeResponse)other;
|
|
|
419 |
|
|
|
420 |
lastComparison = Boolean.valueOf(isSetNewCouponCreated()).compareTo(typedOther.isSetNewCouponCreated());
|
|
|
421 |
if (lastComparison != 0) {
|
|
|
422 |
return lastComparison;
|
|
|
423 |
}
|
|
|
424 |
if (isSetNewCouponCreated()) {
|
|
|
425 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newCouponCreated, typedOther.newCouponCreated);
|
|
|
426 |
if (lastComparison != 0) {
|
|
|
427 |
return lastComparison;
|
|
|
428 |
}
|
|
|
429 |
}
|
|
|
430 |
lastComparison = Boolean.valueOf(isSetIsSuccessful()).compareTo(typedOther.isSetIsSuccessful());
|
|
|
431 |
if (lastComparison != 0) {
|
|
|
432 |
return lastComparison;
|
|
|
433 |
}
|
|
|
434 |
if (isSetIsSuccessful()) {
|
|
|
435 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isSuccessful, typedOther.isSuccessful);
|
|
|
436 |
if (lastComparison != 0) {
|
|
|
437 |
return lastComparison;
|
|
|
438 |
}
|
|
|
439 |
}
|
|
|
440 |
lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(typedOther.isSetErrorMessage());
|
|
|
441 |
if (lastComparison != 0) {
|
|
|
442 |
return lastComparison;
|
|
|
443 |
}
|
|
|
444 |
if (isSetErrorMessage()) {
|
|
|
445 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, typedOther.errorMessage);
|
|
|
446 |
if (lastComparison != 0) {
|
|
|
447 |
return lastComparison;
|
|
|
448 |
}
|
|
|
449 |
}
|
|
|
450 |
lastComparison = Boolean.valueOf(isSetInvalidCoupons()).compareTo(typedOther.isSetInvalidCoupons());
|
|
|
451 |
if (lastComparison != 0) {
|
|
|
452 |
return lastComparison;
|
|
|
453 |
}
|
|
|
454 |
if (isSetInvalidCoupons()) {
|
|
|
455 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invalidCoupons, typedOther.invalidCoupons);
|
|
|
456 |
if (lastComparison != 0) {
|
|
|
457 |
return lastComparison;
|
|
|
458 |
}
|
|
|
459 |
}
|
|
|
460 |
return 0;
|
|
|
461 |
}
|
|
|
462 |
|
|
|
463 |
public _Fields fieldForId(int fieldId) {
|
|
|
464 |
return _Fields.findByThriftId(fieldId);
|
|
|
465 |
}
|
|
|
466 |
|
|
|
467 |
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
|
|
|
468 |
org.apache.thrift.protocol.TField field;
|
|
|
469 |
iprot.readStructBegin();
|
|
|
470 |
while (true)
|
|
|
471 |
{
|
|
|
472 |
field = iprot.readFieldBegin();
|
|
|
473 |
if (field.type == org.apache.thrift.protocol.TType.STOP) {
|
|
|
474 |
break;
|
|
|
475 |
}
|
|
|
476 |
switch (field.id) {
|
|
|
477 |
case 1: // NEW_COUPON_CREATED
|
|
|
478 |
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
|
|
|
479 |
this.newCouponCreated = new RechargeCoupon();
|
|
|
480 |
this.newCouponCreated.read(iprot);
|
|
|
481 |
} else {
|
|
|
482 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
483 |
}
|
|
|
484 |
break;
|
|
|
485 |
case 2: // IS_SUCCESSFUL
|
|
|
486 |
if (field.type == org.apache.thrift.protocol.TType.BOOL) {
|
|
|
487 |
this.isSuccessful = iprot.readBool();
|
|
|
488 |
setIsSuccessfulIsSet(true);
|
|
|
489 |
} else {
|
|
|
490 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
491 |
}
|
|
|
492 |
break;
|
|
|
493 |
case 3: // ERROR_MESSAGE
|
|
|
494 |
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
|
|
495 |
this.errorMessage = iprot.readString();
|
|
|
496 |
} else {
|
|
|
497 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
498 |
}
|
|
|
499 |
break;
|
|
|
500 |
case 4: // INVALID_COUPONS
|
|
|
501 |
if (field.type == org.apache.thrift.protocol.TType.LIST) {
|
|
|
502 |
{
|
|
|
503 |
org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
|
|
|
504 |
this.invalidCoupons = new ArrayList<RechargeCoupon>(_list8.size);
|
|
|
505 |
for (int _i9 = 0; _i9 < _list8.size; ++_i9)
|
|
|
506 |
{
|
|
|
507 |
RechargeCoupon _elem10; // required
|
|
|
508 |
_elem10 = new RechargeCoupon();
|
|
|
509 |
_elem10.read(iprot);
|
|
|
510 |
this.invalidCoupons.add(_elem10);
|
|
|
511 |
}
|
|
|
512 |
iprot.readListEnd();
|
|
|
513 |
}
|
|
|
514 |
} else {
|
|
|
515 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
516 |
}
|
|
|
517 |
break;
|
|
|
518 |
default:
|
|
|
519 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
520 |
}
|
|
|
521 |
iprot.readFieldEnd();
|
|
|
522 |
}
|
|
|
523 |
iprot.readStructEnd();
|
|
|
524 |
validate();
|
|
|
525 |
}
|
|
|
526 |
|
|
|
527 |
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
|
|
|
528 |
validate();
|
|
|
529 |
|
|
|
530 |
oprot.writeStructBegin(STRUCT_DESC);
|
|
|
531 |
if (this.newCouponCreated != null) {
|
|
|
532 |
oprot.writeFieldBegin(NEW_COUPON_CREATED_FIELD_DESC);
|
|
|
533 |
this.newCouponCreated.write(oprot);
|
|
|
534 |
oprot.writeFieldEnd();
|
|
|
535 |
}
|
|
|
536 |
oprot.writeFieldBegin(IS_SUCCESSFUL_FIELD_DESC);
|
|
|
537 |
oprot.writeBool(this.isSuccessful);
|
|
|
538 |
oprot.writeFieldEnd();
|
|
|
539 |
if (this.errorMessage != null) {
|
|
|
540 |
oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC);
|
|
|
541 |
oprot.writeString(this.errorMessage);
|
|
|
542 |
oprot.writeFieldEnd();
|
|
|
543 |
}
|
|
|
544 |
if (this.invalidCoupons != null) {
|
|
|
545 |
oprot.writeFieldBegin(INVALID_COUPONS_FIELD_DESC);
|
|
|
546 |
{
|
|
|
547 |
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.invalidCoupons.size()));
|
|
|
548 |
for (RechargeCoupon _iter11 : this.invalidCoupons)
|
|
|
549 |
{
|
|
|
550 |
_iter11.write(oprot);
|
|
|
551 |
}
|
|
|
552 |
oprot.writeListEnd();
|
|
|
553 |
}
|
|
|
554 |
oprot.writeFieldEnd();
|
|
|
555 |
}
|
|
|
556 |
oprot.writeFieldStop();
|
|
|
557 |
oprot.writeStructEnd();
|
|
|
558 |
}
|
|
|
559 |
|
|
|
560 |
@Override
|
|
|
561 |
public String toString() {
|
|
|
562 |
StringBuilder sb = new StringBuilder("RechargeResponse(");
|
|
|
563 |
boolean first = true;
|
|
|
564 |
|
|
|
565 |
sb.append("newCouponCreated:");
|
|
|
566 |
if (this.newCouponCreated == null) {
|
|
|
567 |
sb.append("null");
|
|
|
568 |
} else {
|
|
|
569 |
sb.append(this.newCouponCreated);
|
|
|
570 |
}
|
|
|
571 |
first = false;
|
|
|
572 |
if (!first) sb.append(", ");
|
|
|
573 |
sb.append("isSuccessful:");
|
|
|
574 |
sb.append(this.isSuccessful);
|
|
|
575 |
first = false;
|
|
|
576 |
if (!first) sb.append(", ");
|
|
|
577 |
sb.append("errorMessage:");
|
|
|
578 |
if (this.errorMessage == null) {
|
|
|
579 |
sb.append("null");
|
|
|
580 |
} else {
|
|
|
581 |
sb.append(this.errorMessage);
|
|
|
582 |
}
|
|
|
583 |
first = false;
|
|
|
584 |
if (!first) sb.append(", ");
|
|
|
585 |
sb.append("invalidCoupons:");
|
|
|
586 |
if (this.invalidCoupons == null) {
|
|
|
587 |
sb.append("null");
|
|
|
588 |
} else {
|
|
|
589 |
sb.append(this.invalidCoupons);
|
|
|
590 |
}
|
|
|
591 |
first = false;
|
|
|
592 |
sb.append(")");
|
|
|
593 |
return sb.toString();
|
|
|
594 |
}
|
|
|
595 |
|
|
|
596 |
public void validate() throws org.apache.thrift.TException {
|
|
|
597 |
// check for required fields
|
|
|
598 |
}
|
|
|
599 |
|
|
|
600 |
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
|
|
601 |
try {
|
|
|
602 |
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
|
|
|
603 |
} catch (org.apache.thrift.TException te) {
|
|
|
604 |
throw new java.io.IOException(te);
|
|
|
605 |
}
|
|
|
606 |
}
|
|
|
607 |
|
|
|
608 |
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
|
|
|
609 |
try {
|
|
|
610 |
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
|
|
|
611 |
__isset_bit_vector = new BitSet(1);
|
|
|
612 |
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
|
|
|
613 |
} catch (org.apache.thrift.TException te) {
|
|
|
614 |
throw new java.io.IOException(te);
|
|
|
615 |
}
|
|
|
616 |
}
|
|
|
617 |
|
|
|
618 |
}
|
|
|
619 |
|