Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
352 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.utils;
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 HelperService {
27
 
28
  public interface Iface {
29
 
30
    public List<ItemLogistics> getLogisticsEstimation(long itemId, Map<String,String> location) throws HelperServiceException, TException;
31
 
32
    public void sendMail(Mail mail) throws HelperServiceException, TException;
33
 
34
    public void sendText(TextMessage message) throws HelperServiceException, TException;
35
 
36
    public void addMessage(Message message) throws HelperServiceException, TException;
37
 
38
    public void updateMessage(long id, String message) throws HelperServiceException, TException;
39
 
40
    public Message getMessage(long id) throws HelperServiceException, TException;
41
 
42
    public Message getSubstitutedMessage(long id, Map<String,String> params) throws HelperServiceException, TException;
43
 
44
  }
45
 
46
  public static class Client implements Iface {
47
    public Client(TProtocol prot)
48
    {
49
      this(prot, prot);
50
    }
51
 
52
    public Client(TProtocol iprot, TProtocol oprot)
53
    {
54
      iprot_ = iprot;
55
      oprot_ = oprot;
56
    }
57
 
58
    protected TProtocol iprot_;
59
    protected TProtocol oprot_;
60
 
61
    protected int seqid_;
62
 
63
    public TProtocol getInputProtocol()
64
    {
65
      return this.iprot_;
66
    }
67
 
68
    public TProtocol getOutputProtocol()
69
    {
70
      return this.oprot_;
71
    }
72
 
73
    public List<ItemLogistics> getLogisticsEstimation(long itemId, Map<String,String> location) throws HelperServiceException, TException
74
    {
75
      send_getLogisticsEstimation(itemId, location);
76
      return recv_getLogisticsEstimation();
77
    }
78
 
79
    public void send_getLogisticsEstimation(long itemId, Map<String,String> location) throws TException
80
    {
81
      oprot_.writeMessageBegin(new TMessage("getLogisticsEstimation", TMessageType.CALL, seqid_));
82
      getLogisticsEstimation_args args = new getLogisticsEstimation_args();
83
      args.itemId = itemId;
84
      args.location = location;
85
      args.write(oprot_);
86
      oprot_.writeMessageEnd();
87
      oprot_.getTransport().flush();
88
    }
89
 
90
    public List<ItemLogistics> recv_getLogisticsEstimation() throws HelperServiceException, TException
91
    {
92
      TMessage msg = iprot_.readMessageBegin();
93
      if (msg.type == TMessageType.EXCEPTION) {
94
        TApplicationException x = TApplicationException.read(iprot_);
95
        iprot_.readMessageEnd();
96
        throw x;
97
      }
98
      getLogisticsEstimation_result result = new getLogisticsEstimation_result();
99
      result.read(iprot_);
100
      iprot_.readMessageEnd();
101
      if (result.isSetSuccess()) {
102
        return result.success;
103
      }
104
      if (result.se != null) {
105
        throw result.se;
106
      }
107
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsEstimation failed: unknown result");
108
    }
109
 
110
    public void sendMail(Mail mail) throws HelperServiceException, TException
111
    {
112
      send_sendMail(mail);
113
      recv_sendMail();
114
    }
115
 
116
    public void send_sendMail(Mail mail) throws TException
117
    {
118
      oprot_.writeMessageBegin(new TMessage("sendMail", TMessageType.CALL, seqid_));
119
      sendMail_args args = new sendMail_args();
120
      args.mail = mail;
121
      args.write(oprot_);
122
      oprot_.writeMessageEnd();
123
      oprot_.getTransport().flush();
124
    }
125
 
126
    public void recv_sendMail() throws HelperServiceException, TException
127
    {
128
      TMessage msg = iprot_.readMessageBegin();
129
      if (msg.type == TMessageType.EXCEPTION) {
130
        TApplicationException x = TApplicationException.read(iprot_);
131
        iprot_.readMessageEnd();
132
        throw x;
133
      }
134
      sendMail_result result = new sendMail_result();
135
      result.read(iprot_);
136
      iprot_.readMessageEnd();
137
      if (result.se != null) {
138
        throw result.se;
139
      }
140
      return;
141
    }
142
 
143
    public void sendText(TextMessage message) throws HelperServiceException, TException
144
    {
145
      send_sendText(message);
146
      recv_sendText();
147
    }
148
 
149
    public void send_sendText(TextMessage message) throws TException
150
    {
151
      oprot_.writeMessageBegin(new TMessage("sendText", TMessageType.CALL, seqid_));
152
      sendText_args args = new sendText_args();
153
      args.message = message;
154
      args.write(oprot_);
155
      oprot_.writeMessageEnd();
156
      oprot_.getTransport().flush();
157
    }
158
 
159
    public void recv_sendText() throws HelperServiceException, TException
160
    {
161
      TMessage msg = iprot_.readMessageBegin();
162
      if (msg.type == TMessageType.EXCEPTION) {
163
        TApplicationException x = TApplicationException.read(iprot_);
164
        iprot_.readMessageEnd();
165
        throw x;
166
      }
167
      sendText_result result = new sendText_result();
168
      result.read(iprot_);
169
      iprot_.readMessageEnd();
170
      if (result.se != null) {
171
        throw result.se;
172
      }
173
      return;
174
    }
175
 
176
    public void addMessage(Message message) throws HelperServiceException, TException
177
    {
178
      send_addMessage(message);
179
      recv_addMessage();
180
    }
181
 
182
    public void send_addMessage(Message message) throws TException
183
    {
184
      oprot_.writeMessageBegin(new TMessage("addMessage", TMessageType.CALL, seqid_));
185
      addMessage_args args = new addMessage_args();
186
      args.message = message;
187
      args.write(oprot_);
188
      oprot_.writeMessageEnd();
189
      oprot_.getTransport().flush();
190
    }
191
 
192
    public void recv_addMessage() throws HelperServiceException, TException
193
    {
194
      TMessage msg = iprot_.readMessageBegin();
195
      if (msg.type == TMessageType.EXCEPTION) {
196
        TApplicationException x = TApplicationException.read(iprot_);
197
        iprot_.readMessageEnd();
198
        throw x;
199
      }
200
      addMessage_result result = new addMessage_result();
201
      result.read(iprot_);
202
      iprot_.readMessageEnd();
203
      if (result.se != null) {
204
        throw result.se;
205
      }
206
      return;
207
    }
208
 
209
    public void updateMessage(long id, String message) throws HelperServiceException, TException
210
    {
211
      send_updateMessage(id, message);
212
      recv_updateMessage();
213
    }
214
 
215
    public void send_updateMessage(long id, String message) throws TException
216
    {
217
      oprot_.writeMessageBegin(new TMessage("updateMessage", TMessageType.CALL, seqid_));
218
      updateMessage_args args = new updateMessage_args();
219
      args.id = id;
220
      args.message = message;
221
      args.write(oprot_);
222
      oprot_.writeMessageEnd();
223
      oprot_.getTransport().flush();
224
    }
225
 
226
    public void recv_updateMessage() throws HelperServiceException, TException
227
    {
228
      TMessage msg = iprot_.readMessageBegin();
229
      if (msg.type == TMessageType.EXCEPTION) {
230
        TApplicationException x = TApplicationException.read(iprot_);
231
        iprot_.readMessageEnd();
232
        throw x;
233
      }
234
      updateMessage_result result = new updateMessage_result();
235
      result.read(iprot_);
236
      iprot_.readMessageEnd();
237
      if (result.se != null) {
238
        throw result.se;
239
      }
240
      return;
241
    }
242
 
243
    public Message getMessage(long id) throws HelperServiceException, TException
244
    {
245
      send_getMessage(id);
246
      return recv_getMessage();
247
    }
248
 
249
    public void send_getMessage(long id) throws TException
250
    {
251
      oprot_.writeMessageBegin(new TMessage("getMessage", TMessageType.CALL, seqid_));
252
      getMessage_args args = new getMessage_args();
253
      args.id = id;
254
      args.write(oprot_);
255
      oprot_.writeMessageEnd();
256
      oprot_.getTransport().flush();
257
    }
258
 
259
    public Message recv_getMessage() throws HelperServiceException, TException
260
    {
261
      TMessage msg = iprot_.readMessageBegin();
262
      if (msg.type == TMessageType.EXCEPTION) {
263
        TApplicationException x = TApplicationException.read(iprot_);
264
        iprot_.readMessageEnd();
265
        throw x;
266
      }
267
      getMessage_result result = new getMessage_result();
268
      result.read(iprot_);
269
      iprot_.readMessageEnd();
270
      if (result.isSetSuccess()) {
271
        return result.success;
272
      }
273
      if (result.se != null) {
274
        throw result.se;
275
      }
276
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getMessage failed: unknown result");
277
    }
278
 
279
    public Message getSubstitutedMessage(long id, Map<String,String> params) throws HelperServiceException, TException
280
    {
281
      send_getSubstitutedMessage(id, params);
282
      return recv_getSubstitutedMessage();
283
    }
284
 
285
    public void send_getSubstitutedMessage(long id, Map<String,String> params) throws TException
286
    {
287
      oprot_.writeMessageBegin(new TMessage("getSubstitutedMessage", TMessageType.CALL, seqid_));
288
      getSubstitutedMessage_args args = new getSubstitutedMessage_args();
289
      args.id = id;
290
      args.params = params;
291
      args.write(oprot_);
292
      oprot_.writeMessageEnd();
293
      oprot_.getTransport().flush();
294
    }
295
 
296
    public Message recv_getSubstitutedMessage() throws HelperServiceException, TException
297
    {
298
      TMessage msg = iprot_.readMessageBegin();
299
      if (msg.type == TMessageType.EXCEPTION) {
300
        TApplicationException x = TApplicationException.read(iprot_);
301
        iprot_.readMessageEnd();
302
        throw x;
303
      }
304
      getSubstitutedMessage_result result = new getSubstitutedMessage_result();
305
      result.read(iprot_);
306
      iprot_.readMessageEnd();
307
      if (result.isSetSuccess()) {
308
        return result.success;
309
      }
310
      if (result.se != null) {
311
        throw result.se;
312
      }
313
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getSubstitutedMessage failed: unknown result");
314
    }
315
 
316
  }
317
  public static class Processor implements TProcessor {
318
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
319
    public Processor(Iface iface)
320
    {
321
      iface_ = iface;
322
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
323
      processMap_.put("sendMail", new sendMail());
324
      processMap_.put("sendText", new sendText());
325
      processMap_.put("addMessage", new addMessage());
326
      processMap_.put("updateMessage", new updateMessage());
327
      processMap_.put("getMessage", new getMessage());
328
      processMap_.put("getSubstitutedMessage", new getSubstitutedMessage());
329
    }
330
 
331
    protected static interface ProcessFunction {
332
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
333
    }
334
 
335
    private Iface iface_;
336
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
337
 
338
    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
339
    {
340
      TMessage msg = iprot.readMessageBegin();
341
      ProcessFunction fn = processMap_.get(msg.name);
342
      if (fn == null) {
343
        TProtocolUtil.skip(iprot, TType.STRUCT);
344
        iprot.readMessageEnd();
345
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
346
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
347
        x.write(oprot);
348
        oprot.writeMessageEnd();
349
        oprot.getTransport().flush();
350
        return true;
351
      }
352
      fn.process(msg.seqid, iprot, oprot);
353
      return true;
354
    }
355
 
356
    private class getLogisticsEstimation implements ProcessFunction {
357
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
358
      {
359
        getLogisticsEstimation_args args = new getLogisticsEstimation_args();
360
        args.read(iprot);
361
        iprot.readMessageEnd();
362
        getLogisticsEstimation_result result = new getLogisticsEstimation_result();
363
        try {
364
          result.success = iface_.getLogisticsEstimation(args.itemId, args.location);
365
        } catch (HelperServiceException se) {
366
          result.se = se;
367
        } catch (Throwable th) {
368
          LOGGER.error("Internal error processing getLogisticsEstimation", th);
369
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getLogisticsEstimation");
370
          oprot.writeMessageBegin(new TMessage("getLogisticsEstimation", TMessageType.EXCEPTION, seqid));
371
          x.write(oprot);
372
          oprot.writeMessageEnd();
373
          oprot.getTransport().flush();
374
          return;
375
        }
376
        oprot.writeMessageBegin(new TMessage("getLogisticsEstimation", TMessageType.REPLY, seqid));
377
        result.write(oprot);
378
        oprot.writeMessageEnd();
379
        oprot.getTransport().flush();
380
      }
381
 
382
    }
383
 
384
    private class sendMail implements ProcessFunction {
385
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
386
      {
387
        sendMail_args args = new sendMail_args();
388
        args.read(iprot);
389
        iprot.readMessageEnd();
390
        sendMail_result result = new sendMail_result();
391
        try {
392
          iface_.sendMail(args.mail);
393
        } catch (HelperServiceException se) {
394
          result.se = se;
395
        } catch (Throwable th) {
396
          LOGGER.error("Internal error processing sendMail", th);
397
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing sendMail");
398
          oprot.writeMessageBegin(new TMessage("sendMail", TMessageType.EXCEPTION, seqid));
399
          x.write(oprot);
400
          oprot.writeMessageEnd();
401
          oprot.getTransport().flush();
402
          return;
403
        }
404
        oprot.writeMessageBegin(new TMessage("sendMail", TMessageType.REPLY, seqid));
405
        result.write(oprot);
406
        oprot.writeMessageEnd();
407
        oprot.getTransport().flush();
408
      }
409
 
410
    }
411
 
412
    private class sendText implements ProcessFunction {
413
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
414
      {
415
        sendText_args args = new sendText_args();
416
        args.read(iprot);
417
        iprot.readMessageEnd();
418
        sendText_result result = new sendText_result();
419
        try {
420
          iface_.sendText(args.message);
421
        } catch (HelperServiceException se) {
422
          result.se = se;
423
        } catch (Throwable th) {
424
          LOGGER.error("Internal error processing sendText", th);
425
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing sendText");
426
          oprot.writeMessageBegin(new TMessage("sendText", TMessageType.EXCEPTION, seqid));
427
          x.write(oprot);
428
          oprot.writeMessageEnd();
429
          oprot.getTransport().flush();
430
          return;
431
        }
432
        oprot.writeMessageBegin(new TMessage("sendText", TMessageType.REPLY, seqid));
433
        result.write(oprot);
434
        oprot.writeMessageEnd();
435
        oprot.getTransport().flush();
436
      }
437
 
438
    }
439
 
440
    private class addMessage implements ProcessFunction {
441
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
442
      {
443
        addMessage_args args = new addMessage_args();
444
        args.read(iprot);
445
        iprot.readMessageEnd();
446
        addMessage_result result = new addMessage_result();
447
        try {
448
          iface_.addMessage(args.message);
449
        } catch (HelperServiceException se) {
450
          result.se = se;
451
        } catch (Throwable th) {
452
          LOGGER.error("Internal error processing addMessage", th);
453
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addMessage");
454
          oprot.writeMessageBegin(new TMessage("addMessage", TMessageType.EXCEPTION, seqid));
455
          x.write(oprot);
456
          oprot.writeMessageEnd();
457
          oprot.getTransport().flush();
458
          return;
459
        }
460
        oprot.writeMessageBegin(new TMessage("addMessage", TMessageType.REPLY, seqid));
461
        result.write(oprot);
462
        oprot.writeMessageEnd();
463
        oprot.getTransport().flush();
464
      }
465
 
466
    }
467
 
468
    private class updateMessage implements ProcessFunction {
469
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
470
      {
471
        updateMessage_args args = new updateMessage_args();
472
        args.read(iprot);
473
        iprot.readMessageEnd();
474
        updateMessage_result result = new updateMessage_result();
475
        try {
476
          iface_.updateMessage(args.id, args.message);
477
        } catch (HelperServiceException se) {
478
          result.se = se;
479
        } catch (Throwable th) {
480
          LOGGER.error("Internal error processing updateMessage", th);
481
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing updateMessage");
482
          oprot.writeMessageBegin(new TMessage("updateMessage", TMessageType.EXCEPTION, seqid));
483
          x.write(oprot);
484
          oprot.writeMessageEnd();
485
          oprot.getTransport().flush();
486
          return;
487
        }
488
        oprot.writeMessageBegin(new TMessage("updateMessage", TMessageType.REPLY, seqid));
489
        result.write(oprot);
490
        oprot.writeMessageEnd();
491
        oprot.getTransport().flush();
492
      }
493
 
494
    }
495
 
496
    private class getMessage implements ProcessFunction {
497
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
498
      {
499
        getMessage_args args = new getMessage_args();
500
        args.read(iprot);
501
        iprot.readMessageEnd();
502
        getMessage_result result = new getMessage_result();
503
        try {
504
          result.success = iface_.getMessage(args.id);
505
        } catch (HelperServiceException se) {
506
          result.se = se;
507
        } catch (Throwable th) {
508
          LOGGER.error("Internal error processing getMessage", th);
509
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getMessage");
510
          oprot.writeMessageBegin(new TMessage("getMessage", TMessageType.EXCEPTION, seqid));
511
          x.write(oprot);
512
          oprot.writeMessageEnd();
513
          oprot.getTransport().flush();
514
          return;
515
        }
516
        oprot.writeMessageBegin(new TMessage("getMessage", TMessageType.REPLY, seqid));
517
        result.write(oprot);
518
        oprot.writeMessageEnd();
519
        oprot.getTransport().flush();
520
      }
521
 
522
    }
523
 
524
    private class getSubstitutedMessage implements ProcessFunction {
525
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
526
      {
527
        getSubstitutedMessage_args args = new getSubstitutedMessage_args();
528
        args.read(iprot);
529
        iprot.readMessageEnd();
530
        getSubstitutedMessage_result result = new getSubstitutedMessage_result();
531
        try {
532
          result.success = iface_.getSubstitutedMessage(args.id, args.params);
533
        } catch (HelperServiceException se) {
534
          result.se = se;
535
        } catch (Throwable th) {
536
          LOGGER.error("Internal error processing getSubstitutedMessage", th);
537
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getSubstitutedMessage");
538
          oprot.writeMessageBegin(new TMessage("getSubstitutedMessage", TMessageType.EXCEPTION, seqid));
539
          x.write(oprot);
540
          oprot.writeMessageEnd();
541
          oprot.getTransport().flush();
542
          return;
543
        }
544
        oprot.writeMessageBegin(new TMessage("getSubstitutedMessage", TMessageType.REPLY, seqid));
545
        result.write(oprot);
546
        oprot.writeMessageEnd();
547
        oprot.getTransport().flush();
548
      }
549
 
550
    }
551
 
552
  }
553
 
554
  public static class getLogisticsEstimation_args implements TBase<getLogisticsEstimation_args._Fields>, java.io.Serializable, Cloneable   {
555
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsEstimation_args");
556
 
557
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)1);
558
    private static final TField LOCATION_FIELD_DESC = new TField("location", TType.MAP, (short)2);
559
 
560
    private long itemId;
561
    private Map<String,String> location;
562
 
563
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
564
    public enum _Fields implements TFieldIdEnum {
565
      ITEM_ID((short)1, "itemId"),
566
      LOCATION((short)2, "location");
567
 
568
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
569
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
570
 
571
      static {
572
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
573
          byId.put((int)field._thriftId, field);
574
          byName.put(field.getFieldName(), field);
575
        }
576
      }
577
 
578
      /**
579
       * Find the _Fields constant that matches fieldId, or null if its not found.
580
       */
581
      public static _Fields findByThriftId(int fieldId) {
582
        return byId.get(fieldId);
583
      }
584
 
585
      /**
586
       * Find the _Fields constant that matches fieldId, throwing an exception
587
       * if it is not found.
588
       */
589
      public static _Fields findByThriftIdOrThrow(int fieldId) {
590
        _Fields fields = findByThriftId(fieldId);
591
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
592
        return fields;
593
      }
594
 
595
      /**
596
       * Find the _Fields constant that matches name, or null if its not found.
597
       */
598
      public static _Fields findByName(String name) {
599
        return byName.get(name);
600
      }
601
 
602
      private final short _thriftId;
603
      private final String _fieldName;
604
 
605
      _Fields(short thriftId, String fieldName) {
606
        _thriftId = thriftId;
607
        _fieldName = fieldName;
608
      }
609
 
610
      public short getThriftFieldId() {
611
        return _thriftId;
612
      }
613
 
614
      public String getFieldName() {
615
        return _fieldName;
616
      }
617
    }
618
 
619
    // isset id assignments
620
    private static final int __ITEMID_ISSET_ID = 0;
621
    private BitSet __isset_bit_vector = new BitSet(1);
622
 
623
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
624
      put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
625
          new FieldValueMetaData(TType.I64)));
626
      put(_Fields.LOCATION, new FieldMetaData("location", TFieldRequirementType.DEFAULT, 
627
          new MapMetaData(TType.MAP, 
628
              new FieldValueMetaData(TType.STRING), 
629
              new FieldValueMetaData(TType.STRING))));
630
    }});
631
 
632
    static {
633
      FieldMetaData.addStructMetaDataMap(getLogisticsEstimation_args.class, metaDataMap);
634
    }
635
 
636
    public getLogisticsEstimation_args() {
637
    }
638
 
639
    public getLogisticsEstimation_args(
640
      long itemId,
641
      Map<String,String> location)
642
    {
643
      this();
644
      this.itemId = itemId;
645
      setItemIdIsSet(true);
646
      this.location = location;
647
    }
648
 
649
    /**
650
     * Performs a deep copy on <i>other</i>.
651
     */
652
    public getLogisticsEstimation_args(getLogisticsEstimation_args other) {
653
      __isset_bit_vector.clear();
654
      __isset_bit_vector.or(other.__isset_bit_vector);
655
      this.itemId = other.itemId;
656
      if (other.isSetLocation()) {
657
        Map<String,String> __this__location = new HashMap<String,String>();
658
        for (Map.Entry<String, String> other_element : other.location.entrySet()) {
659
 
660
          String other_element_key = other_element.getKey();
661
          String other_element_value = other_element.getValue();
662
 
663
          String __this__location_copy_key = other_element_key;
664
 
665
          String __this__location_copy_value = other_element_value;
666
 
667
          __this__location.put(__this__location_copy_key, __this__location_copy_value);
668
        }
669
        this.location = __this__location;
670
      }
671
    }
672
 
673
    public getLogisticsEstimation_args deepCopy() {
674
      return new getLogisticsEstimation_args(this);
675
    }
676
 
677
    @Deprecated
678
    public getLogisticsEstimation_args clone() {
679
      return new getLogisticsEstimation_args(this);
680
    }
681
 
682
    public long getItemId() {
683
      return this.itemId;
684
    }
685
 
686
    public getLogisticsEstimation_args setItemId(long itemId) {
687
      this.itemId = itemId;
688
      setItemIdIsSet(true);
689
      return this;
690
    }
691
 
692
    public void unsetItemId() {
693
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
694
    }
695
 
696
    /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
697
    public boolean isSetItemId() {
698
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
699
    }
700
 
701
    public void setItemIdIsSet(boolean value) {
702
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
703
    }
704
 
705
    public int getLocationSize() {
706
      return (this.location == null) ? 0 : this.location.size();
707
    }
708
 
709
    public void putToLocation(String key, String val) {
710
      if (this.location == null) {
711
        this.location = new HashMap<String,String>();
712
      }
713
      this.location.put(key, val);
714
    }
715
 
716
    public Map<String,String> getLocation() {
717
      return this.location;
718
    }
719
 
720
    public getLogisticsEstimation_args setLocation(Map<String,String> location) {
721
      this.location = location;
722
      return this;
723
    }
724
 
725
    public void unsetLocation() {
726
      this.location = null;
727
    }
728
 
729
    /** Returns true if field location is set (has been asigned a value) and false otherwise */
730
    public boolean isSetLocation() {
731
      return this.location != null;
732
    }
733
 
734
    public void setLocationIsSet(boolean value) {
735
      if (!value) {
736
        this.location = null;
737
      }
738
    }
739
 
740
    public void setFieldValue(_Fields field, Object value) {
741
      switch (field) {
742
      case ITEM_ID:
743
        if (value == null) {
744
          unsetItemId();
745
        } else {
746
          setItemId((Long)value);
747
        }
748
        break;
749
 
750
      case LOCATION:
751
        if (value == null) {
752
          unsetLocation();
753
        } else {
754
          setLocation((Map<String,String>)value);
755
        }
756
        break;
757
 
758
      }
759
    }
760
 
761
    public void setFieldValue(int fieldID, Object value) {
762
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
763
    }
764
 
765
    public Object getFieldValue(_Fields field) {
766
      switch (field) {
767
      case ITEM_ID:
768
        return new Long(getItemId());
769
 
770
      case LOCATION:
771
        return getLocation();
772
 
773
      }
774
      throw new IllegalStateException();
775
    }
776
 
777
    public Object getFieldValue(int fieldId) {
778
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
779
    }
780
 
781
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
782
    public boolean isSet(_Fields field) {
783
      switch (field) {
784
      case ITEM_ID:
785
        return isSetItemId();
786
      case LOCATION:
787
        return isSetLocation();
788
      }
789
      throw new IllegalStateException();
790
    }
791
 
792
    public boolean isSet(int fieldID) {
793
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
794
    }
795
 
796
    @Override
797
    public boolean equals(Object that) {
798
      if (that == null)
799
        return false;
800
      if (that instanceof getLogisticsEstimation_args)
801
        return this.equals((getLogisticsEstimation_args)that);
802
      return false;
803
    }
804
 
805
    public boolean equals(getLogisticsEstimation_args that) {
806
      if (that == null)
807
        return false;
808
 
809
      boolean this_present_itemId = true;
810
      boolean that_present_itemId = true;
811
      if (this_present_itemId || that_present_itemId) {
812
        if (!(this_present_itemId && that_present_itemId))
813
          return false;
814
        if (this.itemId != that.itemId)
815
          return false;
816
      }
817
 
818
      boolean this_present_location = true && this.isSetLocation();
819
      boolean that_present_location = true && that.isSetLocation();
820
      if (this_present_location || that_present_location) {
821
        if (!(this_present_location && that_present_location))
822
          return false;
823
        if (!this.location.equals(that.location))
824
          return false;
825
      }
826
 
827
      return true;
828
    }
829
 
830
    @Override
831
    public int hashCode() {
832
      return 0;
833
    }
834
 
835
    public void read(TProtocol iprot) throws TException {
836
      TField field;
837
      iprot.readStructBegin();
838
      while (true)
839
      {
840
        field = iprot.readFieldBegin();
841
        if (field.type == TType.STOP) { 
842
          break;
843
        }
844
        _Fields fieldId = _Fields.findByThriftId(field.id);
845
        if (fieldId == null) {
846
          TProtocolUtil.skip(iprot, field.type);
847
        } else {
848
          switch (fieldId) {
849
            case ITEM_ID:
850
              if (field.type == TType.I64) {
851
                this.itemId = iprot.readI64();
852
                setItemIdIsSet(true);
853
              } else { 
854
                TProtocolUtil.skip(iprot, field.type);
855
              }
856
              break;
857
            case LOCATION:
858
              if (field.type == TType.MAP) {
859
                {
860
                  TMap _map8 = iprot.readMapBegin();
861
                  this.location = new HashMap<String,String>(2*_map8.size);
862
                  for (int _i9 = 0; _i9 < _map8.size; ++_i9)
863
                  {
864
                    String _key10;
865
                    String _val11;
866
                    _key10 = iprot.readString();
867
                    _val11 = iprot.readString();
868
                    this.location.put(_key10, _val11);
869
                  }
870
                  iprot.readMapEnd();
871
                }
872
              } else { 
873
                TProtocolUtil.skip(iprot, field.type);
874
              }
875
              break;
876
          }
877
          iprot.readFieldEnd();
878
        }
879
      }
880
      iprot.readStructEnd();
881
      validate();
882
    }
883
 
884
    public void write(TProtocol oprot) throws TException {
885
      validate();
886
 
887
      oprot.writeStructBegin(STRUCT_DESC);
888
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
889
      oprot.writeI64(this.itemId);
890
      oprot.writeFieldEnd();
891
      if (this.location != null) {
892
        oprot.writeFieldBegin(LOCATION_FIELD_DESC);
893
        {
894
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.location.size()));
895
          for (Map.Entry<String, String> _iter12 : this.location.entrySet())
896
          {
897
            oprot.writeString(_iter12.getKey());
898
            oprot.writeString(_iter12.getValue());
899
          }
900
          oprot.writeMapEnd();
901
        }
902
        oprot.writeFieldEnd();
903
      }
904
      oprot.writeFieldStop();
905
      oprot.writeStructEnd();
906
    }
907
 
908
    @Override
909
    public String toString() {
910
      StringBuilder sb = new StringBuilder("getLogisticsEstimation_args(");
911
      boolean first = true;
912
 
913
      sb.append("itemId:");
914
      sb.append(this.itemId);
915
      first = false;
916
      if (!first) sb.append(", ");
917
      sb.append("location:");
918
      if (this.location == null) {
919
        sb.append("null");
920
      } else {
921
        sb.append(this.location);
922
      }
923
      first = false;
924
      sb.append(")");
925
      return sb.toString();
926
    }
927
 
928
    public void validate() throws TException {
929
      // check for required fields
930
    }
931
 
932
  }
933
 
934
  public static class getLogisticsEstimation_result implements TBase<getLogisticsEstimation_result._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsEstimation_result>   {
935
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsEstimation_result");
936
 
937
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
938
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
939
 
940
    private List<ItemLogistics> success;
941
    private HelperServiceException se;
942
 
943
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
944
    public enum _Fields implements TFieldIdEnum {
945
      SUCCESS((short)0, "success"),
946
      SE((short)1, "se");
947
 
948
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
949
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
950
 
951
      static {
952
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
953
          byId.put((int)field._thriftId, field);
954
          byName.put(field.getFieldName(), field);
955
        }
956
      }
957
 
958
      /**
959
       * Find the _Fields constant that matches fieldId, or null if its not found.
960
       */
961
      public static _Fields findByThriftId(int fieldId) {
962
        return byId.get(fieldId);
963
      }
964
 
965
      /**
966
       * Find the _Fields constant that matches fieldId, throwing an exception
967
       * if it is not found.
968
       */
969
      public static _Fields findByThriftIdOrThrow(int fieldId) {
970
        _Fields fields = findByThriftId(fieldId);
971
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
972
        return fields;
973
      }
974
 
975
      /**
976
       * Find the _Fields constant that matches name, or null if its not found.
977
       */
978
      public static _Fields findByName(String name) {
979
        return byName.get(name);
980
      }
981
 
982
      private final short _thriftId;
983
      private final String _fieldName;
984
 
985
      _Fields(short thriftId, String fieldName) {
986
        _thriftId = thriftId;
987
        _fieldName = fieldName;
988
      }
989
 
990
      public short getThriftFieldId() {
991
        return _thriftId;
992
      }
993
 
994
      public String getFieldName() {
995
        return _fieldName;
996
      }
997
    }
998
 
999
    // isset id assignments
1000
 
1001
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1002
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
1003
          new ListMetaData(TType.LIST, 
1004
              new StructMetaData(TType.STRUCT, ItemLogistics.class))));
1005
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
1006
          new FieldValueMetaData(TType.STRUCT)));
1007
    }});
1008
 
1009
    static {
1010
      FieldMetaData.addStructMetaDataMap(getLogisticsEstimation_result.class, metaDataMap);
1011
    }
1012
 
1013
    public getLogisticsEstimation_result() {
1014
    }
1015
 
1016
    public getLogisticsEstimation_result(
1017
      List<ItemLogistics> success,
1018
      HelperServiceException se)
1019
    {
1020
      this();
1021
      this.success = success;
1022
      this.se = se;
1023
    }
1024
 
1025
    /**
1026
     * Performs a deep copy on <i>other</i>.
1027
     */
1028
    public getLogisticsEstimation_result(getLogisticsEstimation_result other) {
1029
      if (other.isSetSuccess()) {
1030
        List<ItemLogistics> __this__success = new ArrayList<ItemLogistics>();
1031
        for (ItemLogistics other_element : other.success) {
1032
          __this__success.add(new ItemLogistics(other_element));
1033
        }
1034
        this.success = __this__success;
1035
      }
1036
      if (other.isSetSe()) {
1037
        this.se = new HelperServiceException(other.se);
1038
      }
1039
    }
1040
 
1041
    public getLogisticsEstimation_result deepCopy() {
1042
      return new getLogisticsEstimation_result(this);
1043
    }
1044
 
1045
    @Deprecated
1046
    public getLogisticsEstimation_result clone() {
1047
      return new getLogisticsEstimation_result(this);
1048
    }
1049
 
1050
    public int getSuccessSize() {
1051
      return (this.success == null) ? 0 : this.success.size();
1052
    }
1053
 
1054
    public java.util.Iterator<ItemLogistics> getSuccessIterator() {
1055
      return (this.success == null) ? null : this.success.iterator();
1056
    }
1057
 
1058
    public void addToSuccess(ItemLogistics elem) {
1059
      if (this.success == null) {
1060
        this.success = new ArrayList<ItemLogistics>();
1061
      }
1062
      this.success.add(elem);
1063
    }
1064
 
1065
    public List<ItemLogistics> getSuccess() {
1066
      return this.success;
1067
    }
1068
 
1069
    public getLogisticsEstimation_result setSuccess(List<ItemLogistics> success) {
1070
      this.success = success;
1071
      return this;
1072
    }
1073
 
1074
    public void unsetSuccess() {
1075
      this.success = null;
1076
    }
1077
 
1078
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
1079
    public boolean isSetSuccess() {
1080
      return this.success != null;
1081
    }
1082
 
1083
    public void setSuccessIsSet(boolean value) {
1084
      if (!value) {
1085
        this.success = null;
1086
      }
1087
    }
1088
 
1089
    public HelperServiceException getSe() {
1090
      return this.se;
1091
    }
1092
 
1093
    public getLogisticsEstimation_result setSe(HelperServiceException se) {
1094
      this.se = se;
1095
      return this;
1096
    }
1097
 
1098
    public void unsetSe() {
1099
      this.se = null;
1100
    }
1101
 
1102
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
1103
    public boolean isSetSe() {
1104
      return this.se != null;
1105
    }
1106
 
1107
    public void setSeIsSet(boolean value) {
1108
      if (!value) {
1109
        this.se = null;
1110
      }
1111
    }
1112
 
1113
    public void setFieldValue(_Fields field, Object value) {
1114
      switch (field) {
1115
      case SUCCESS:
1116
        if (value == null) {
1117
          unsetSuccess();
1118
        } else {
1119
          setSuccess((List<ItemLogistics>)value);
1120
        }
1121
        break;
1122
 
1123
      case SE:
1124
        if (value == null) {
1125
          unsetSe();
1126
        } else {
1127
          setSe((HelperServiceException)value);
1128
        }
1129
        break;
1130
 
1131
      }
1132
    }
1133
 
1134
    public void setFieldValue(int fieldID, Object value) {
1135
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1136
    }
1137
 
1138
    public Object getFieldValue(_Fields field) {
1139
      switch (field) {
1140
      case SUCCESS:
1141
        return getSuccess();
1142
 
1143
      case SE:
1144
        return getSe();
1145
 
1146
      }
1147
      throw new IllegalStateException();
1148
    }
1149
 
1150
    public Object getFieldValue(int fieldId) {
1151
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1152
    }
1153
 
1154
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1155
    public boolean isSet(_Fields field) {
1156
      switch (field) {
1157
      case SUCCESS:
1158
        return isSetSuccess();
1159
      case SE:
1160
        return isSetSe();
1161
      }
1162
      throw new IllegalStateException();
1163
    }
1164
 
1165
    public boolean isSet(int fieldID) {
1166
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1167
    }
1168
 
1169
    @Override
1170
    public boolean equals(Object that) {
1171
      if (that == null)
1172
        return false;
1173
      if (that instanceof getLogisticsEstimation_result)
1174
        return this.equals((getLogisticsEstimation_result)that);
1175
      return false;
1176
    }
1177
 
1178
    public boolean equals(getLogisticsEstimation_result that) {
1179
      if (that == null)
1180
        return false;
1181
 
1182
      boolean this_present_success = true && this.isSetSuccess();
1183
      boolean that_present_success = true && that.isSetSuccess();
1184
      if (this_present_success || that_present_success) {
1185
        if (!(this_present_success && that_present_success))
1186
          return false;
1187
        if (!this.success.equals(that.success))
1188
          return false;
1189
      }
1190
 
1191
      boolean this_present_se = true && this.isSetSe();
1192
      boolean that_present_se = true && that.isSetSe();
1193
      if (this_present_se || that_present_se) {
1194
        if (!(this_present_se && that_present_se))
1195
          return false;
1196
        if (!this.se.equals(that.se))
1197
          return false;
1198
      }
1199
 
1200
      return true;
1201
    }
1202
 
1203
    @Override
1204
    public int hashCode() {
1205
      return 0;
1206
    }
1207
 
1208
    public int compareTo(getLogisticsEstimation_result other) {
1209
      if (!getClass().equals(other.getClass())) {
1210
        return getClass().getName().compareTo(other.getClass().getName());
1211
      }
1212
 
1213
      int lastComparison = 0;
1214
      getLogisticsEstimation_result typedOther = (getLogisticsEstimation_result)other;
1215
 
1216
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
1217
      if (lastComparison != 0) {
1218
        return lastComparison;
1219
      }
1220
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
1221
      if (lastComparison != 0) {
1222
        return lastComparison;
1223
      }
1224
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
1225
      if (lastComparison != 0) {
1226
        return lastComparison;
1227
      }
1228
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
1229
      if (lastComparison != 0) {
1230
        return lastComparison;
1231
      }
1232
      return 0;
1233
    }
1234
 
1235
    public void read(TProtocol iprot) throws TException {
1236
      TField field;
1237
      iprot.readStructBegin();
1238
      while (true)
1239
      {
1240
        field = iprot.readFieldBegin();
1241
        if (field.type == TType.STOP) { 
1242
          break;
1243
        }
1244
        _Fields fieldId = _Fields.findByThriftId(field.id);
1245
        if (fieldId == null) {
1246
          TProtocolUtil.skip(iprot, field.type);
1247
        } else {
1248
          switch (fieldId) {
1249
            case SUCCESS:
1250
              if (field.type == TType.LIST) {
1251
                {
1252
                  TList _list13 = iprot.readListBegin();
1253
                  this.success = new ArrayList<ItemLogistics>(_list13.size);
1254
                  for (int _i14 = 0; _i14 < _list13.size; ++_i14)
1255
                  {
1256
                    ItemLogistics _elem15;
1257
                    _elem15 = new ItemLogistics();
1258
                    _elem15.read(iprot);
1259
                    this.success.add(_elem15);
1260
                  }
1261
                  iprot.readListEnd();
1262
                }
1263
              } else { 
1264
                TProtocolUtil.skip(iprot, field.type);
1265
              }
1266
              break;
1267
            case SE:
1268
              if (field.type == TType.STRUCT) {
1269
                this.se = new HelperServiceException();
1270
                this.se.read(iprot);
1271
              } else { 
1272
                TProtocolUtil.skip(iprot, field.type);
1273
              }
1274
              break;
1275
          }
1276
          iprot.readFieldEnd();
1277
        }
1278
      }
1279
      iprot.readStructEnd();
1280
      validate();
1281
    }
1282
 
1283
    public void write(TProtocol oprot) throws TException {
1284
      oprot.writeStructBegin(STRUCT_DESC);
1285
 
1286
      if (this.isSetSuccess()) {
1287
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
1288
        {
1289
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
1290
          for (ItemLogistics _iter16 : this.success)
1291
          {
1292
            _iter16.write(oprot);
1293
          }
1294
          oprot.writeListEnd();
1295
        }
1296
        oprot.writeFieldEnd();
1297
      } else if (this.isSetSe()) {
1298
        oprot.writeFieldBegin(SE_FIELD_DESC);
1299
        this.se.write(oprot);
1300
        oprot.writeFieldEnd();
1301
      }
1302
      oprot.writeFieldStop();
1303
      oprot.writeStructEnd();
1304
    }
1305
 
1306
    @Override
1307
    public String toString() {
1308
      StringBuilder sb = new StringBuilder("getLogisticsEstimation_result(");
1309
      boolean first = true;
1310
 
1311
      sb.append("success:");
1312
      if (this.success == null) {
1313
        sb.append("null");
1314
      } else {
1315
        sb.append(this.success);
1316
      }
1317
      first = false;
1318
      if (!first) sb.append(", ");
1319
      sb.append("se:");
1320
      if (this.se == null) {
1321
        sb.append("null");
1322
      } else {
1323
        sb.append(this.se);
1324
      }
1325
      first = false;
1326
      sb.append(")");
1327
      return sb.toString();
1328
    }
1329
 
1330
    public void validate() throws TException {
1331
      // check for required fields
1332
    }
1333
 
1334
  }
1335
 
1336
  public static class sendMail_args implements TBase<sendMail_args._Fields>, java.io.Serializable, Cloneable, Comparable<sendMail_args>   {
1337
    private static final TStruct STRUCT_DESC = new TStruct("sendMail_args");
1338
 
1339
    private static final TField MAIL_FIELD_DESC = new TField("mail", TType.STRUCT, (short)1);
1340
 
1341
    private Mail mail;
1342
 
1343
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1344
    public enum _Fields implements TFieldIdEnum {
1345
      MAIL((short)1, "mail");
1346
 
1347
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1348
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1349
 
1350
      static {
1351
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1352
          byId.put((int)field._thriftId, field);
1353
          byName.put(field.getFieldName(), field);
1354
        }
1355
      }
1356
 
1357
      /**
1358
       * Find the _Fields constant that matches fieldId, or null if its not found.
1359
       */
1360
      public static _Fields findByThriftId(int fieldId) {
1361
        return byId.get(fieldId);
1362
      }
1363
 
1364
      /**
1365
       * Find the _Fields constant that matches fieldId, throwing an exception
1366
       * if it is not found.
1367
       */
1368
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1369
        _Fields fields = findByThriftId(fieldId);
1370
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1371
        return fields;
1372
      }
1373
 
1374
      /**
1375
       * Find the _Fields constant that matches name, or null if its not found.
1376
       */
1377
      public static _Fields findByName(String name) {
1378
        return byName.get(name);
1379
      }
1380
 
1381
      private final short _thriftId;
1382
      private final String _fieldName;
1383
 
1384
      _Fields(short thriftId, String fieldName) {
1385
        _thriftId = thriftId;
1386
        _fieldName = fieldName;
1387
      }
1388
 
1389
      public short getThriftFieldId() {
1390
        return _thriftId;
1391
      }
1392
 
1393
      public String getFieldName() {
1394
        return _fieldName;
1395
      }
1396
    }
1397
 
1398
    // isset id assignments
1399
 
1400
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1401
      put(_Fields.MAIL, new FieldMetaData("mail", TFieldRequirementType.DEFAULT, 
1402
          new StructMetaData(TType.STRUCT, Mail.class)));
1403
    }});
1404
 
1405
    static {
1406
      FieldMetaData.addStructMetaDataMap(sendMail_args.class, metaDataMap);
1407
    }
1408
 
1409
    public sendMail_args() {
1410
    }
1411
 
1412
    public sendMail_args(
1413
      Mail mail)
1414
    {
1415
      this();
1416
      this.mail = mail;
1417
    }
1418
 
1419
    /**
1420
     * Performs a deep copy on <i>other</i>.
1421
     */
1422
    public sendMail_args(sendMail_args other) {
1423
      if (other.isSetMail()) {
1424
        this.mail = new Mail(other.mail);
1425
      }
1426
    }
1427
 
1428
    public sendMail_args deepCopy() {
1429
      return new sendMail_args(this);
1430
    }
1431
 
1432
    @Deprecated
1433
    public sendMail_args clone() {
1434
      return new sendMail_args(this);
1435
    }
1436
 
1437
    public Mail getMail() {
1438
      return this.mail;
1439
    }
1440
 
1441
    public sendMail_args setMail(Mail mail) {
1442
      this.mail = mail;
1443
      return this;
1444
    }
1445
 
1446
    public void unsetMail() {
1447
      this.mail = null;
1448
    }
1449
 
1450
    /** Returns true if field mail is set (has been asigned a value) and false otherwise */
1451
    public boolean isSetMail() {
1452
      return this.mail != null;
1453
    }
1454
 
1455
    public void setMailIsSet(boolean value) {
1456
      if (!value) {
1457
        this.mail = null;
1458
      }
1459
    }
1460
 
1461
    public void setFieldValue(_Fields field, Object value) {
1462
      switch (field) {
1463
      case MAIL:
1464
        if (value == null) {
1465
          unsetMail();
1466
        } else {
1467
          setMail((Mail)value);
1468
        }
1469
        break;
1470
 
1471
      }
1472
    }
1473
 
1474
    public void setFieldValue(int fieldID, Object value) {
1475
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1476
    }
1477
 
1478
    public Object getFieldValue(_Fields field) {
1479
      switch (field) {
1480
      case MAIL:
1481
        return getMail();
1482
 
1483
      }
1484
      throw new IllegalStateException();
1485
    }
1486
 
1487
    public Object getFieldValue(int fieldId) {
1488
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1489
    }
1490
 
1491
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1492
    public boolean isSet(_Fields field) {
1493
      switch (field) {
1494
      case MAIL:
1495
        return isSetMail();
1496
      }
1497
      throw new IllegalStateException();
1498
    }
1499
 
1500
    public boolean isSet(int fieldID) {
1501
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1502
    }
1503
 
1504
    @Override
1505
    public boolean equals(Object that) {
1506
      if (that == null)
1507
        return false;
1508
      if (that instanceof sendMail_args)
1509
        return this.equals((sendMail_args)that);
1510
      return false;
1511
    }
1512
 
1513
    public boolean equals(sendMail_args that) {
1514
      if (that == null)
1515
        return false;
1516
 
1517
      boolean this_present_mail = true && this.isSetMail();
1518
      boolean that_present_mail = true && that.isSetMail();
1519
      if (this_present_mail || that_present_mail) {
1520
        if (!(this_present_mail && that_present_mail))
1521
          return false;
1522
        if (!this.mail.equals(that.mail))
1523
          return false;
1524
      }
1525
 
1526
      return true;
1527
    }
1528
 
1529
    @Override
1530
    public int hashCode() {
1531
      return 0;
1532
    }
1533
 
1534
    public int compareTo(sendMail_args other) {
1535
      if (!getClass().equals(other.getClass())) {
1536
        return getClass().getName().compareTo(other.getClass().getName());
1537
      }
1538
 
1539
      int lastComparison = 0;
1540
      sendMail_args typedOther = (sendMail_args)other;
1541
 
1542
      lastComparison = Boolean.valueOf(isSetMail()).compareTo(isSetMail());
1543
      if (lastComparison != 0) {
1544
        return lastComparison;
1545
      }
1546
      lastComparison = TBaseHelper.compareTo(mail, typedOther.mail);
1547
      if (lastComparison != 0) {
1548
        return lastComparison;
1549
      }
1550
      return 0;
1551
    }
1552
 
1553
    public void read(TProtocol iprot) throws TException {
1554
      TField field;
1555
      iprot.readStructBegin();
1556
      while (true)
1557
      {
1558
        field = iprot.readFieldBegin();
1559
        if (field.type == TType.STOP) { 
1560
          break;
1561
        }
1562
        _Fields fieldId = _Fields.findByThriftId(field.id);
1563
        if (fieldId == null) {
1564
          TProtocolUtil.skip(iprot, field.type);
1565
        } else {
1566
          switch (fieldId) {
1567
            case MAIL:
1568
              if (field.type == TType.STRUCT) {
1569
                this.mail = new Mail();
1570
                this.mail.read(iprot);
1571
              } else { 
1572
                TProtocolUtil.skip(iprot, field.type);
1573
              }
1574
              break;
1575
          }
1576
          iprot.readFieldEnd();
1577
        }
1578
      }
1579
      iprot.readStructEnd();
1580
      validate();
1581
    }
1582
 
1583
    public void write(TProtocol oprot) throws TException {
1584
      validate();
1585
 
1586
      oprot.writeStructBegin(STRUCT_DESC);
1587
      if (this.mail != null) {
1588
        oprot.writeFieldBegin(MAIL_FIELD_DESC);
1589
        this.mail.write(oprot);
1590
        oprot.writeFieldEnd();
1591
      }
1592
      oprot.writeFieldStop();
1593
      oprot.writeStructEnd();
1594
    }
1595
 
1596
    @Override
1597
    public String toString() {
1598
      StringBuilder sb = new StringBuilder("sendMail_args(");
1599
      boolean first = true;
1600
 
1601
      sb.append("mail:");
1602
      if (this.mail == null) {
1603
        sb.append("null");
1604
      } else {
1605
        sb.append(this.mail);
1606
      }
1607
      first = false;
1608
      sb.append(")");
1609
      return sb.toString();
1610
    }
1611
 
1612
    public void validate() throws TException {
1613
      // check for required fields
1614
    }
1615
 
1616
  }
1617
 
1618
  public static class sendMail_result implements TBase<sendMail_result._Fields>, java.io.Serializable, Cloneable, Comparable<sendMail_result>   {
1619
    private static final TStruct STRUCT_DESC = new TStruct("sendMail_result");
1620
 
1621
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
1622
 
1623
    private HelperServiceException se;
1624
 
1625
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1626
    public enum _Fields implements TFieldIdEnum {
1627
      SE((short)1, "se");
1628
 
1629
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1630
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1631
 
1632
      static {
1633
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1634
          byId.put((int)field._thriftId, field);
1635
          byName.put(field.getFieldName(), field);
1636
        }
1637
      }
1638
 
1639
      /**
1640
       * Find the _Fields constant that matches fieldId, or null if its not found.
1641
       */
1642
      public static _Fields findByThriftId(int fieldId) {
1643
        return byId.get(fieldId);
1644
      }
1645
 
1646
      /**
1647
       * Find the _Fields constant that matches fieldId, throwing an exception
1648
       * if it is not found.
1649
       */
1650
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1651
        _Fields fields = findByThriftId(fieldId);
1652
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1653
        return fields;
1654
      }
1655
 
1656
      /**
1657
       * Find the _Fields constant that matches name, or null if its not found.
1658
       */
1659
      public static _Fields findByName(String name) {
1660
        return byName.get(name);
1661
      }
1662
 
1663
      private final short _thriftId;
1664
      private final String _fieldName;
1665
 
1666
      _Fields(short thriftId, String fieldName) {
1667
        _thriftId = thriftId;
1668
        _fieldName = fieldName;
1669
      }
1670
 
1671
      public short getThriftFieldId() {
1672
        return _thriftId;
1673
      }
1674
 
1675
      public String getFieldName() {
1676
        return _fieldName;
1677
      }
1678
    }
1679
 
1680
    // isset id assignments
1681
 
1682
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1683
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
1684
          new FieldValueMetaData(TType.STRUCT)));
1685
    }});
1686
 
1687
    static {
1688
      FieldMetaData.addStructMetaDataMap(sendMail_result.class, metaDataMap);
1689
    }
1690
 
1691
    public sendMail_result() {
1692
    }
1693
 
1694
    public sendMail_result(
1695
      HelperServiceException se)
1696
    {
1697
      this();
1698
      this.se = se;
1699
    }
1700
 
1701
    /**
1702
     * Performs a deep copy on <i>other</i>.
1703
     */
1704
    public sendMail_result(sendMail_result other) {
1705
      if (other.isSetSe()) {
1706
        this.se = new HelperServiceException(other.se);
1707
      }
1708
    }
1709
 
1710
    public sendMail_result deepCopy() {
1711
      return new sendMail_result(this);
1712
    }
1713
 
1714
    @Deprecated
1715
    public sendMail_result clone() {
1716
      return new sendMail_result(this);
1717
    }
1718
 
1719
    public HelperServiceException getSe() {
1720
      return this.se;
1721
    }
1722
 
1723
    public sendMail_result setSe(HelperServiceException se) {
1724
      this.se = se;
1725
      return this;
1726
    }
1727
 
1728
    public void unsetSe() {
1729
      this.se = null;
1730
    }
1731
 
1732
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
1733
    public boolean isSetSe() {
1734
      return this.se != null;
1735
    }
1736
 
1737
    public void setSeIsSet(boolean value) {
1738
      if (!value) {
1739
        this.se = null;
1740
      }
1741
    }
1742
 
1743
    public void setFieldValue(_Fields field, Object value) {
1744
      switch (field) {
1745
      case SE:
1746
        if (value == null) {
1747
          unsetSe();
1748
        } else {
1749
          setSe((HelperServiceException)value);
1750
        }
1751
        break;
1752
 
1753
      }
1754
    }
1755
 
1756
    public void setFieldValue(int fieldID, Object value) {
1757
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1758
    }
1759
 
1760
    public Object getFieldValue(_Fields field) {
1761
      switch (field) {
1762
      case SE:
1763
        return getSe();
1764
 
1765
      }
1766
      throw new IllegalStateException();
1767
    }
1768
 
1769
    public Object getFieldValue(int fieldId) {
1770
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1771
    }
1772
 
1773
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1774
    public boolean isSet(_Fields field) {
1775
      switch (field) {
1776
      case SE:
1777
        return isSetSe();
1778
      }
1779
      throw new IllegalStateException();
1780
    }
1781
 
1782
    public boolean isSet(int fieldID) {
1783
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1784
    }
1785
 
1786
    @Override
1787
    public boolean equals(Object that) {
1788
      if (that == null)
1789
        return false;
1790
      if (that instanceof sendMail_result)
1791
        return this.equals((sendMail_result)that);
1792
      return false;
1793
    }
1794
 
1795
    public boolean equals(sendMail_result that) {
1796
      if (that == null)
1797
        return false;
1798
 
1799
      boolean this_present_se = true && this.isSetSe();
1800
      boolean that_present_se = true && that.isSetSe();
1801
      if (this_present_se || that_present_se) {
1802
        if (!(this_present_se && that_present_se))
1803
          return false;
1804
        if (!this.se.equals(that.se))
1805
          return false;
1806
      }
1807
 
1808
      return true;
1809
    }
1810
 
1811
    @Override
1812
    public int hashCode() {
1813
      return 0;
1814
    }
1815
 
1816
    public int compareTo(sendMail_result other) {
1817
      if (!getClass().equals(other.getClass())) {
1818
        return getClass().getName().compareTo(other.getClass().getName());
1819
      }
1820
 
1821
      int lastComparison = 0;
1822
      sendMail_result typedOther = (sendMail_result)other;
1823
 
1824
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
1825
      if (lastComparison != 0) {
1826
        return lastComparison;
1827
      }
1828
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
1829
      if (lastComparison != 0) {
1830
        return lastComparison;
1831
      }
1832
      return 0;
1833
    }
1834
 
1835
    public void read(TProtocol iprot) throws TException {
1836
      TField field;
1837
      iprot.readStructBegin();
1838
      while (true)
1839
      {
1840
        field = iprot.readFieldBegin();
1841
        if (field.type == TType.STOP) { 
1842
          break;
1843
        }
1844
        _Fields fieldId = _Fields.findByThriftId(field.id);
1845
        if (fieldId == null) {
1846
          TProtocolUtil.skip(iprot, field.type);
1847
        } else {
1848
          switch (fieldId) {
1849
            case SE:
1850
              if (field.type == TType.STRUCT) {
1851
                this.se = new HelperServiceException();
1852
                this.se.read(iprot);
1853
              } else { 
1854
                TProtocolUtil.skip(iprot, field.type);
1855
              }
1856
              break;
1857
          }
1858
          iprot.readFieldEnd();
1859
        }
1860
      }
1861
      iprot.readStructEnd();
1862
      validate();
1863
    }
1864
 
1865
    public void write(TProtocol oprot) throws TException {
1866
      oprot.writeStructBegin(STRUCT_DESC);
1867
 
1868
      if (this.isSetSe()) {
1869
        oprot.writeFieldBegin(SE_FIELD_DESC);
1870
        this.se.write(oprot);
1871
        oprot.writeFieldEnd();
1872
      }
1873
      oprot.writeFieldStop();
1874
      oprot.writeStructEnd();
1875
    }
1876
 
1877
    @Override
1878
    public String toString() {
1879
      StringBuilder sb = new StringBuilder("sendMail_result(");
1880
      boolean first = true;
1881
 
1882
      sb.append("se:");
1883
      if (this.se == null) {
1884
        sb.append("null");
1885
      } else {
1886
        sb.append(this.se);
1887
      }
1888
      first = false;
1889
      sb.append(")");
1890
      return sb.toString();
1891
    }
1892
 
1893
    public void validate() throws TException {
1894
      // check for required fields
1895
    }
1896
 
1897
  }
1898
 
1899
  public static class sendText_args implements TBase<sendText_args._Fields>, java.io.Serializable, Cloneable, Comparable<sendText_args>   {
1900
    private static final TStruct STRUCT_DESC = new TStruct("sendText_args");
1901
 
1902
    private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRUCT, (short)1);
1903
 
1904
    private TextMessage message;
1905
 
1906
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1907
    public enum _Fields implements TFieldIdEnum {
1908
      MESSAGE((short)1, "message");
1909
 
1910
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1911
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1912
 
1913
      static {
1914
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1915
          byId.put((int)field._thriftId, field);
1916
          byName.put(field.getFieldName(), field);
1917
        }
1918
      }
1919
 
1920
      /**
1921
       * Find the _Fields constant that matches fieldId, or null if its not found.
1922
       */
1923
      public static _Fields findByThriftId(int fieldId) {
1924
        return byId.get(fieldId);
1925
      }
1926
 
1927
      /**
1928
       * Find the _Fields constant that matches fieldId, throwing an exception
1929
       * if it is not found.
1930
       */
1931
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1932
        _Fields fields = findByThriftId(fieldId);
1933
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1934
        return fields;
1935
      }
1936
 
1937
      /**
1938
       * Find the _Fields constant that matches name, or null if its not found.
1939
       */
1940
      public static _Fields findByName(String name) {
1941
        return byName.get(name);
1942
      }
1943
 
1944
      private final short _thriftId;
1945
      private final String _fieldName;
1946
 
1947
      _Fields(short thriftId, String fieldName) {
1948
        _thriftId = thriftId;
1949
        _fieldName = fieldName;
1950
      }
1951
 
1952
      public short getThriftFieldId() {
1953
        return _thriftId;
1954
      }
1955
 
1956
      public String getFieldName() {
1957
        return _fieldName;
1958
      }
1959
    }
1960
 
1961
    // isset id assignments
1962
 
1963
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1964
      put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, 
1965
          new StructMetaData(TType.STRUCT, TextMessage.class)));
1966
    }});
1967
 
1968
    static {
1969
      FieldMetaData.addStructMetaDataMap(sendText_args.class, metaDataMap);
1970
    }
1971
 
1972
    public sendText_args() {
1973
    }
1974
 
1975
    public sendText_args(
1976
      TextMessage message)
1977
    {
1978
      this();
1979
      this.message = message;
1980
    }
1981
 
1982
    /**
1983
     * Performs a deep copy on <i>other</i>.
1984
     */
1985
    public sendText_args(sendText_args other) {
1986
      if (other.isSetMessage()) {
1987
        this.message = new TextMessage(other.message);
1988
      }
1989
    }
1990
 
1991
    public sendText_args deepCopy() {
1992
      return new sendText_args(this);
1993
    }
1994
 
1995
    @Deprecated
1996
    public sendText_args clone() {
1997
      return new sendText_args(this);
1998
    }
1999
 
2000
    public TextMessage getMessage() {
2001
      return this.message;
2002
    }
2003
 
2004
    public sendText_args setMessage(TextMessage message) {
2005
      this.message = message;
2006
      return this;
2007
    }
2008
 
2009
    public void unsetMessage() {
2010
      this.message = null;
2011
    }
2012
 
2013
    /** Returns true if field message is set (has been asigned a value) and false otherwise */
2014
    public boolean isSetMessage() {
2015
      return this.message != null;
2016
    }
2017
 
2018
    public void setMessageIsSet(boolean value) {
2019
      if (!value) {
2020
        this.message = null;
2021
      }
2022
    }
2023
 
2024
    public void setFieldValue(_Fields field, Object value) {
2025
      switch (field) {
2026
      case MESSAGE:
2027
        if (value == null) {
2028
          unsetMessage();
2029
        } else {
2030
          setMessage((TextMessage)value);
2031
        }
2032
        break;
2033
 
2034
      }
2035
    }
2036
 
2037
    public void setFieldValue(int fieldID, Object value) {
2038
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2039
    }
2040
 
2041
    public Object getFieldValue(_Fields field) {
2042
      switch (field) {
2043
      case MESSAGE:
2044
        return getMessage();
2045
 
2046
      }
2047
      throw new IllegalStateException();
2048
    }
2049
 
2050
    public Object getFieldValue(int fieldId) {
2051
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2052
    }
2053
 
2054
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2055
    public boolean isSet(_Fields field) {
2056
      switch (field) {
2057
      case MESSAGE:
2058
        return isSetMessage();
2059
      }
2060
      throw new IllegalStateException();
2061
    }
2062
 
2063
    public boolean isSet(int fieldID) {
2064
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2065
    }
2066
 
2067
    @Override
2068
    public boolean equals(Object that) {
2069
      if (that == null)
2070
        return false;
2071
      if (that instanceof sendText_args)
2072
        return this.equals((sendText_args)that);
2073
      return false;
2074
    }
2075
 
2076
    public boolean equals(sendText_args that) {
2077
      if (that == null)
2078
        return false;
2079
 
2080
      boolean this_present_message = true && this.isSetMessage();
2081
      boolean that_present_message = true && that.isSetMessage();
2082
      if (this_present_message || that_present_message) {
2083
        if (!(this_present_message && that_present_message))
2084
          return false;
2085
        if (!this.message.equals(that.message))
2086
          return false;
2087
      }
2088
 
2089
      return true;
2090
    }
2091
 
2092
    @Override
2093
    public int hashCode() {
2094
      return 0;
2095
    }
2096
 
2097
    public int compareTo(sendText_args other) {
2098
      if (!getClass().equals(other.getClass())) {
2099
        return getClass().getName().compareTo(other.getClass().getName());
2100
      }
2101
 
2102
      int lastComparison = 0;
2103
      sendText_args typedOther = (sendText_args)other;
2104
 
2105
      lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
2106
      if (lastComparison != 0) {
2107
        return lastComparison;
2108
      }
2109
      lastComparison = TBaseHelper.compareTo(message, typedOther.message);
2110
      if (lastComparison != 0) {
2111
        return lastComparison;
2112
      }
2113
      return 0;
2114
    }
2115
 
2116
    public void read(TProtocol iprot) throws TException {
2117
      TField field;
2118
      iprot.readStructBegin();
2119
      while (true)
2120
      {
2121
        field = iprot.readFieldBegin();
2122
        if (field.type == TType.STOP) { 
2123
          break;
2124
        }
2125
        _Fields fieldId = _Fields.findByThriftId(field.id);
2126
        if (fieldId == null) {
2127
          TProtocolUtil.skip(iprot, field.type);
2128
        } else {
2129
          switch (fieldId) {
2130
            case MESSAGE:
2131
              if (field.type == TType.STRUCT) {
2132
                this.message = new TextMessage();
2133
                this.message.read(iprot);
2134
              } else { 
2135
                TProtocolUtil.skip(iprot, field.type);
2136
              }
2137
              break;
2138
          }
2139
          iprot.readFieldEnd();
2140
        }
2141
      }
2142
      iprot.readStructEnd();
2143
      validate();
2144
    }
2145
 
2146
    public void write(TProtocol oprot) throws TException {
2147
      validate();
2148
 
2149
      oprot.writeStructBegin(STRUCT_DESC);
2150
      if (this.message != null) {
2151
        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
2152
        this.message.write(oprot);
2153
        oprot.writeFieldEnd();
2154
      }
2155
      oprot.writeFieldStop();
2156
      oprot.writeStructEnd();
2157
    }
2158
 
2159
    @Override
2160
    public String toString() {
2161
      StringBuilder sb = new StringBuilder("sendText_args(");
2162
      boolean first = true;
2163
 
2164
      sb.append("message:");
2165
      if (this.message == null) {
2166
        sb.append("null");
2167
      } else {
2168
        sb.append(this.message);
2169
      }
2170
      first = false;
2171
      sb.append(")");
2172
      return sb.toString();
2173
    }
2174
 
2175
    public void validate() throws TException {
2176
      // check for required fields
2177
    }
2178
 
2179
  }
2180
 
2181
  public static class sendText_result implements TBase<sendText_result._Fields>, java.io.Serializable, Cloneable, Comparable<sendText_result>   {
2182
    private static final TStruct STRUCT_DESC = new TStruct("sendText_result");
2183
 
2184
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
2185
 
2186
    private HelperServiceException se;
2187
 
2188
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2189
    public enum _Fields implements TFieldIdEnum {
2190
      SE((short)1, "se");
2191
 
2192
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2193
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2194
 
2195
      static {
2196
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2197
          byId.put((int)field._thriftId, field);
2198
          byName.put(field.getFieldName(), field);
2199
        }
2200
      }
2201
 
2202
      /**
2203
       * Find the _Fields constant that matches fieldId, or null if its not found.
2204
       */
2205
      public static _Fields findByThriftId(int fieldId) {
2206
        return byId.get(fieldId);
2207
      }
2208
 
2209
      /**
2210
       * Find the _Fields constant that matches fieldId, throwing an exception
2211
       * if it is not found.
2212
       */
2213
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2214
        _Fields fields = findByThriftId(fieldId);
2215
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2216
        return fields;
2217
      }
2218
 
2219
      /**
2220
       * Find the _Fields constant that matches name, or null if its not found.
2221
       */
2222
      public static _Fields findByName(String name) {
2223
        return byName.get(name);
2224
      }
2225
 
2226
      private final short _thriftId;
2227
      private final String _fieldName;
2228
 
2229
      _Fields(short thriftId, String fieldName) {
2230
        _thriftId = thriftId;
2231
        _fieldName = fieldName;
2232
      }
2233
 
2234
      public short getThriftFieldId() {
2235
        return _thriftId;
2236
      }
2237
 
2238
      public String getFieldName() {
2239
        return _fieldName;
2240
      }
2241
    }
2242
 
2243
    // isset id assignments
2244
 
2245
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2246
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
2247
          new FieldValueMetaData(TType.STRUCT)));
2248
    }});
2249
 
2250
    static {
2251
      FieldMetaData.addStructMetaDataMap(sendText_result.class, metaDataMap);
2252
    }
2253
 
2254
    public sendText_result() {
2255
    }
2256
 
2257
    public sendText_result(
2258
      HelperServiceException se)
2259
    {
2260
      this();
2261
      this.se = se;
2262
    }
2263
 
2264
    /**
2265
     * Performs a deep copy on <i>other</i>.
2266
     */
2267
    public sendText_result(sendText_result other) {
2268
      if (other.isSetSe()) {
2269
        this.se = new HelperServiceException(other.se);
2270
      }
2271
    }
2272
 
2273
    public sendText_result deepCopy() {
2274
      return new sendText_result(this);
2275
    }
2276
 
2277
    @Deprecated
2278
    public sendText_result clone() {
2279
      return new sendText_result(this);
2280
    }
2281
 
2282
    public HelperServiceException getSe() {
2283
      return this.se;
2284
    }
2285
 
2286
    public sendText_result setSe(HelperServiceException se) {
2287
      this.se = se;
2288
      return this;
2289
    }
2290
 
2291
    public void unsetSe() {
2292
      this.se = null;
2293
    }
2294
 
2295
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
2296
    public boolean isSetSe() {
2297
      return this.se != null;
2298
    }
2299
 
2300
    public void setSeIsSet(boolean value) {
2301
      if (!value) {
2302
        this.se = null;
2303
      }
2304
    }
2305
 
2306
    public void setFieldValue(_Fields field, Object value) {
2307
      switch (field) {
2308
      case SE:
2309
        if (value == null) {
2310
          unsetSe();
2311
        } else {
2312
          setSe((HelperServiceException)value);
2313
        }
2314
        break;
2315
 
2316
      }
2317
    }
2318
 
2319
    public void setFieldValue(int fieldID, Object value) {
2320
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2321
    }
2322
 
2323
    public Object getFieldValue(_Fields field) {
2324
      switch (field) {
2325
      case SE:
2326
        return getSe();
2327
 
2328
      }
2329
      throw new IllegalStateException();
2330
    }
2331
 
2332
    public Object getFieldValue(int fieldId) {
2333
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2334
    }
2335
 
2336
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2337
    public boolean isSet(_Fields field) {
2338
      switch (field) {
2339
      case SE:
2340
        return isSetSe();
2341
      }
2342
      throw new IllegalStateException();
2343
    }
2344
 
2345
    public boolean isSet(int fieldID) {
2346
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2347
    }
2348
 
2349
    @Override
2350
    public boolean equals(Object that) {
2351
      if (that == null)
2352
        return false;
2353
      if (that instanceof sendText_result)
2354
        return this.equals((sendText_result)that);
2355
      return false;
2356
    }
2357
 
2358
    public boolean equals(sendText_result that) {
2359
      if (that == null)
2360
        return false;
2361
 
2362
      boolean this_present_se = true && this.isSetSe();
2363
      boolean that_present_se = true && that.isSetSe();
2364
      if (this_present_se || that_present_se) {
2365
        if (!(this_present_se && that_present_se))
2366
          return false;
2367
        if (!this.se.equals(that.se))
2368
          return false;
2369
      }
2370
 
2371
      return true;
2372
    }
2373
 
2374
    @Override
2375
    public int hashCode() {
2376
      return 0;
2377
    }
2378
 
2379
    public int compareTo(sendText_result other) {
2380
      if (!getClass().equals(other.getClass())) {
2381
        return getClass().getName().compareTo(other.getClass().getName());
2382
      }
2383
 
2384
      int lastComparison = 0;
2385
      sendText_result typedOther = (sendText_result)other;
2386
 
2387
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
2388
      if (lastComparison != 0) {
2389
        return lastComparison;
2390
      }
2391
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
2392
      if (lastComparison != 0) {
2393
        return lastComparison;
2394
      }
2395
      return 0;
2396
    }
2397
 
2398
    public void read(TProtocol iprot) throws TException {
2399
      TField field;
2400
      iprot.readStructBegin();
2401
      while (true)
2402
      {
2403
        field = iprot.readFieldBegin();
2404
        if (field.type == TType.STOP) { 
2405
          break;
2406
        }
2407
        _Fields fieldId = _Fields.findByThriftId(field.id);
2408
        if (fieldId == null) {
2409
          TProtocolUtil.skip(iprot, field.type);
2410
        } else {
2411
          switch (fieldId) {
2412
            case SE:
2413
              if (field.type == TType.STRUCT) {
2414
                this.se = new HelperServiceException();
2415
                this.se.read(iprot);
2416
              } else { 
2417
                TProtocolUtil.skip(iprot, field.type);
2418
              }
2419
              break;
2420
          }
2421
          iprot.readFieldEnd();
2422
        }
2423
      }
2424
      iprot.readStructEnd();
2425
      validate();
2426
    }
2427
 
2428
    public void write(TProtocol oprot) throws TException {
2429
      oprot.writeStructBegin(STRUCT_DESC);
2430
 
2431
      if (this.isSetSe()) {
2432
        oprot.writeFieldBegin(SE_FIELD_DESC);
2433
        this.se.write(oprot);
2434
        oprot.writeFieldEnd();
2435
      }
2436
      oprot.writeFieldStop();
2437
      oprot.writeStructEnd();
2438
    }
2439
 
2440
    @Override
2441
    public String toString() {
2442
      StringBuilder sb = new StringBuilder("sendText_result(");
2443
      boolean first = true;
2444
 
2445
      sb.append("se:");
2446
      if (this.se == null) {
2447
        sb.append("null");
2448
      } else {
2449
        sb.append(this.se);
2450
      }
2451
      first = false;
2452
      sb.append(")");
2453
      return sb.toString();
2454
    }
2455
 
2456
    public void validate() throws TException {
2457
      // check for required fields
2458
    }
2459
 
2460
  }
2461
 
2462
  public static class addMessage_args implements TBase<addMessage_args._Fields>, java.io.Serializable, Cloneable, Comparable<addMessage_args>   {
2463
    private static final TStruct STRUCT_DESC = new TStruct("addMessage_args");
2464
 
2465
    private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRUCT, (short)1);
2466
 
2467
    private Message message;
2468
 
2469
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2470
    public enum _Fields implements TFieldIdEnum {
2471
      MESSAGE((short)1, "message");
2472
 
2473
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2474
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2475
 
2476
      static {
2477
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2478
          byId.put((int)field._thriftId, field);
2479
          byName.put(field.getFieldName(), field);
2480
        }
2481
      }
2482
 
2483
      /**
2484
       * Find the _Fields constant that matches fieldId, or null if its not found.
2485
       */
2486
      public static _Fields findByThriftId(int fieldId) {
2487
        return byId.get(fieldId);
2488
      }
2489
 
2490
      /**
2491
       * Find the _Fields constant that matches fieldId, throwing an exception
2492
       * if it is not found.
2493
       */
2494
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2495
        _Fields fields = findByThriftId(fieldId);
2496
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2497
        return fields;
2498
      }
2499
 
2500
      /**
2501
       * Find the _Fields constant that matches name, or null if its not found.
2502
       */
2503
      public static _Fields findByName(String name) {
2504
        return byName.get(name);
2505
      }
2506
 
2507
      private final short _thriftId;
2508
      private final String _fieldName;
2509
 
2510
      _Fields(short thriftId, String fieldName) {
2511
        _thriftId = thriftId;
2512
        _fieldName = fieldName;
2513
      }
2514
 
2515
      public short getThriftFieldId() {
2516
        return _thriftId;
2517
      }
2518
 
2519
      public String getFieldName() {
2520
        return _fieldName;
2521
      }
2522
    }
2523
 
2524
    // isset id assignments
2525
 
2526
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2527
      put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, 
2528
          new StructMetaData(TType.STRUCT, Message.class)));
2529
    }});
2530
 
2531
    static {
2532
      FieldMetaData.addStructMetaDataMap(addMessage_args.class, metaDataMap);
2533
    }
2534
 
2535
    public addMessage_args() {
2536
    }
2537
 
2538
    public addMessage_args(
2539
      Message message)
2540
    {
2541
      this();
2542
      this.message = message;
2543
    }
2544
 
2545
    /**
2546
     * Performs a deep copy on <i>other</i>.
2547
     */
2548
    public addMessage_args(addMessage_args other) {
2549
      if (other.isSetMessage()) {
2550
        this.message = new Message(other.message);
2551
      }
2552
    }
2553
 
2554
    public addMessage_args deepCopy() {
2555
      return new addMessage_args(this);
2556
    }
2557
 
2558
    @Deprecated
2559
    public addMessage_args clone() {
2560
      return new addMessage_args(this);
2561
    }
2562
 
2563
    public Message getMessage() {
2564
      return this.message;
2565
    }
2566
 
2567
    public addMessage_args setMessage(Message message) {
2568
      this.message = message;
2569
      return this;
2570
    }
2571
 
2572
    public void unsetMessage() {
2573
      this.message = null;
2574
    }
2575
 
2576
    /** Returns true if field message is set (has been asigned a value) and false otherwise */
2577
    public boolean isSetMessage() {
2578
      return this.message != null;
2579
    }
2580
 
2581
    public void setMessageIsSet(boolean value) {
2582
      if (!value) {
2583
        this.message = null;
2584
      }
2585
    }
2586
 
2587
    public void setFieldValue(_Fields field, Object value) {
2588
      switch (field) {
2589
      case MESSAGE:
2590
        if (value == null) {
2591
          unsetMessage();
2592
        } else {
2593
          setMessage((Message)value);
2594
        }
2595
        break;
2596
 
2597
      }
2598
    }
2599
 
2600
    public void setFieldValue(int fieldID, Object value) {
2601
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2602
    }
2603
 
2604
    public Object getFieldValue(_Fields field) {
2605
      switch (field) {
2606
      case MESSAGE:
2607
        return getMessage();
2608
 
2609
      }
2610
      throw new IllegalStateException();
2611
    }
2612
 
2613
    public Object getFieldValue(int fieldId) {
2614
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2615
    }
2616
 
2617
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2618
    public boolean isSet(_Fields field) {
2619
      switch (field) {
2620
      case MESSAGE:
2621
        return isSetMessage();
2622
      }
2623
      throw new IllegalStateException();
2624
    }
2625
 
2626
    public boolean isSet(int fieldID) {
2627
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2628
    }
2629
 
2630
    @Override
2631
    public boolean equals(Object that) {
2632
      if (that == null)
2633
        return false;
2634
      if (that instanceof addMessage_args)
2635
        return this.equals((addMessage_args)that);
2636
      return false;
2637
    }
2638
 
2639
    public boolean equals(addMessage_args that) {
2640
      if (that == null)
2641
        return false;
2642
 
2643
      boolean this_present_message = true && this.isSetMessage();
2644
      boolean that_present_message = true && that.isSetMessage();
2645
      if (this_present_message || that_present_message) {
2646
        if (!(this_present_message && that_present_message))
2647
          return false;
2648
        if (!this.message.equals(that.message))
2649
          return false;
2650
      }
2651
 
2652
      return true;
2653
    }
2654
 
2655
    @Override
2656
    public int hashCode() {
2657
      return 0;
2658
    }
2659
 
2660
    public int compareTo(addMessage_args other) {
2661
      if (!getClass().equals(other.getClass())) {
2662
        return getClass().getName().compareTo(other.getClass().getName());
2663
      }
2664
 
2665
      int lastComparison = 0;
2666
      addMessage_args typedOther = (addMessage_args)other;
2667
 
2668
      lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
2669
      if (lastComparison != 0) {
2670
        return lastComparison;
2671
      }
2672
      lastComparison = TBaseHelper.compareTo(message, typedOther.message);
2673
      if (lastComparison != 0) {
2674
        return lastComparison;
2675
      }
2676
      return 0;
2677
    }
2678
 
2679
    public void read(TProtocol iprot) throws TException {
2680
      TField field;
2681
      iprot.readStructBegin();
2682
      while (true)
2683
      {
2684
        field = iprot.readFieldBegin();
2685
        if (field.type == TType.STOP) { 
2686
          break;
2687
        }
2688
        _Fields fieldId = _Fields.findByThriftId(field.id);
2689
        if (fieldId == null) {
2690
          TProtocolUtil.skip(iprot, field.type);
2691
        } else {
2692
          switch (fieldId) {
2693
            case MESSAGE:
2694
              if (field.type == TType.STRUCT) {
2695
                this.message = new Message();
2696
                this.message.read(iprot);
2697
              } else { 
2698
                TProtocolUtil.skip(iprot, field.type);
2699
              }
2700
              break;
2701
          }
2702
          iprot.readFieldEnd();
2703
        }
2704
      }
2705
      iprot.readStructEnd();
2706
      validate();
2707
    }
2708
 
2709
    public void write(TProtocol oprot) throws TException {
2710
      validate();
2711
 
2712
      oprot.writeStructBegin(STRUCT_DESC);
2713
      if (this.message != null) {
2714
        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
2715
        this.message.write(oprot);
2716
        oprot.writeFieldEnd();
2717
      }
2718
      oprot.writeFieldStop();
2719
      oprot.writeStructEnd();
2720
    }
2721
 
2722
    @Override
2723
    public String toString() {
2724
      StringBuilder sb = new StringBuilder("addMessage_args(");
2725
      boolean first = true;
2726
 
2727
      sb.append("message:");
2728
      if (this.message == null) {
2729
        sb.append("null");
2730
      } else {
2731
        sb.append(this.message);
2732
      }
2733
      first = false;
2734
      sb.append(")");
2735
      return sb.toString();
2736
    }
2737
 
2738
    public void validate() throws TException {
2739
      // check for required fields
2740
    }
2741
 
2742
  }
2743
 
2744
  public static class addMessage_result implements TBase<addMessage_result._Fields>, java.io.Serializable, Cloneable, Comparable<addMessage_result>   {
2745
    private static final TStruct STRUCT_DESC = new TStruct("addMessage_result");
2746
 
2747
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
2748
 
2749
    private HelperServiceException se;
2750
 
2751
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2752
    public enum _Fields implements TFieldIdEnum {
2753
      SE((short)1, "se");
2754
 
2755
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2756
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2757
 
2758
      static {
2759
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2760
          byId.put((int)field._thriftId, field);
2761
          byName.put(field.getFieldName(), field);
2762
        }
2763
      }
2764
 
2765
      /**
2766
       * Find the _Fields constant that matches fieldId, or null if its not found.
2767
       */
2768
      public static _Fields findByThriftId(int fieldId) {
2769
        return byId.get(fieldId);
2770
      }
2771
 
2772
      /**
2773
       * Find the _Fields constant that matches fieldId, throwing an exception
2774
       * if it is not found.
2775
       */
2776
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2777
        _Fields fields = findByThriftId(fieldId);
2778
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2779
        return fields;
2780
      }
2781
 
2782
      /**
2783
       * Find the _Fields constant that matches name, or null if its not found.
2784
       */
2785
      public static _Fields findByName(String name) {
2786
        return byName.get(name);
2787
      }
2788
 
2789
      private final short _thriftId;
2790
      private final String _fieldName;
2791
 
2792
      _Fields(short thriftId, String fieldName) {
2793
        _thriftId = thriftId;
2794
        _fieldName = fieldName;
2795
      }
2796
 
2797
      public short getThriftFieldId() {
2798
        return _thriftId;
2799
      }
2800
 
2801
      public String getFieldName() {
2802
        return _fieldName;
2803
      }
2804
    }
2805
 
2806
    // isset id assignments
2807
 
2808
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2809
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
2810
          new FieldValueMetaData(TType.STRUCT)));
2811
    }});
2812
 
2813
    static {
2814
      FieldMetaData.addStructMetaDataMap(addMessage_result.class, metaDataMap);
2815
    }
2816
 
2817
    public addMessage_result() {
2818
    }
2819
 
2820
    public addMessage_result(
2821
      HelperServiceException se)
2822
    {
2823
      this();
2824
      this.se = se;
2825
    }
2826
 
2827
    /**
2828
     * Performs a deep copy on <i>other</i>.
2829
     */
2830
    public addMessage_result(addMessage_result other) {
2831
      if (other.isSetSe()) {
2832
        this.se = new HelperServiceException(other.se);
2833
      }
2834
    }
2835
 
2836
    public addMessage_result deepCopy() {
2837
      return new addMessage_result(this);
2838
    }
2839
 
2840
    @Deprecated
2841
    public addMessage_result clone() {
2842
      return new addMessage_result(this);
2843
    }
2844
 
2845
    public HelperServiceException getSe() {
2846
      return this.se;
2847
    }
2848
 
2849
    public addMessage_result setSe(HelperServiceException se) {
2850
      this.se = se;
2851
      return this;
2852
    }
2853
 
2854
    public void unsetSe() {
2855
      this.se = null;
2856
    }
2857
 
2858
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
2859
    public boolean isSetSe() {
2860
      return this.se != null;
2861
    }
2862
 
2863
    public void setSeIsSet(boolean value) {
2864
      if (!value) {
2865
        this.se = null;
2866
      }
2867
    }
2868
 
2869
    public void setFieldValue(_Fields field, Object value) {
2870
      switch (field) {
2871
      case SE:
2872
        if (value == null) {
2873
          unsetSe();
2874
        } else {
2875
          setSe((HelperServiceException)value);
2876
        }
2877
        break;
2878
 
2879
      }
2880
    }
2881
 
2882
    public void setFieldValue(int fieldID, Object value) {
2883
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2884
    }
2885
 
2886
    public Object getFieldValue(_Fields field) {
2887
      switch (field) {
2888
      case SE:
2889
        return getSe();
2890
 
2891
      }
2892
      throw new IllegalStateException();
2893
    }
2894
 
2895
    public Object getFieldValue(int fieldId) {
2896
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2897
    }
2898
 
2899
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2900
    public boolean isSet(_Fields field) {
2901
      switch (field) {
2902
      case SE:
2903
        return isSetSe();
2904
      }
2905
      throw new IllegalStateException();
2906
    }
2907
 
2908
    public boolean isSet(int fieldID) {
2909
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2910
    }
2911
 
2912
    @Override
2913
    public boolean equals(Object that) {
2914
      if (that == null)
2915
        return false;
2916
      if (that instanceof addMessage_result)
2917
        return this.equals((addMessage_result)that);
2918
      return false;
2919
    }
2920
 
2921
    public boolean equals(addMessage_result that) {
2922
      if (that == null)
2923
        return false;
2924
 
2925
      boolean this_present_se = true && this.isSetSe();
2926
      boolean that_present_se = true && that.isSetSe();
2927
      if (this_present_se || that_present_se) {
2928
        if (!(this_present_se && that_present_se))
2929
          return false;
2930
        if (!this.se.equals(that.se))
2931
          return false;
2932
      }
2933
 
2934
      return true;
2935
    }
2936
 
2937
    @Override
2938
    public int hashCode() {
2939
      return 0;
2940
    }
2941
 
2942
    public int compareTo(addMessage_result other) {
2943
      if (!getClass().equals(other.getClass())) {
2944
        return getClass().getName().compareTo(other.getClass().getName());
2945
      }
2946
 
2947
      int lastComparison = 0;
2948
      addMessage_result typedOther = (addMessage_result)other;
2949
 
2950
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
2951
      if (lastComparison != 0) {
2952
        return lastComparison;
2953
      }
2954
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
2955
      if (lastComparison != 0) {
2956
        return lastComparison;
2957
      }
2958
      return 0;
2959
    }
2960
 
2961
    public void read(TProtocol iprot) throws TException {
2962
      TField field;
2963
      iprot.readStructBegin();
2964
      while (true)
2965
      {
2966
        field = iprot.readFieldBegin();
2967
        if (field.type == TType.STOP) { 
2968
          break;
2969
        }
2970
        _Fields fieldId = _Fields.findByThriftId(field.id);
2971
        if (fieldId == null) {
2972
          TProtocolUtil.skip(iprot, field.type);
2973
        } else {
2974
          switch (fieldId) {
2975
            case SE:
2976
              if (field.type == TType.STRUCT) {
2977
                this.se = new HelperServiceException();
2978
                this.se.read(iprot);
2979
              } else { 
2980
                TProtocolUtil.skip(iprot, field.type);
2981
              }
2982
              break;
2983
          }
2984
          iprot.readFieldEnd();
2985
        }
2986
      }
2987
      iprot.readStructEnd();
2988
      validate();
2989
    }
2990
 
2991
    public void write(TProtocol oprot) throws TException {
2992
      oprot.writeStructBegin(STRUCT_DESC);
2993
 
2994
      if (this.isSetSe()) {
2995
        oprot.writeFieldBegin(SE_FIELD_DESC);
2996
        this.se.write(oprot);
2997
        oprot.writeFieldEnd();
2998
      }
2999
      oprot.writeFieldStop();
3000
      oprot.writeStructEnd();
3001
    }
3002
 
3003
    @Override
3004
    public String toString() {
3005
      StringBuilder sb = new StringBuilder("addMessage_result(");
3006
      boolean first = true;
3007
 
3008
      sb.append("se:");
3009
      if (this.se == null) {
3010
        sb.append("null");
3011
      } else {
3012
        sb.append(this.se);
3013
      }
3014
      first = false;
3015
      sb.append(")");
3016
      return sb.toString();
3017
    }
3018
 
3019
    public void validate() throws TException {
3020
      // check for required fields
3021
    }
3022
 
3023
  }
3024
 
3025
  public static class updateMessage_args implements TBase<updateMessage_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateMessage_args>   {
3026
    private static final TStruct STRUCT_DESC = new TStruct("updateMessage_args");
3027
 
3028
    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
3029
    private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)2);
3030
 
3031
    private long id;
3032
    private String message;
3033
 
3034
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3035
    public enum _Fields implements TFieldIdEnum {
3036
      ID((short)1, "id"),
3037
      MESSAGE((short)2, "message");
3038
 
3039
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3040
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3041
 
3042
      static {
3043
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3044
          byId.put((int)field._thriftId, field);
3045
          byName.put(field.getFieldName(), field);
3046
        }
3047
      }
3048
 
3049
      /**
3050
       * Find the _Fields constant that matches fieldId, or null if its not found.
3051
       */
3052
      public static _Fields findByThriftId(int fieldId) {
3053
        return byId.get(fieldId);
3054
      }
3055
 
3056
      /**
3057
       * Find the _Fields constant that matches fieldId, throwing an exception
3058
       * if it is not found.
3059
       */
3060
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3061
        _Fields fields = findByThriftId(fieldId);
3062
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3063
        return fields;
3064
      }
3065
 
3066
      /**
3067
       * Find the _Fields constant that matches name, or null if its not found.
3068
       */
3069
      public static _Fields findByName(String name) {
3070
        return byName.get(name);
3071
      }
3072
 
3073
      private final short _thriftId;
3074
      private final String _fieldName;
3075
 
3076
      _Fields(short thriftId, String fieldName) {
3077
        _thriftId = thriftId;
3078
        _fieldName = fieldName;
3079
      }
3080
 
3081
      public short getThriftFieldId() {
3082
        return _thriftId;
3083
      }
3084
 
3085
      public String getFieldName() {
3086
        return _fieldName;
3087
      }
3088
    }
3089
 
3090
    // isset id assignments
3091
    private static final int __ID_ISSET_ID = 0;
3092
    private BitSet __isset_bit_vector = new BitSet(1);
3093
 
3094
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3095
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
3096
          new FieldValueMetaData(TType.I64)));
3097
      put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, 
3098
          new FieldValueMetaData(TType.STRING)));
3099
    }});
3100
 
3101
    static {
3102
      FieldMetaData.addStructMetaDataMap(updateMessage_args.class, metaDataMap);
3103
    }
3104
 
3105
    public updateMessage_args() {
3106
    }
3107
 
3108
    public updateMessage_args(
3109
      long id,
3110
      String message)
3111
    {
3112
      this();
3113
      this.id = id;
3114
      setIdIsSet(true);
3115
      this.message = message;
3116
    }
3117
 
3118
    /**
3119
     * Performs a deep copy on <i>other</i>.
3120
     */
3121
    public updateMessage_args(updateMessage_args other) {
3122
      __isset_bit_vector.clear();
3123
      __isset_bit_vector.or(other.__isset_bit_vector);
3124
      this.id = other.id;
3125
      if (other.isSetMessage()) {
3126
        this.message = other.message;
3127
      }
3128
    }
3129
 
3130
    public updateMessage_args deepCopy() {
3131
      return new updateMessage_args(this);
3132
    }
3133
 
3134
    @Deprecated
3135
    public updateMessage_args clone() {
3136
      return new updateMessage_args(this);
3137
    }
3138
 
3139
    public long getId() {
3140
      return this.id;
3141
    }
3142
 
3143
    public updateMessage_args setId(long id) {
3144
      this.id = id;
3145
      setIdIsSet(true);
3146
      return this;
3147
    }
3148
 
3149
    public void unsetId() {
3150
      __isset_bit_vector.clear(__ID_ISSET_ID);
3151
    }
3152
 
3153
    /** Returns true if field id is set (has been asigned a value) and false otherwise */
3154
    public boolean isSetId() {
3155
      return __isset_bit_vector.get(__ID_ISSET_ID);
3156
    }
3157
 
3158
    public void setIdIsSet(boolean value) {
3159
      __isset_bit_vector.set(__ID_ISSET_ID, value);
3160
    }
3161
 
3162
    public String getMessage() {
3163
      return this.message;
3164
    }
3165
 
3166
    public updateMessage_args setMessage(String message) {
3167
      this.message = message;
3168
      return this;
3169
    }
3170
 
3171
    public void unsetMessage() {
3172
      this.message = null;
3173
    }
3174
 
3175
    /** Returns true if field message is set (has been asigned a value) and false otherwise */
3176
    public boolean isSetMessage() {
3177
      return this.message != null;
3178
    }
3179
 
3180
    public void setMessageIsSet(boolean value) {
3181
      if (!value) {
3182
        this.message = null;
3183
      }
3184
    }
3185
 
3186
    public void setFieldValue(_Fields field, Object value) {
3187
      switch (field) {
3188
      case ID:
3189
        if (value == null) {
3190
          unsetId();
3191
        } else {
3192
          setId((Long)value);
3193
        }
3194
        break;
3195
 
3196
      case MESSAGE:
3197
        if (value == null) {
3198
          unsetMessage();
3199
        } else {
3200
          setMessage((String)value);
3201
        }
3202
        break;
3203
 
3204
      }
3205
    }
3206
 
3207
    public void setFieldValue(int fieldID, Object value) {
3208
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3209
    }
3210
 
3211
    public Object getFieldValue(_Fields field) {
3212
      switch (field) {
3213
      case ID:
3214
        return new Long(getId());
3215
 
3216
      case MESSAGE:
3217
        return getMessage();
3218
 
3219
      }
3220
      throw new IllegalStateException();
3221
    }
3222
 
3223
    public Object getFieldValue(int fieldId) {
3224
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3225
    }
3226
 
3227
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3228
    public boolean isSet(_Fields field) {
3229
      switch (field) {
3230
      case ID:
3231
        return isSetId();
3232
      case MESSAGE:
3233
        return isSetMessage();
3234
      }
3235
      throw new IllegalStateException();
3236
    }
3237
 
3238
    public boolean isSet(int fieldID) {
3239
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3240
    }
3241
 
3242
    @Override
3243
    public boolean equals(Object that) {
3244
      if (that == null)
3245
        return false;
3246
      if (that instanceof updateMessage_args)
3247
        return this.equals((updateMessage_args)that);
3248
      return false;
3249
    }
3250
 
3251
    public boolean equals(updateMessage_args that) {
3252
      if (that == null)
3253
        return false;
3254
 
3255
      boolean this_present_id = true;
3256
      boolean that_present_id = true;
3257
      if (this_present_id || that_present_id) {
3258
        if (!(this_present_id && that_present_id))
3259
          return false;
3260
        if (this.id != that.id)
3261
          return false;
3262
      }
3263
 
3264
      boolean this_present_message = true && this.isSetMessage();
3265
      boolean that_present_message = true && that.isSetMessage();
3266
      if (this_present_message || that_present_message) {
3267
        if (!(this_present_message && that_present_message))
3268
          return false;
3269
        if (!this.message.equals(that.message))
3270
          return false;
3271
      }
3272
 
3273
      return true;
3274
    }
3275
 
3276
    @Override
3277
    public int hashCode() {
3278
      return 0;
3279
    }
3280
 
3281
    public int compareTo(updateMessage_args other) {
3282
      if (!getClass().equals(other.getClass())) {
3283
        return getClass().getName().compareTo(other.getClass().getName());
3284
      }
3285
 
3286
      int lastComparison = 0;
3287
      updateMessage_args typedOther = (updateMessage_args)other;
3288
 
3289
      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
3290
      if (lastComparison != 0) {
3291
        return lastComparison;
3292
      }
3293
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
3294
      if (lastComparison != 0) {
3295
        return lastComparison;
3296
      }
3297
      lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
3298
      if (lastComparison != 0) {
3299
        return lastComparison;
3300
      }
3301
      lastComparison = TBaseHelper.compareTo(message, typedOther.message);
3302
      if (lastComparison != 0) {
3303
        return lastComparison;
3304
      }
3305
      return 0;
3306
    }
3307
 
3308
    public void read(TProtocol iprot) throws TException {
3309
      TField field;
3310
      iprot.readStructBegin();
3311
      while (true)
3312
      {
3313
        field = iprot.readFieldBegin();
3314
        if (field.type == TType.STOP) { 
3315
          break;
3316
        }
3317
        _Fields fieldId = _Fields.findByThriftId(field.id);
3318
        if (fieldId == null) {
3319
          TProtocolUtil.skip(iprot, field.type);
3320
        } else {
3321
          switch (fieldId) {
3322
            case ID:
3323
              if (field.type == TType.I64) {
3324
                this.id = iprot.readI64();
3325
                setIdIsSet(true);
3326
              } else { 
3327
                TProtocolUtil.skip(iprot, field.type);
3328
              }
3329
              break;
3330
            case MESSAGE:
3331
              if (field.type == TType.STRING) {
3332
                this.message = iprot.readString();
3333
              } else { 
3334
                TProtocolUtil.skip(iprot, field.type);
3335
              }
3336
              break;
3337
          }
3338
          iprot.readFieldEnd();
3339
        }
3340
      }
3341
      iprot.readStructEnd();
3342
      validate();
3343
    }
3344
 
3345
    public void write(TProtocol oprot) throws TException {
3346
      validate();
3347
 
3348
      oprot.writeStructBegin(STRUCT_DESC);
3349
      oprot.writeFieldBegin(ID_FIELD_DESC);
3350
      oprot.writeI64(this.id);
3351
      oprot.writeFieldEnd();
3352
      if (this.message != null) {
3353
        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
3354
        oprot.writeString(this.message);
3355
        oprot.writeFieldEnd();
3356
      }
3357
      oprot.writeFieldStop();
3358
      oprot.writeStructEnd();
3359
    }
3360
 
3361
    @Override
3362
    public String toString() {
3363
      StringBuilder sb = new StringBuilder("updateMessage_args(");
3364
      boolean first = true;
3365
 
3366
      sb.append("id:");
3367
      sb.append(this.id);
3368
      first = false;
3369
      if (!first) sb.append(", ");
3370
      sb.append("message:");
3371
      if (this.message == null) {
3372
        sb.append("null");
3373
      } else {
3374
        sb.append(this.message);
3375
      }
3376
      first = false;
3377
      sb.append(")");
3378
      return sb.toString();
3379
    }
3380
 
3381
    public void validate() throws TException {
3382
      // check for required fields
3383
    }
3384
 
3385
  }
3386
 
3387
  public static class updateMessage_result implements TBase<updateMessage_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateMessage_result>   {
3388
    private static final TStruct STRUCT_DESC = new TStruct("updateMessage_result");
3389
 
3390
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
3391
 
3392
    private HelperServiceException se;
3393
 
3394
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3395
    public enum _Fields implements TFieldIdEnum {
3396
      SE((short)1, "se");
3397
 
3398
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3399
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3400
 
3401
      static {
3402
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3403
          byId.put((int)field._thriftId, field);
3404
          byName.put(field.getFieldName(), field);
3405
        }
3406
      }
3407
 
3408
      /**
3409
       * Find the _Fields constant that matches fieldId, or null if its not found.
3410
       */
3411
      public static _Fields findByThriftId(int fieldId) {
3412
        return byId.get(fieldId);
3413
      }
3414
 
3415
      /**
3416
       * Find the _Fields constant that matches fieldId, throwing an exception
3417
       * if it is not found.
3418
       */
3419
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3420
        _Fields fields = findByThriftId(fieldId);
3421
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3422
        return fields;
3423
      }
3424
 
3425
      /**
3426
       * Find the _Fields constant that matches name, or null if its not found.
3427
       */
3428
      public static _Fields findByName(String name) {
3429
        return byName.get(name);
3430
      }
3431
 
3432
      private final short _thriftId;
3433
      private final String _fieldName;
3434
 
3435
      _Fields(short thriftId, String fieldName) {
3436
        _thriftId = thriftId;
3437
        _fieldName = fieldName;
3438
      }
3439
 
3440
      public short getThriftFieldId() {
3441
        return _thriftId;
3442
      }
3443
 
3444
      public String getFieldName() {
3445
        return _fieldName;
3446
      }
3447
    }
3448
 
3449
    // isset id assignments
3450
 
3451
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3452
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
3453
          new FieldValueMetaData(TType.STRUCT)));
3454
    }});
3455
 
3456
    static {
3457
      FieldMetaData.addStructMetaDataMap(updateMessage_result.class, metaDataMap);
3458
    }
3459
 
3460
    public updateMessage_result() {
3461
    }
3462
 
3463
    public updateMessage_result(
3464
      HelperServiceException se)
3465
    {
3466
      this();
3467
      this.se = se;
3468
    }
3469
 
3470
    /**
3471
     * Performs a deep copy on <i>other</i>.
3472
     */
3473
    public updateMessage_result(updateMessage_result other) {
3474
      if (other.isSetSe()) {
3475
        this.se = new HelperServiceException(other.se);
3476
      }
3477
    }
3478
 
3479
    public updateMessage_result deepCopy() {
3480
      return new updateMessage_result(this);
3481
    }
3482
 
3483
    @Deprecated
3484
    public updateMessage_result clone() {
3485
      return new updateMessage_result(this);
3486
    }
3487
 
3488
    public HelperServiceException getSe() {
3489
      return this.se;
3490
    }
3491
 
3492
    public updateMessage_result setSe(HelperServiceException se) {
3493
      this.se = se;
3494
      return this;
3495
    }
3496
 
3497
    public void unsetSe() {
3498
      this.se = null;
3499
    }
3500
 
3501
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
3502
    public boolean isSetSe() {
3503
      return this.se != null;
3504
    }
3505
 
3506
    public void setSeIsSet(boolean value) {
3507
      if (!value) {
3508
        this.se = null;
3509
      }
3510
    }
3511
 
3512
    public void setFieldValue(_Fields field, Object value) {
3513
      switch (field) {
3514
      case SE:
3515
        if (value == null) {
3516
          unsetSe();
3517
        } else {
3518
          setSe((HelperServiceException)value);
3519
        }
3520
        break;
3521
 
3522
      }
3523
    }
3524
 
3525
    public void setFieldValue(int fieldID, Object value) {
3526
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3527
    }
3528
 
3529
    public Object getFieldValue(_Fields field) {
3530
      switch (field) {
3531
      case SE:
3532
        return getSe();
3533
 
3534
      }
3535
      throw new IllegalStateException();
3536
    }
3537
 
3538
    public Object getFieldValue(int fieldId) {
3539
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3540
    }
3541
 
3542
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3543
    public boolean isSet(_Fields field) {
3544
      switch (field) {
3545
      case SE:
3546
        return isSetSe();
3547
      }
3548
      throw new IllegalStateException();
3549
    }
3550
 
3551
    public boolean isSet(int fieldID) {
3552
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3553
    }
3554
 
3555
    @Override
3556
    public boolean equals(Object that) {
3557
      if (that == null)
3558
        return false;
3559
      if (that instanceof updateMessage_result)
3560
        return this.equals((updateMessage_result)that);
3561
      return false;
3562
    }
3563
 
3564
    public boolean equals(updateMessage_result that) {
3565
      if (that == null)
3566
        return false;
3567
 
3568
      boolean this_present_se = true && this.isSetSe();
3569
      boolean that_present_se = true && that.isSetSe();
3570
      if (this_present_se || that_present_se) {
3571
        if (!(this_present_se && that_present_se))
3572
          return false;
3573
        if (!this.se.equals(that.se))
3574
          return false;
3575
      }
3576
 
3577
      return true;
3578
    }
3579
 
3580
    @Override
3581
    public int hashCode() {
3582
      return 0;
3583
    }
3584
 
3585
    public int compareTo(updateMessage_result other) {
3586
      if (!getClass().equals(other.getClass())) {
3587
        return getClass().getName().compareTo(other.getClass().getName());
3588
      }
3589
 
3590
      int lastComparison = 0;
3591
      updateMessage_result typedOther = (updateMessage_result)other;
3592
 
3593
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
3594
      if (lastComparison != 0) {
3595
        return lastComparison;
3596
      }
3597
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
3598
      if (lastComparison != 0) {
3599
        return lastComparison;
3600
      }
3601
      return 0;
3602
    }
3603
 
3604
    public void read(TProtocol iprot) throws TException {
3605
      TField field;
3606
      iprot.readStructBegin();
3607
      while (true)
3608
      {
3609
        field = iprot.readFieldBegin();
3610
        if (field.type == TType.STOP) { 
3611
          break;
3612
        }
3613
        _Fields fieldId = _Fields.findByThriftId(field.id);
3614
        if (fieldId == null) {
3615
          TProtocolUtil.skip(iprot, field.type);
3616
        } else {
3617
          switch (fieldId) {
3618
            case SE:
3619
              if (field.type == TType.STRUCT) {
3620
                this.se = new HelperServiceException();
3621
                this.se.read(iprot);
3622
              } else { 
3623
                TProtocolUtil.skip(iprot, field.type);
3624
              }
3625
              break;
3626
          }
3627
          iprot.readFieldEnd();
3628
        }
3629
      }
3630
      iprot.readStructEnd();
3631
      validate();
3632
    }
3633
 
3634
    public void write(TProtocol oprot) throws TException {
3635
      oprot.writeStructBegin(STRUCT_DESC);
3636
 
3637
      if (this.isSetSe()) {
3638
        oprot.writeFieldBegin(SE_FIELD_DESC);
3639
        this.se.write(oprot);
3640
        oprot.writeFieldEnd();
3641
      }
3642
      oprot.writeFieldStop();
3643
      oprot.writeStructEnd();
3644
    }
3645
 
3646
    @Override
3647
    public String toString() {
3648
      StringBuilder sb = new StringBuilder("updateMessage_result(");
3649
      boolean first = true;
3650
 
3651
      sb.append("se:");
3652
      if (this.se == null) {
3653
        sb.append("null");
3654
      } else {
3655
        sb.append(this.se);
3656
      }
3657
      first = false;
3658
      sb.append(")");
3659
      return sb.toString();
3660
    }
3661
 
3662
    public void validate() throws TException {
3663
      // check for required fields
3664
    }
3665
 
3666
  }
3667
 
3668
  public static class getMessage_args implements TBase<getMessage_args._Fields>, java.io.Serializable, Cloneable, Comparable<getMessage_args>   {
3669
    private static final TStruct STRUCT_DESC = new TStruct("getMessage_args");
3670
 
3671
    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
3672
 
3673
    private long id;
3674
 
3675
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3676
    public enum _Fields implements TFieldIdEnum {
3677
      ID((short)1, "id");
3678
 
3679
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3680
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3681
 
3682
      static {
3683
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3684
          byId.put((int)field._thriftId, field);
3685
          byName.put(field.getFieldName(), field);
3686
        }
3687
      }
3688
 
3689
      /**
3690
       * Find the _Fields constant that matches fieldId, or null if its not found.
3691
       */
3692
      public static _Fields findByThriftId(int fieldId) {
3693
        return byId.get(fieldId);
3694
      }
3695
 
3696
      /**
3697
       * Find the _Fields constant that matches fieldId, throwing an exception
3698
       * if it is not found.
3699
       */
3700
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3701
        _Fields fields = findByThriftId(fieldId);
3702
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3703
        return fields;
3704
      }
3705
 
3706
      /**
3707
       * Find the _Fields constant that matches name, or null if its not found.
3708
       */
3709
      public static _Fields findByName(String name) {
3710
        return byName.get(name);
3711
      }
3712
 
3713
      private final short _thriftId;
3714
      private final String _fieldName;
3715
 
3716
      _Fields(short thriftId, String fieldName) {
3717
        _thriftId = thriftId;
3718
        _fieldName = fieldName;
3719
      }
3720
 
3721
      public short getThriftFieldId() {
3722
        return _thriftId;
3723
      }
3724
 
3725
      public String getFieldName() {
3726
        return _fieldName;
3727
      }
3728
    }
3729
 
3730
    // isset id assignments
3731
    private static final int __ID_ISSET_ID = 0;
3732
    private BitSet __isset_bit_vector = new BitSet(1);
3733
 
3734
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3735
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
3736
          new FieldValueMetaData(TType.I64)));
3737
    }});
3738
 
3739
    static {
3740
      FieldMetaData.addStructMetaDataMap(getMessage_args.class, metaDataMap);
3741
    }
3742
 
3743
    public getMessage_args() {
3744
    }
3745
 
3746
    public getMessage_args(
3747
      long id)
3748
    {
3749
      this();
3750
      this.id = id;
3751
      setIdIsSet(true);
3752
    }
3753
 
3754
    /**
3755
     * Performs a deep copy on <i>other</i>.
3756
     */
3757
    public getMessage_args(getMessage_args other) {
3758
      __isset_bit_vector.clear();
3759
      __isset_bit_vector.or(other.__isset_bit_vector);
3760
      this.id = other.id;
3761
    }
3762
 
3763
    public getMessage_args deepCopy() {
3764
      return new getMessage_args(this);
3765
    }
3766
 
3767
    @Deprecated
3768
    public getMessage_args clone() {
3769
      return new getMessage_args(this);
3770
    }
3771
 
3772
    public long getId() {
3773
      return this.id;
3774
    }
3775
 
3776
    public getMessage_args setId(long id) {
3777
      this.id = id;
3778
      setIdIsSet(true);
3779
      return this;
3780
    }
3781
 
3782
    public void unsetId() {
3783
      __isset_bit_vector.clear(__ID_ISSET_ID);
3784
    }
3785
 
3786
    /** Returns true if field id is set (has been asigned a value) and false otherwise */
3787
    public boolean isSetId() {
3788
      return __isset_bit_vector.get(__ID_ISSET_ID);
3789
    }
3790
 
3791
    public void setIdIsSet(boolean value) {
3792
      __isset_bit_vector.set(__ID_ISSET_ID, value);
3793
    }
3794
 
3795
    public void setFieldValue(_Fields field, Object value) {
3796
      switch (field) {
3797
      case ID:
3798
        if (value == null) {
3799
          unsetId();
3800
        } else {
3801
          setId((Long)value);
3802
        }
3803
        break;
3804
 
3805
      }
3806
    }
3807
 
3808
    public void setFieldValue(int fieldID, Object value) {
3809
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3810
    }
3811
 
3812
    public Object getFieldValue(_Fields field) {
3813
      switch (field) {
3814
      case ID:
3815
        return new Long(getId());
3816
 
3817
      }
3818
      throw new IllegalStateException();
3819
    }
3820
 
3821
    public Object getFieldValue(int fieldId) {
3822
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3823
    }
3824
 
3825
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3826
    public boolean isSet(_Fields field) {
3827
      switch (field) {
3828
      case ID:
3829
        return isSetId();
3830
      }
3831
      throw new IllegalStateException();
3832
    }
3833
 
3834
    public boolean isSet(int fieldID) {
3835
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3836
    }
3837
 
3838
    @Override
3839
    public boolean equals(Object that) {
3840
      if (that == null)
3841
        return false;
3842
      if (that instanceof getMessage_args)
3843
        return this.equals((getMessage_args)that);
3844
      return false;
3845
    }
3846
 
3847
    public boolean equals(getMessage_args that) {
3848
      if (that == null)
3849
        return false;
3850
 
3851
      boolean this_present_id = true;
3852
      boolean that_present_id = true;
3853
      if (this_present_id || that_present_id) {
3854
        if (!(this_present_id && that_present_id))
3855
          return false;
3856
        if (this.id != that.id)
3857
          return false;
3858
      }
3859
 
3860
      return true;
3861
    }
3862
 
3863
    @Override
3864
    public int hashCode() {
3865
      return 0;
3866
    }
3867
 
3868
    public int compareTo(getMessage_args other) {
3869
      if (!getClass().equals(other.getClass())) {
3870
        return getClass().getName().compareTo(other.getClass().getName());
3871
      }
3872
 
3873
      int lastComparison = 0;
3874
      getMessage_args typedOther = (getMessage_args)other;
3875
 
3876
      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
3877
      if (lastComparison != 0) {
3878
        return lastComparison;
3879
      }
3880
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
3881
      if (lastComparison != 0) {
3882
        return lastComparison;
3883
      }
3884
      return 0;
3885
    }
3886
 
3887
    public void read(TProtocol iprot) throws TException {
3888
      TField field;
3889
      iprot.readStructBegin();
3890
      while (true)
3891
      {
3892
        field = iprot.readFieldBegin();
3893
        if (field.type == TType.STOP) { 
3894
          break;
3895
        }
3896
        _Fields fieldId = _Fields.findByThriftId(field.id);
3897
        if (fieldId == null) {
3898
          TProtocolUtil.skip(iprot, field.type);
3899
        } else {
3900
          switch (fieldId) {
3901
            case ID:
3902
              if (field.type == TType.I64) {
3903
                this.id = iprot.readI64();
3904
                setIdIsSet(true);
3905
              } else { 
3906
                TProtocolUtil.skip(iprot, field.type);
3907
              }
3908
              break;
3909
          }
3910
          iprot.readFieldEnd();
3911
        }
3912
      }
3913
      iprot.readStructEnd();
3914
      validate();
3915
    }
3916
 
3917
    public void write(TProtocol oprot) throws TException {
3918
      validate();
3919
 
3920
      oprot.writeStructBegin(STRUCT_DESC);
3921
      oprot.writeFieldBegin(ID_FIELD_DESC);
3922
      oprot.writeI64(this.id);
3923
      oprot.writeFieldEnd();
3924
      oprot.writeFieldStop();
3925
      oprot.writeStructEnd();
3926
    }
3927
 
3928
    @Override
3929
    public String toString() {
3930
      StringBuilder sb = new StringBuilder("getMessage_args(");
3931
      boolean first = true;
3932
 
3933
      sb.append("id:");
3934
      sb.append(this.id);
3935
      first = false;
3936
      sb.append(")");
3937
      return sb.toString();
3938
    }
3939
 
3940
    public void validate() throws TException {
3941
      // check for required fields
3942
    }
3943
 
3944
  }
3945
 
3946
  public static class getMessage_result implements TBase<getMessage_result._Fields>, java.io.Serializable, Cloneable, Comparable<getMessage_result>   {
3947
    private static final TStruct STRUCT_DESC = new TStruct("getMessage_result");
3948
 
3949
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
3950
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
3951
 
3952
    private Message success;
3953
    private HelperServiceException se;
3954
 
3955
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3956
    public enum _Fields implements TFieldIdEnum {
3957
      SUCCESS((short)0, "success"),
3958
      SE((short)1, "se");
3959
 
3960
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3961
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3962
 
3963
      static {
3964
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3965
          byId.put((int)field._thriftId, field);
3966
          byName.put(field.getFieldName(), field);
3967
        }
3968
      }
3969
 
3970
      /**
3971
       * Find the _Fields constant that matches fieldId, or null if its not found.
3972
       */
3973
      public static _Fields findByThriftId(int fieldId) {
3974
        return byId.get(fieldId);
3975
      }
3976
 
3977
      /**
3978
       * Find the _Fields constant that matches fieldId, throwing an exception
3979
       * if it is not found.
3980
       */
3981
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3982
        _Fields fields = findByThriftId(fieldId);
3983
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3984
        return fields;
3985
      }
3986
 
3987
      /**
3988
       * Find the _Fields constant that matches name, or null if its not found.
3989
       */
3990
      public static _Fields findByName(String name) {
3991
        return byName.get(name);
3992
      }
3993
 
3994
      private final short _thriftId;
3995
      private final String _fieldName;
3996
 
3997
      _Fields(short thriftId, String fieldName) {
3998
        _thriftId = thriftId;
3999
        _fieldName = fieldName;
4000
      }
4001
 
4002
      public short getThriftFieldId() {
4003
        return _thriftId;
4004
      }
4005
 
4006
      public String getFieldName() {
4007
        return _fieldName;
4008
      }
4009
    }
4010
 
4011
    // isset id assignments
4012
 
4013
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4014
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
4015
          new StructMetaData(TType.STRUCT, Message.class)));
4016
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
4017
          new FieldValueMetaData(TType.STRUCT)));
4018
    }});
4019
 
4020
    static {
4021
      FieldMetaData.addStructMetaDataMap(getMessage_result.class, metaDataMap);
4022
    }
4023
 
4024
    public getMessage_result() {
4025
    }
4026
 
4027
    public getMessage_result(
4028
      Message success,
4029
      HelperServiceException se)
4030
    {
4031
      this();
4032
      this.success = success;
4033
      this.se = se;
4034
    }
4035
 
4036
    /**
4037
     * Performs a deep copy on <i>other</i>.
4038
     */
4039
    public getMessage_result(getMessage_result other) {
4040
      if (other.isSetSuccess()) {
4041
        this.success = new Message(other.success);
4042
      }
4043
      if (other.isSetSe()) {
4044
        this.se = new HelperServiceException(other.se);
4045
      }
4046
    }
4047
 
4048
    public getMessage_result deepCopy() {
4049
      return new getMessage_result(this);
4050
    }
4051
 
4052
    @Deprecated
4053
    public getMessage_result clone() {
4054
      return new getMessage_result(this);
4055
    }
4056
 
4057
    public Message getSuccess() {
4058
      return this.success;
4059
    }
4060
 
4061
    public getMessage_result setSuccess(Message success) {
4062
      this.success = success;
4063
      return this;
4064
    }
4065
 
4066
    public void unsetSuccess() {
4067
      this.success = null;
4068
    }
4069
 
4070
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
4071
    public boolean isSetSuccess() {
4072
      return this.success != null;
4073
    }
4074
 
4075
    public void setSuccessIsSet(boolean value) {
4076
      if (!value) {
4077
        this.success = null;
4078
      }
4079
    }
4080
 
4081
    public HelperServiceException getSe() {
4082
      return this.se;
4083
    }
4084
 
4085
    public getMessage_result setSe(HelperServiceException se) {
4086
      this.se = se;
4087
      return this;
4088
    }
4089
 
4090
    public void unsetSe() {
4091
      this.se = null;
4092
    }
4093
 
4094
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
4095
    public boolean isSetSe() {
4096
      return this.se != null;
4097
    }
4098
 
4099
    public void setSeIsSet(boolean value) {
4100
      if (!value) {
4101
        this.se = null;
4102
      }
4103
    }
4104
 
4105
    public void setFieldValue(_Fields field, Object value) {
4106
      switch (field) {
4107
      case SUCCESS:
4108
        if (value == null) {
4109
          unsetSuccess();
4110
        } else {
4111
          setSuccess((Message)value);
4112
        }
4113
        break;
4114
 
4115
      case SE:
4116
        if (value == null) {
4117
          unsetSe();
4118
        } else {
4119
          setSe((HelperServiceException)value);
4120
        }
4121
        break;
4122
 
4123
      }
4124
    }
4125
 
4126
    public void setFieldValue(int fieldID, Object value) {
4127
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4128
    }
4129
 
4130
    public Object getFieldValue(_Fields field) {
4131
      switch (field) {
4132
      case SUCCESS:
4133
        return getSuccess();
4134
 
4135
      case SE:
4136
        return getSe();
4137
 
4138
      }
4139
      throw new IllegalStateException();
4140
    }
4141
 
4142
    public Object getFieldValue(int fieldId) {
4143
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4144
    }
4145
 
4146
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4147
    public boolean isSet(_Fields field) {
4148
      switch (field) {
4149
      case SUCCESS:
4150
        return isSetSuccess();
4151
      case SE:
4152
        return isSetSe();
4153
      }
4154
      throw new IllegalStateException();
4155
    }
4156
 
4157
    public boolean isSet(int fieldID) {
4158
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4159
    }
4160
 
4161
    @Override
4162
    public boolean equals(Object that) {
4163
      if (that == null)
4164
        return false;
4165
      if (that instanceof getMessage_result)
4166
        return this.equals((getMessage_result)that);
4167
      return false;
4168
    }
4169
 
4170
    public boolean equals(getMessage_result that) {
4171
      if (that == null)
4172
        return false;
4173
 
4174
      boolean this_present_success = true && this.isSetSuccess();
4175
      boolean that_present_success = true && that.isSetSuccess();
4176
      if (this_present_success || that_present_success) {
4177
        if (!(this_present_success && that_present_success))
4178
          return false;
4179
        if (!this.success.equals(that.success))
4180
          return false;
4181
      }
4182
 
4183
      boolean this_present_se = true && this.isSetSe();
4184
      boolean that_present_se = true && that.isSetSe();
4185
      if (this_present_se || that_present_se) {
4186
        if (!(this_present_se && that_present_se))
4187
          return false;
4188
        if (!this.se.equals(that.se))
4189
          return false;
4190
      }
4191
 
4192
      return true;
4193
    }
4194
 
4195
    @Override
4196
    public int hashCode() {
4197
      return 0;
4198
    }
4199
 
4200
    public int compareTo(getMessage_result other) {
4201
      if (!getClass().equals(other.getClass())) {
4202
        return getClass().getName().compareTo(other.getClass().getName());
4203
      }
4204
 
4205
      int lastComparison = 0;
4206
      getMessage_result typedOther = (getMessage_result)other;
4207
 
4208
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
4209
      if (lastComparison != 0) {
4210
        return lastComparison;
4211
      }
4212
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
4213
      if (lastComparison != 0) {
4214
        return lastComparison;
4215
      }
4216
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
4217
      if (lastComparison != 0) {
4218
        return lastComparison;
4219
      }
4220
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
4221
      if (lastComparison != 0) {
4222
        return lastComparison;
4223
      }
4224
      return 0;
4225
    }
4226
 
4227
    public void read(TProtocol iprot) throws TException {
4228
      TField field;
4229
      iprot.readStructBegin();
4230
      while (true)
4231
      {
4232
        field = iprot.readFieldBegin();
4233
        if (field.type == TType.STOP) { 
4234
          break;
4235
        }
4236
        _Fields fieldId = _Fields.findByThriftId(field.id);
4237
        if (fieldId == null) {
4238
          TProtocolUtil.skip(iprot, field.type);
4239
        } else {
4240
          switch (fieldId) {
4241
            case SUCCESS:
4242
              if (field.type == TType.STRUCT) {
4243
                this.success = new Message();
4244
                this.success.read(iprot);
4245
              } else { 
4246
                TProtocolUtil.skip(iprot, field.type);
4247
              }
4248
              break;
4249
            case SE:
4250
              if (field.type == TType.STRUCT) {
4251
                this.se = new HelperServiceException();
4252
                this.se.read(iprot);
4253
              } else { 
4254
                TProtocolUtil.skip(iprot, field.type);
4255
              }
4256
              break;
4257
          }
4258
          iprot.readFieldEnd();
4259
        }
4260
      }
4261
      iprot.readStructEnd();
4262
      validate();
4263
    }
4264
 
4265
    public void write(TProtocol oprot) throws TException {
4266
      oprot.writeStructBegin(STRUCT_DESC);
4267
 
4268
      if (this.isSetSuccess()) {
4269
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4270
        this.success.write(oprot);
4271
        oprot.writeFieldEnd();
4272
      } else if (this.isSetSe()) {
4273
        oprot.writeFieldBegin(SE_FIELD_DESC);
4274
        this.se.write(oprot);
4275
        oprot.writeFieldEnd();
4276
      }
4277
      oprot.writeFieldStop();
4278
      oprot.writeStructEnd();
4279
    }
4280
 
4281
    @Override
4282
    public String toString() {
4283
      StringBuilder sb = new StringBuilder("getMessage_result(");
4284
      boolean first = true;
4285
 
4286
      sb.append("success:");
4287
      if (this.success == null) {
4288
        sb.append("null");
4289
      } else {
4290
        sb.append(this.success);
4291
      }
4292
      first = false;
4293
      if (!first) sb.append(", ");
4294
      sb.append("se:");
4295
      if (this.se == null) {
4296
        sb.append("null");
4297
      } else {
4298
        sb.append(this.se);
4299
      }
4300
      first = false;
4301
      sb.append(")");
4302
      return sb.toString();
4303
    }
4304
 
4305
    public void validate() throws TException {
4306
      // check for required fields
4307
    }
4308
 
4309
  }
4310
 
4311
  public static class getSubstitutedMessage_args implements TBase<getSubstitutedMessage_args._Fields>, java.io.Serializable, Cloneable   {
4312
    private static final TStruct STRUCT_DESC = new TStruct("getSubstitutedMessage_args");
4313
 
4314
    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
4315
    private static final TField PARAMS_FIELD_DESC = new TField("params", TType.MAP, (short)2);
4316
 
4317
    private long id;
4318
    private Map<String,String> params;
4319
 
4320
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4321
    public enum _Fields implements TFieldIdEnum {
4322
      ID((short)1, "id"),
4323
      PARAMS((short)2, "params");
4324
 
4325
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4326
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4327
 
4328
      static {
4329
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4330
          byId.put((int)field._thriftId, field);
4331
          byName.put(field.getFieldName(), field);
4332
        }
4333
      }
4334
 
4335
      /**
4336
       * Find the _Fields constant that matches fieldId, or null if its not found.
4337
       */
4338
      public static _Fields findByThriftId(int fieldId) {
4339
        return byId.get(fieldId);
4340
      }
4341
 
4342
      /**
4343
       * Find the _Fields constant that matches fieldId, throwing an exception
4344
       * if it is not found.
4345
       */
4346
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4347
        _Fields fields = findByThriftId(fieldId);
4348
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4349
        return fields;
4350
      }
4351
 
4352
      /**
4353
       * Find the _Fields constant that matches name, or null if its not found.
4354
       */
4355
      public static _Fields findByName(String name) {
4356
        return byName.get(name);
4357
      }
4358
 
4359
      private final short _thriftId;
4360
      private final String _fieldName;
4361
 
4362
      _Fields(short thriftId, String fieldName) {
4363
        _thriftId = thriftId;
4364
        _fieldName = fieldName;
4365
      }
4366
 
4367
      public short getThriftFieldId() {
4368
        return _thriftId;
4369
      }
4370
 
4371
      public String getFieldName() {
4372
        return _fieldName;
4373
      }
4374
    }
4375
 
4376
    // isset id assignments
4377
    private static final int __ID_ISSET_ID = 0;
4378
    private BitSet __isset_bit_vector = new BitSet(1);
4379
 
4380
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4381
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
4382
          new FieldValueMetaData(TType.I64)));
4383
      put(_Fields.PARAMS, new FieldMetaData("params", TFieldRequirementType.DEFAULT, 
4384
          new MapMetaData(TType.MAP, 
4385
              new FieldValueMetaData(TType.STRING), 
4386
              new FieldValueMetaData(TType.STRING))));
4387
    }});
4388
 
4389
    static {
4390
      FieldMetaData.addStructMetaDataMap(getSubstitutedMessage_args.class, metaDataMap);
4391
    }
4392
 
4393
    public getSubstitutedMessage_args() {
4394
    }
4395
 
4396
    public getSubstitutedMessage_args(
4397
      long id,
4398
      Map<String,String> params)
4399
    {
4400
      this();
4401
      this.id = id;
4402
      setIdIsSet(true);
4403
      this.params = params;
4404
    }
4405
 
4406
    /**
4407
     * Performs a deep copy on <i>other</i>.
4408
     */
4409
    public getSubstitutedMessage_args(getSubstitutedMessage_args other) {
4410
      __isset_bit_vector.clear();
4411
      __isset_bit_vector.or(other.__isset_bit_vector);
4412
      this.id = other.id;
4413
      if (other.isSetParams()) {
4414
        Map<String,String> __this__params = new HashMap<String,String>();
4415
        for (Map.Entry<String, String> other_element : other.params.entrySet()) {
4416
 
4417
          String other_element_key = other_element.getKey();
4418
          String other_element_value = other_element.getValue();
4419
 
4420
          String __this__params_copy_key = other_element_key;
4421
 
4422
          String __this__params_copy_value = other_element_value;
4423
 
4424
          __this__params.put(__this__params_copy_key, __this__params_copy_value);
4425
        }
4426
        this.params = __this__params;
4427
      }
4428
    }
4429
 
4430
    public getSubstitutedMessage_args deepCopy() {
4431
      return new getSubstitutedMessage_args(this);
4432
    }
4433
 
4434
    @Deprecated
4435
    public getSubstitutedMessage_args clone() {
4436
      return new getSubstitutedMessage_args(this);
4437
    }
4438
 
4439
    public long getId() {
4440
      return this.id;
4441
    }
4442
 
4443
    public getSubstitutedMessage_args setId(long id) {
4444
      this.id = id;
4445
      setIdIsSet(true);
4446
      return this;
4447
    }
4448
 
4449
    public void unsetId() {
4450
      __isset_bit_vector.clear(__ID_ISSET_ID);
4451
    }
4452
 
4453
    /** Returns true if field id is set (has been asigned a value) and false otherwise */
4454
    public boolean isSetId() {
4455
      return __isset_bit_vector.get(__ID_ISSET_ID);
4456
    }
4457
 
4458
    public void setIdIsSet(boolean value) {
4459
      __isset_bit_vector.set(__ID_ISSET_ID, value);
4460
    }
4461
 
4462
    public int getParamsSize() {
4463
      return (this.params == null) ? 0 : this.params.size();
4464
    }
4465
 
4466
    public void putToParams(String key, String val) {
4467
      if (this.params == null) {
4468
        this.params = new HashMap<String,String>();
4469
      }
4470
      this.params.put(key, val);
4471
    }
4472
 
4473
    public Map<String,String> getParams() {
4474
      return this.params;
4475
    }
4476
 
4477
    public getSubstitutedMessage_args setParams(Map<String,String> params) {
4478
      this.params = params;
4479
      return this;
4480
    }
4481
 
4482
    public void unsetParams() {
4483
      this.params = null;
4484
    }
4485
 
4486
    /** Returns true if field params is set (has been asigned a value) and false otherwise */
4487
    public boolean isSetParams() {
4488
      return this.params != null;
4489
    }
4490
 
4491
    public void setParamsIsSet(boolean value) {
4492
      if (!value) {
4493
        this.params = null;
4494
      }
4495
    }
4496
 
4497
    public void setFieldValue(_Fields field, Object value) {
4498
      switch (field) {
4499
      case ID:
4500
        if (value == null) {
4501
          unsetId();
4502
        } else {
4503
          setId((Long)value);
4504
        }
4505
        break;
4506
 
4507
      case PARAMS:
4508
        if (value == null) {
4509
          unsetParams();
4510
        } else {
4511
          setParams((Map<String,String>)value);
4512
        }
4513
        break;
4514
 
4515
      }
4516
    }
4517
 
4518
    public void setFieldValue(int fieldID, Object value) {
4519
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4520
    }
4521
 
4522
    public Object getFieldValue(_Fields field) {
4523
      switch (field) {
4524
      case ID:
4525
        return new Long(getId());
4526
 
4527
      case PARAMS:
4528
        return getParams();
4529
 
4530
      }
4531
      throw new IllegalStateException();
4532
    }
4533
 
4534
    public Object getFieldValue(int fieldId) {
4535
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4536
    }
4537
 
4538
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4539
    public boolean isSet(_Fields field) {
4540
      switch (field) {
4541
      case ID:
4542
        return isSetId();
4543
      case PARAMS:
4544
        return isSetParams();
4545
      }
4546
      throw new IllegalStateException();
4547
    }
4548
 
4549
    public boolean isSet(int fieldID) {
4550
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4551
    }
4552
 
4553
    @Override
4554
    public boolean equals(Object that) {
4555
      if (that == null)
4556
        return false;
4557
      if (that instanceof getSubstitutedMessage_args)
4558
        return this.equals((getSubstitutedMessage_args)that);
4559
      return false;
4560
    }
4561
 
4562
    public boolean equals(getSubstitutedMessage_args that) {
4563
      if (that == null)
4564
        return false;
4565
 
4566
      boolean this_present_id = true;
4567
      boolean that_present_id = true;
4568
      if (this_present_id || that_present_id) {
4569
        if (!(this_present_id && that_present_id))
4570
          return false;
4571
        if (this.id != that.id)
4572
          return false;
4573
      }
4574
 
4575
      boolean this_present_params = true && this.isSetParams();
4576
      boolean that_present_params = true && that.isSetParams();
4577
      if (this_present_params || that_present_params) {
4578
        if (!(this_present_params && that_present_params))
4579
          return false;
4580
        if (!this.params.equals(that.params))
4581
          return false;
4582
      }
4583
 
4584
      return true;
4585
    }
4586
 
4587
    @Override
4588
    public int hashCode() {
4589
      return 0;
4590
    }
4591
 
4592
    public void read(TProtocol iprot) throws TException {
4593
      TField field;
4594
      iprot.readStructBegin();
4595
      while (true)
4596
      {
4597
        field = iprot.readFieldBegin();
4598
        if (field.type == TType.STOP) { 
4599
          break;
4600
        }
4601
        _Fields fieldId = _Fields.findByThriftId(field.id);
4602
        if (fieldId == null) {
4603
          TProtocolUtil.skip(iprot, field.type);
4604
        } else {
4605
          switch (fieldId) {
4606
            case ID:
4607
              if (field.type == TType.I64) {
4608
                this.id = iprot.readI64();
4609
                setIdIsSet(true);
4610
              } else { 
4611
                TProtocolUtil.skip(iprot, field.type);
4612
              }
4613
              break;
4614
            case PARAMS:
4615
              if (field.type == TType.MAP) {
4616
                {
4617
                  TMap _map17 = iprot.readMapBegin();
4618
                  this.params = new HashMap<String,String>(2*_map17.size);
4619
                  for (int _i18 = 0; _i18 < _map17.size; ++_i18)
4620
                  {
4621
                    String _key19;
4622
                    String _val20;
4623
                    _key19 = iprot.readString();
4624
                    _val20 = iprot.readString();
4625
                    this.params.put(_key19, _val20);
4626
                  }
4627
                  iprot.readMapEnd();
4628
                }
4629
              } else { 
4630
                TProtocolUtil.skip(iprot, field.type);
4631
              }
4632
              break;
4633
          }
4634
          iprot.readFieldEnd();
4635
        }
4636
      }
4637
      iprot.readStructEnd();
4638
      validate();
4639
    }
4640
 
4641
    public void write(TProtocol oprot) throws TException {
4642
      validate();
4643
 
4644
      oprot.writeStructBegin(STRUCT_DESC);
4645
      oprot.writeFieldBegin(ID_FIELD_DESC);
4646
      oprot.writeI64(this.id);
4647
      oprot.writeFieldEnd();
4648
      if (this.params != null) {
4649
        oprot.writeFieldBegin(PARAMS_FIELD_DESC);
4650
        {
4651
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.params.size()));
4652
          for (Map.Entry<String, String> _iter21 : this.params.entrySet())
4653
          {
4654
            oprot.writeString(_iter21.getKey());
4655
            oprot.writeString(_iter21.getValue());
4656
          }
4657
          oprot.writeMapEnd();
4658
        }
4659
        oprot.writeFieldEnd();
4660
      }
4661
      oprot.writeFieldStop();
4662
      oprot.writeStructEnd();
4663
    }
4664
 
4665
    @Override
4666
    public String toString() {
4667
      StringBuilder sb = new StringBuilder("getSubstitutedMessage_args(");
4668
      boolean first = true;
4669
 
4670
      sb.append("id:");
4671
      sb.append(this.id);
4672
      first = false;
4673
      if (!first) sb.append(", ");
4674
      sb.append("params:");
4675
      if (this.params == null) {
4676
        sb.append("null");
4677
      } else {
4678
        sb.append(this.params);
4679
      }
4680
      first = false;
4681
      sb.append(")");
4682
      return sb.toString();
4683
    }
4684
 
4685
    public void validate() throws TException {
4686
      // check for required fields
4687
    }
4688
 
4689
  }
4690
 
4691
  public static class getSubstitutedMessage_result implements TBase<getSubstitutedMessage_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSubstitutedMessage_result>   {
4692
    private static final TStruct STRUCT_DESC = new TStruct("getSubstitutedMessage_result");
4693
 
4694
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
4695
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
4696
 
4697
    private Message success;
4698
    private HelperServiceException se;
4699
 
4700
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4701
    public enum _Fields implements TFieldIdEnum {
4702
      SUCCESS((short)0, "success"),
4703
      SE((short)1, "se");
4704
 
4705
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4706
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4707
 
4708
      static {
4709
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4710
          byId.put((int)field._thriftId, field);
4711
          byName.put(field.getFieldName(), field);
4712
        }
4713
      }
4714
 
4715
      /**
4716
       * Find the _Fields constant that matches fieldId, or null if its not found.
4717
       */
4718
      public static _Fields findByThriftId(int fieldId) {
4719
        return byId.get(fieldId);
4720
      }
4721
 
4722
      /**
4723
       * Find the _Fields constant that matches fieldId, throwing an exception
4724
       * if it is not found.
4725
       */
4726
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4727
        _Fields fields = findByThriftId(fieldId);
4728
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4729
        return fields;
4730
      }
4731
 
4732
      /**
4733
       * Find the _Fields constant that matches name, or null if its not found.
4734
       */
4735
      public static _Fields findByName(String name) {
4736
        return byName.get(name);
4737
      }
4738
 
4739
      private final short _thriftId;
4740
      private final String _fieldName;
4741
 
4742
      _Fields(short thriftId, String fieldName) {
4743
        _thriftId = thriftId;
4744
        _fieldName = fieldName;
4745
      }
4746
 
4747
      public short getThriftFieldId() {
4748
        return _thriftId;
4749
      }
4750
 
4751
      public String getFieldName() {
4752
        return _fieldName;
4753
      }
4754
    }
4755
 
4756
    // isset id assignments
4757
 
4758
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4759
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
4760
          new StructMetaData(TType.STRUCT, Message.class)));
4761
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
4762
          new FieldValueMetaData(TType.STRUCT)));
4763
    }});
4764
 
4765
    static {
4766
      FieldMetaData.addStructMetaDataMap(getSubstitutedMessage_result.class, metaDataMap);
4767
    }
4768
 
4769
    public getSubstitutedMessage_result() {
4770
    }
4771
 
4772
    public getSubstitutedMessage_result(
4773
      Message success,
4774
      HelperServiceException se)
4775
    {
4776
      this();
4777
      this.success = success;
4778
      this.se = se;
4779
    }
4780
 
4781
    /**
4782
     * Performs a deep copy on <i>other</i>.
4783
     */
4784
    public getSubstitutedMessage_result(getSubstitutedMessage_result other) {
4785
      if (other.isSetSuccess()) {
4786
        this.success = new Message(other.success);
4787
      }
4788
      if (other.isSetSe()) {
4789
        this.se = new HelperServiceException(other.se);
4790
      }
4791
    }
4792
 
4793
    public getSubstitutedMessage_result deepCopy() {
4794
      return new getSubstitutedMessage_result(this);
4795
    }
4796
 
4797
    @Deprecated
4798
    public getSubstitutedMessage_result clone() {
4799
      return new getSubstitutedMessage_result(this);
4800
    }
4801
 
4802
    public Message getSuccess() {
4803
      return this.success;
4804
    }
4805
 
4806
    public getSubstitutedMessage_result setSuccess(Message success) {
4807
      this.success = success;
4808
      return this;
4809
    }
4810
 
4811
    public void unsetSuccess() {
4812
      this.success = null;
4813
    }
4814
 
4815
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
4816
    public boolean isSetSuccess() {
4817
      return this.success != null;
4818
    }
4819
 
4820
    public void setSuccessIsSet(boolean value) {
4821
      if (!value) {
4822
        this.success = null;
4823
      }
4824
    }
4825
 
4826
    public HelperServiceException getSe() {
4827
      return this.se;
4828
    }
4829
 
4830
    public getSubstitutedMessage_result setSe(HelperServiceException se) {
4831
      this.se = se;
4832
      return this;
4833
    }
4834
 
4835
    public void unsetSe() {
4836
      this.se = null;
4837
    }
4838
 
4839
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
4840
    public boolean isSetSe() {
4841
      return this.se != null;
4842
    }
4843
 
4844
    public void setSeIsSet(boolean value) {
4845
      if (!value) {
4846
        this.se = null;
4847
      }
4848
    }
4849
 
4850
    public void setFieldValue(_Fields field, Object value) {
4851
      switch (field) {
4852
      case SUCCESS:
4853
        if (value == null) {
4854
          unsetSuccess();
4855
        } else {
4856
          setSuccess((Message)value);
4857
        }
4858
        break;
4859
 
4860
      case SE:
4861
        if (value == null) {
4862
          unsetSe();
4863
        } else {
4864
          setSe((HelperServiceException)value);
4865
        }
4866
        break;
4867
 
4868
      }
4869
    }
4870
 
4871
    public void setFieldValue(int fieldID, Object value) {
4872
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4873
    }
4874
 
4875
    public Object getFieldValue(_Fields field) {
4876
      switch (field) {
4877
      case SUCCESS:
4878
        return getSuccess();
4879
 
4880
      case SE:
4881
        return getSe();
4882
 
4883
      }
4884
      throw new IllegalStateException();
4885
    }
4886
 
4887
    public Object getFieldValue(int fieldId) {
4888
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4889
    }
4890
 
4891
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4892
    public boolean isSet(_Fields field) {
4893
      switch (field) {
4894
      case SUCCESS:
4895
        return isSetSuccess();
4896
      case SE:
4897
        return isSetSe();
4898
      }
4899
      throw new IllegalStateException();
4900
    }
4901
 
4902
    public boolean isSet(int fieldID) {
4903
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4904
    }
4905
 
4906
    @Override
4907
    public boolean equals(Object that) {
4908
      if (that == null)
4909
        return false;
4910
      if (that instanceof getSubstitutedMessage_result)
4911
        return this.equals((getSubstitutedMessage_result)that);
4912
      return false;
4913
    }
4914
 
4915
    public boolean equals(getSubstitutedMessage_result that) {
4916
      if (that == null)
4917
        return false;
4918
 
4919
      boolean this_present_success = true && this.isSetSuccess();
4920
      boolean that_present_success = true && that.isSetSuccess();
4921
      if (this_present_success || that_present_success) {
4922
        if (!(this_present_success && that_present_success))
4923
          return false;
4924
        if (!this.success.equals(that.success))
4925
          return false;
4926
      }
4927
 
4928
      boolean this_present_se = true && this.isSetSe();
4929
      boolean that_present_se = true && that.isSetSe();
4930
      if (this_present_se || that_present_se) {
4931
        if (!(this_present_se && that_present_se))
4932
          return false;
4933
        if (!this.se.equals(that.se))
4934
          return false;
4935
      }
4936
 
4937
      return true;
4938
    }
4939
 
4940
    @Override
4941
    public int hashCode() {
4942
      return 0;
4943
    }
4944
 
4945
    public int compareTo(getSubstitutedMessage_result other) {
4946
      if (!getClass().equals(other.getClass())) {
4947
        return getClass().getName().compareTo(other.getClass().getName());
4948
      }
4949
 
4950
      int lastComparison = 0;
4951
      getSubstitutedMessage_result typedOther = (getSubstitutedMessage_result)other;
4952
 
4953
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
4954
      if (lastComparison != 0) {
4955
        return lastComparison;
4956
      }
4957
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
4958
      if (lastComparison != 0) {
4959
        return lastComparison;
4960
      }
4961
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
4962
      if (lastComparison != 0) {
4963
        return lastComparison;
4964
      }
4965
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
4966
      if (lastComparison != 0) {
4967
        return lastComparison;
4968
      }
4969
      return 0;
4970
    }
4971
 
4972
    public void read(TProtocol iprot) throws TException {
4973
      TField field;
4974
      iprot.readStructBegin();
4975
      while (true)
4976
      {
4977
        field = iprot.readFieldBegin();
4978
        if (field.type == TType.STOP) { 
4979
          break;
4980
        }
4981
        _Fields fieldId = _Fields.findByThriftId(field.id);
4982
        if (fieldId == null) {
4983
          TProtocolUtil.skip(iprot, field.type);
4984
        } else {
4985
          switch (fieldId) {
4986
            case SUCCESS:
4987
              if (field.type == TType.STRUCT) {
4988
                this.success = new Message();
4989
                this.success.read(iprot);
4990
              } else { 
4991
                TProtocolUtil.skip(iprot, field.type);
4992
              }
4993
              break;
4994
            case SE:
4995
              if (field.type == TType.STRUCT) {
4996
                this.se = new HelperServiceException();
4997
                this.se.read(iprot);
4998
              } else { 
4999
                TProtocolUtil.skip(iprot, field.type);
5000
              }
5001
              break;
5002
          }
5003
          iprot.readFieldEnd();
5004
        }
5005
      }
5006
      iprot.readStructEnd();
5007
      validate();
5008
    }
5009
 
5010
    public void write(TProtocol oprot) throws TException {
5011
      oprot.writeStructBegin(STRUCT_DESC);
5012
 
5013
      if (this.isSetSuccess()) {
5014
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5015
        this.success.write(oprot);
5016
        oprot.writeFieldEnd();
5017
      } else if (this.isSetSe()) {
5018
        oprot.writeFieldBegin(SE_FIELD_DESC);
5019
        this.se.write(oprot);
5020
        oprot.writeFieldEnd();
5021
      }
5022
      oprot.writeFieldStop();
5023
      oprot.writeStructEnd();
5024
    }
5025
 
5026
    @Override
5027
    public String toString() {
5028
      StringBuilder sb = new StringBuilder("getSubstitutedMessage_result(");
5029
      boolean first = true;
5030
 
5031
      sb.append("success:");
5032
      if (this.success == null) {
5033
        sb.append("null");
5034
      } else {
5035
        sb.append(this.success);
5036
      }
5037
      first = false;
5038
      if (!first) sb.append(", ");
5039
      sb.append("se:");
5040
      if (this.se == null) {
5041
        sb.append("null");
5042
      } else {
5043
        sb.append(this.se);
5044
      }
5045
      first = false;
5046
      sb.append(")");
5047
      return sb.toString();
5048
    }
5049
 
5050
    public void validate() throws TException {
5051
      // check for required fields
5052
    }
5053
 
5054
  }
5055
 
5056
}