Subversion Repositories SmartDukaan

Rev

Rev 9048 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9048 manish.sha 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.googleadwords;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class AdwordsAdGroup implements org.apache.thrift.TBase<AdwordsAdGroup, AdwordsAdGroup._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AdwordsAdGroup");
25
 
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField CAMPAIGN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("campaignId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField ADGROUP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("adgroupId", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField CATALOG_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogItemId", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)5);
31
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)6);
32
  private static final org.apache.thrift.protocol.TField BID_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("bidAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)7);
9057 manish.sha 33
  private static final org.apache.thrift.protocol.TField STOCK_LINKED_FIELD_DESC = new org.apache.thrift.protocol.TField("stockLinked", org.apache.thrift.protocol.TType.I32, (short)8);
9048 manish.sha 34
 
35
  private long id; // required
36
  private long campaignId; // required
37
  private long adgroupId; // required
38
  private long catalogItemId; // required
39
  private String name; // required
40
  private AdwordsAdGroupStatus status; // required
41
  private double bidAmount; // required
9057 manish.sha 42
  private int stockLinked; // required
9048 manish.sha 43
 
44
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
45
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
46
    ID((short)1, "id"),
47
    CAMPAIGN_ID((short)2, "campaignId"),
48
    ADGROUP_ID((short)3, "adgroupId"),
49
    CATALOG_ITEM_ID((short)4, "catalogItemId"),
50
    NAME((short)5, "name"),
51
    /**
52
     * 
53
     * @see AdwordsAdGroupStatus
54
     */
55
    STATUS((short)6, "status"),
9057 manish.sha 56
    BID_AMOUNT((short)7, "bidAmount"),
57
    STOCK_LINKED((short)8, "stockLinked");
9048 manish.sha 58
 
59
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
60
 
61
    static {
62
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
63
        byName.put(field.getFieldName(), field);
64
      }
65
    }
66
 
67
    /**
68
     * Find the _Fields constant that matches fieldId, or null if its not found.
69
     */
70
    public static _Fields findByThriftId(int fieldId) {
71
      switch(fieldId) {
72
        case 1: // ID
73
          return ID;
74
        case 2: // CAMPAIGN_ID
75
          return CAMPAIGN_ID;
76
        case 3: // ADGROUP_ID
77
          return ADGROUP_ID;
78
        case 4: // CATALOG_ITEM_ID
79
          return CATALOG_ITEM_ID;
80
        case 5: // NAME
81
          return NAME;
82
        case 6: // STATUS
83
          return STATUS;
84
        case 7: // BID_AMOUNT
85
          return BID_AMOUNT;
9057 manish.sha 86
        case 8: // STOCK_LINKED
87
          return STOCK_LINKED;
9048 manish.sha 88
        default:
89
          return null;
90
      }
91
    }
92
 
93
    /**
94
     * Find the _Fields constant that matches fieldId, throwing an exception
95
     * if it is not found.
96
     */
97
    public static _Fields findByThriftIdOrThrow(int fieldId) {
98
      _Fields fields = findByThriftId(fieldId);
99
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
100
      return fields;
101
    }
102
 
103
    /**
104
     * Find the _Fields constant that matches name, or null if its not found.
105
     */
106
    public static _Fields findByName(String name) {
107
      return byName.get(name);
108
    }
109
 
110
    private final short _thriftId;
111
    private final String _fieldName;
112
 
113
    _Fields(short thriftId, String fieldName) {
114
      _thriftId = thriftId;
115
      _fieldName = fieldName;
116
    }
117
 
118
    public short getThriftFieldId() {
119
      return _thriftId;
120
    }
121
 
122
    public String getFieldName() {
123
      return _fieldName;
124
    }
125
  }
126
 
127
  // isset id assignments
128
  private static final int __ID_ISSET_ID = 0;
129
  private static final int __CAMPAIGNID_ISSET_ID = 1;
130
  private static final int __ADGROUPID_ISSET_ID = 2;
131
  private static final int __CATALOGITEMID_ISSET_ID = 3;
132
  private static final int __BIDAMOUNT_ISSET_ID = 4;
9057 manish.sha 133
  private static final int __STOCKLINKED_ISSET_ID = 5;
134
  private BitSet __isset_bit_vector = new BitSet(6);
9048 manish.sha 135
 
136
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
137
  static {
138
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
139
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
140
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
141
    tmpMap.put(_Fields.CAMPAIGN_ID, new org.apache.thrift.meta_data.FieldMetaData("campaignId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
143
    tmpMap.put(_Fields.ADGROUP_ID, new org.apache.thrift.meta_data.FieldMetaData("adgroupId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
144
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
145
    tmpMap.put(_Fields.CATALOG_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("catalogItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
147
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
149
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AdwordsAdGroupStatus.class)));
151
    tmpMap.put(_Fields.BID_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("bidAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
9057 manish.sha 153
    tmpMap.put(_Fields.STOCK_LINKED, new org.apache.thrift.meta_data.FieldMetaData("stockLinked", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
9048 manish.sha 155
    metaDataMap = Collections.unmodifiableMap(tmpMap);
156
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AdwordsAdGroup.class, metaDataMap);
157
  }
158
 
159
  public AdwordsAdGroup() {
160
  }
161
 
162
  public AdwordsAdGroup(
163
    long id,
164
    long campaignId,
165
    long adgroupId,
166
    long catalogItemId,
167
    String name,
168
    AdwordsAdGroupStatus status,
9057 manish.sha 169
    double bidAmount,
170
    int stockLinked)
9048 manish.sha 171
  {
172
    this();
173
    this.id = id;
174
    setIdIsSet(true);
175
    this.campaignId = campaignId;
176
    setCampaignIdIsSet(true);
177
    this.adgroupId = adgroupId;
178
    setAdgroupIdIsSet(true);
179
    this.catalogItemId = catalogItemId;
180
    setCatalogItemIdIsSet(true);
181
    this.name = name;
182
    this.status = status;
183
    this.bidAmount = bidAmount;
184
    setBidAmountIsSet(true);
9057 manish.sha 185
    this.stockLinked = stockLinked;
186
    setStockLinkedIsSet(true);
9048 manish.sha 187
  }
188
 
189
  /**
190
   * Performs a deep copy on <i>other</i>.
191
   */
192
  public AdwordsAdGroup(AdwordsAdGroup other) {
193
    __isset_bit_vector.clear();
194
    __isset_bit_vector.or(other.__isset_bit_vector);
195
    this.id = other.id;
196
    this.campaignId = other.campaignId;
197
    this.adgroupId = other.adgroupId;
198
    this.catalogItemId = other.catalogItemId;
199
    if (other.isSetName()) {
200
      this.name = other.name;
201
    }
202
    if (other.isSetStatus()) {
203
      this.status = other.status;
204
    }
205
    this.bidAmount = other.bidAmount;
9057 manish.sha 206
    this.stockLinked = other.stockLinked;
9048 manish.sha 207
  }
208
 
209
  public AdwordsAdGroup deepCopy() {
210
    return new AdwordsAdGroup(this);
211
  }
212
 
213
  @Override
214
  public void clear() {
215
    setIdIsSet(false);
216
    this.id = 0;
217
    setCampaignIdIsSet(false);
218
    this.campaignId = 0;
219
    setAdgroupIdIsSet(false);
220
    this.adgroupId = 0;
221
    setCatalogItemIdIsSet(false);
222
    this.catalogItemId = 0;
223
    this.name = null;
224
    this.status = null;
225
    setBidAmountIsSet(false);
226
    this.bidAmount = 0.0;
9057 manish.sha 227
    setStockLinkedIsSet(false);
228
    this.stockLinked = 0;
9048 manish.sha 229
  }
230
 
231
  public long getId() {
232
    return this.id;
233
  }
234
 
235
  public void setId(long id) {
236
    this.id = id;
237
    setIdIsSet(true);
238
  }
239
 
240
  public void unsetId() {
241
    __isset_bit_vector.clear(__ID_ISSET_ID);
242
  }
243
 
244
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
245
  public boolean isSetId() {
246
    return __isset_bit_vector.get(__ID_ISSET_ID);
247
  }
248
 
249
  public void setIdIsSet(boolean value) {
250
    __isset_bit_vector.set(__ID_ISSET_ID, value);
251
  }
252
 
253
  public long getCampaignId() {
254
    return this.campaignId;
255
  }
256
 
257
  public void setCampaignId(long campaignId) {
258
    this.campaignId = campaignId;
259
    setCampaignIdIsSet(true);
260
  }
261
 
262
  public void unsetCampaignId() {
263
    __isset_bit_vector.clear(__CAMPAIGNID_ISSET_ID);
264
  }
265
 
266
  /** Returns true if field campaignId is set (has been assigned a value) and false otherwise */
267
  public boolean isSetCampaignId() {
268
    return __isset_bit_vector.get(__CAMPAIGNID_ISSET_ID);
269
  }
270
 
271
  public void setCampaignIdIsSet(boolean value) {
272
    __isset_bit_vector.set(__CAMPAIGNID_ISSET_ID, value);
273
  }
274
 
275
  public long getAdgroupId() {
276
    return this.adgroupId;
277
  }
278
 
279
  public void setAdgroupId(long adgroupId) {
280
    this.adgroupId = adgroupId;
281
    setAdgroupIdIsSet(true);
282
  }
283
 
284
  public void unsetAdgroupId() {
285
    __isset_bit_vector.clear(__ADGROUPID_ISSET_ID);
286
  }
287
 
288
  /** Returns true if field adgroupId is set (has been assigned a value) and false otherwise */
289
  public boolean isSetAdgroupId() {
290
    return __isset_bit_vector.get(__ADGROUPID_ISSET_ID);
291
  }
292
 
293
  public void setAdgroupIdIsSet(boolean value) {
294
    __isset_bit_vector.set(__ADGROUPID_ISSET_ID, value);
295
  }
296
 
297
  public long getCatalogItemId() {
298
    return this.catalogItemId;
299
  }
300
 
301
  public void setCatalogItemId(long catalogItemId) {
302
    this.catalogItemId = catalogItemId;
303
    setCatalogItemIdIsSet(true);
304
  }
305
 
306
  public void unsetCatalogItemId() {
307
    __isset_bit_vector.clear(__CATALOGITEMID_ISSET_ID);
308
  }
309
 
310
  /** Returns true if field catalogItemId is set (has been assigned a value) and false otherwise */
311
  public boolean isSetCatalogItemId() {
312
    return __isset_bit_vector.get(__CATALOGITEMID_ISSET_ID);
313
  }
314
 
315
  public void setCatalogItemIdIsSet(boolean value) {
316
    __isset_bit_vector.set(__CATALOGITEMID_ISSET_ID, value);
317
  }
318
 
319
  public String getName() {
320
    return this.name;
321
  }
322
 
323
  public void setName(String name) {
324
    this.name = name;
325
  }
326
 
327
  public void unsetName() {
328
    this.name = null;
329
  }
330
 
331
  /** Returns true if field name is set (has been assigned a value) and false otherwise */
332
  public boolean isSetName() {
333
    return this.name != null;
334
  }
335
 
336
  public void setNameIsSet(boolean value) {
337
    if (!value) {
338
      this.name = null;
339
    }
340
  }
341
 
342
  /**
343
   * 
344
   * @see AdwordsAdGroupStatus
345
   */
346
  public AdwordsAdGroupStatus getStatus() {
347
    return this.status;
348
  }
349
 
350
  /**
351
   * 
352
   * @see AdwordsAdGroupStatus
353
   */
354
  public void setStatus(AdwordsAdGroupStatus status) {
355
    this.status = status;
356
  }
357
 
358
  public void unsetStatus() {
359
    this.status = null;
360
  }
361
 
362
  /** Returns true if field status is set (has been assigned a value) and false otherwise */
363
  public boolean isSetStatus() {
364
    return this.status != null;
365
  }
366
 
367
  public void setStatusIsSet(boolean value) {
368
    if (!value) {
369
      this.status = null;
370
    }
371
  }
372
 
373
  public double getBidAmount() {
374
    return this.bidAmount;
375
  }
376
 
377
  public void setBidAmount(double bidAmount) {
378
    this.bidAmount = bidAmount;
379
    setBidAmountIsSet(true);
380
  }
381
 
382
  public void unsetBidAmount() {
383
    __isset_bit_vector.clear(__BIDAMOUNT_ISSET_ID);
384
  }
385
 
386
  /** Returns true if field bidAmount is set (has been assigned a value) and false otherwise */
387
  public boolean isSetBidAmount() {
388
    return __isset_bit_vector.get(__BIDAMOUNT_ISSET_ID);
389
  }
390
 
391
  public void setBidAmountIsSet(boolean value) {
392
    __isset_bit_vector.set(__BIDAMOUNT_ISSET_ID, value);
393
  }
394
 
9057 manish.sha 395
  public int getStockLinked() {
396
    return this.stockLinked;
397
  }
398
 
399
  public void setStockLinked(int stockLinked) {
400
    this.stockLinked = stockLinked;
401
    setStockLinkedIsSet(true);
402
  }
403
 
404
  public void unsetStockLinked() {
405
    __isset_bit_vector.clear(__STOCKLINKED_ISSET_ID);
406
  }
407
 
408
  /** Returns true if field stockLinked is set (has been assigned a value) and false otherwise */
409
  public boolean isSetStockLinked() {
410
    return __isset_bit_vector.get(__STOCKLINKED_ISSET_ID);
411
  }
412
 
413
  public void setStockLinkedIsSet(boolean value) {
414
    __isset_bit_vector.set(__STOCKLINKED_ISSET_ID, value);
415
  }
416
 
9048 manish.sha 417
  public void setFieldValue(_Fields field, Object value) {
418
    switch (field) {
419
    case ID:
420
      if (value == null) {
421
        unsetId();
422
      } else {
423
        setId((Long)value);
424
      }
425
      break;
426
 
427
    case CAMPAIGN_ID:
428
      if (value == null) {
429
        unsetCampaignId();
430
      } else {
431
        setCampaignId((Long)value);
432
      }
433
      break;
434
 
435
    case ADGROUP_ID:
436
      if (value == null) {
437
        unsetAdgroupId();
438
      } else {
439
        setAdgroupId((Long)value);
440
      }
441
      break;
442
 
443
    case CATALOG_ITEM_ID:
444
      if (value == null) {
445
        unsetCatalogItemId();
446
      } else {
447
        setCatalogItemId((Long)value);
448
      }
449
      break;
450
 
451
    case NAME:
452
      if (value == null) {
453
        unsetName();
454
      } else {
455
        setName((String)value);
456
      }
457
      break;
458
 
459
    case STATUS:
460
      if (value == null) {
461
        unsetStatus();
462
      } else {
463
        setStatus((AdwordsAdGroupStatus)value);
464
      }
465
      break;
466
 
467
    case BID_AMOUNT:
468
      if (value == null) {
469
        unsetBidAmount();
470
      } else {
471
        setBidAmount((Double)value);
472
      }
473
      break;
474
 
9057 manish.sha 475
    case STOCK_LINKED:
476
      if (value == null) {
477
        unsetStockLinked();
478
      } else {
479
        setStockLinked((Integer)value);
480
      }
481
      break;
482
 
9048 manish.sha 483
    }
484
  }
485
 
486
  public Object getFieldValue(_Fields field) {
487
    switch (field) {
488
    case ID:
489
      return Long.valueOf(getId());
490
 
491
    case CAMPAIGN_ID:
492
      return Long.valueOf(getCampaignId());
493
 
494
    case ADGROUP_ID:
495
      return Long.valueOf(getAdgroupId());
496
 
497
    case CATALOG_ITEM_ID:
498
      return Long.valueOf(getCatalogItemId());
499
 
500
    case NAME:
501
      return getName();
502
 
503
    case STATUS:
504
      return getStatus();
505
 
506
    case BID_AMOUNT:
507
      return Double.valueOf(getBidAmount());
508
 
9057 manish.sha 509
    case STOCK_LINKED:
510
      return Integer.valueOf(getStockLinked());
511
 
9048 manish.sha 512
    }
513
    throw new IllegalStateException();
514
  }
515
 
516
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
517
  public boolean isSet(_Fields field) {
518
    if (field == null) {
519
      throw new IllegalArgumentException();
520
    }
521
 
522
    switch (field) {
523
    case ID:
524
      return isSetId();
525
    case CAMPAIGN_ID:
526
      return isSetCampaignId();
527
    case ADGROUP_ID:
528
      return isSetAdgroupId();
529
    case CATALOG_ITEM_ID:
530
      return isSetCatalogItemId();
531
    case NAME:
532
      return isSetName();
533
    case STATUS:
534
      return isSetStatus();
535
    case BID_AMOUNT:
536
      return isSetBidAmount();
9057 manish.sha 537
    case STOCK_LINKED:
538
      return isSetStockLinked();
9048 manish.sha 539
    }
540
    throw new IllegalStateException();
541
  }
542
 
543
  @Override
544
  public boolean equals(Object that) {
545
    if (that == null)
546
      return false;
547
    if (that instanceof AdwordsAdGroup)
548
      return this.equals((AdwordsAdGroup)that);
549
    return false;
550
  }
551
 
552
  public boolean equals(AdwordsAdGroup that) {
553
    if (that == null)
554
      return false;
555
 
556
    boolean this_present_id = true;
557
    boolean that_present_id = true;
558
    if (this_present_id || that_present_id) {
559
      if (!(this_present_id && that_present_id))
560
        return false;
561
      if (this.id != that.id)
562
        return false;
563
    }
564
 
565
    boolean this_present_campaignId = true;
566
    boolean that_present_campaignId = true;
567
    if (this_present_campaignId || that_present_campaignId) {
568
      if (!(this_present_campaignId && that_present_campaignId))
569
        return false;
570
      if (this.campaignId != that.campaignId)
571
        return false;
572
    }
573
 
574
    boolean this_present_adgroupId = true;
575
    boolean that_present_adgroupId = true;
576
    if (this_present_adgroupId || that_present_adgroupId) {
577
      if (!(this_present_adgroupId && that_present_adgroupId))
578
        return false;
579
      if (this.adgroupId != that.adgroupId)
580
        return false;
581
    }
582
 
583
    boolean this_present_catalogItemId = true;
584
    boolean that_present_catalogItemId = true;
585
    if (this_present_catalogItemId || that_present_catalogItemId) {
586
      if (!(this_present_catalogItemId && that_present_catalogItemId))
587
        return false;
588
      if (this.catalogItemId != that.catalogItemId)
589
        return false;
590
    }
591
 
592
    boolean this_present_name = true && this.isSetName();
593
    boolean that_present_name = true && that.isSetName();
594
    if (this_present_name || that_present_name) {
595
      if (!(this_present_name && that_present_name))
596
        return false;
597
      if (!this.name.equals(that.name))
598
        return false;
599
    }
600
 
601
    boolean this_present_status = true && this.isSetStatus();
602
    boolean that_present_status = true && that.isSetStatus();
603
    if (this_present_status || that_present_status) {
604
      if (!(this_present_status && that_present_status))
605
        return false;
606
      if (!this.status.equals(that.status))
607
        return false;
608
    }
609
 
610
    boolean this_present_bidAmount = true;
611
    boolean that_present_bidAmount = true;
612
    if (this_present_bidAmount || that_present_bidAmount) {
613
      if (!(this_present_bidAmount && that_present_bidAmount))
614
        return false;
615
      if (this.bidAmount != that.bidAmount)
616
        return false;
617
    }
618
 
9057 manish.sha 619
    boolean this_present_stockLinked = true;
620
    boolean that_present_stockLinked = true;
621
    if (this_present_stockLinked || that_present_stockLinked) {
622
      if (!(this_present_stockLinked && that_present_stockLinked))
623
        return false;
624
      if (this.stockLinked != that.stockLinked)
625
        return false;
626
    }
627
 
9048 manish.sha 628
    return true;
629
  }
630
 
631
  @Override
632
  public int hashCode() {
633
    return 0;
634
  }
635
 
636
  public int compareTo(AdwordsAdGroup other) {
637
    if (!getClass().equals(other.getClass())) {
638
      return getClass().getName().compareTo(other.getClass().getName());
639
    }
640
 
641
    int lastComparison = 0;
642
    AdwordsAdGroup typedOther = (AdwordsAdGroup)other;
643
 
644
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
645
    if (lastComparison != 0) {
646
      return lastComparison;
647
    }
648
    if (isSetId()) {
649
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
650
      if (lastComparison != 0) {
651
        return lastComparison;
652
      }
653
    }
654
    lastComparison = Boolean.valueOf(isSetCampaignId()).compareTo(typedOther.isSetCampaignId());
655
    if (lastComparison != 0) {
656
      return lastComparison;
657
    }
658
    if (isSetCampaignId()) {
659
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.campaignId, typedOther.campaignId);
660
      if (lastComparison != 0) {
661
        return lastComparison;
662
      }
663
    }
664
    lastComparison = Boolean.valueOf(isSetAdgroupId()).compareTo(typedOther.isSetAdgroupId());
665
    if (lastComparison != 0) {
666
      return lastComparison;
667
    }
668
    if (isSetAdgroupId()) {
669
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.adgroupId, typedOther.adgroupId);
670
      if (lastComparison != 0) {
671
        return lastComparison;
672
      }
673
    }
674
    lastComparison = Boolean.valueOf(isSetCatalogItemId()).compareTo(typedOther.isSetCatalogItemId());
675
    if (lastComparison != 0) {
676
      return lastComparison;
677
    }
678
    if (isSetCatalogItemId()) {
679
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogItemId, typedOther.catalogItemId);
680
      if (lastComparison != 0) {
681
        return lastComparison;
682
      }
683
    }
684
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
685
    if (lastComparison != 0) {
686
      return lastComparison;
687
    }
688
    if (isSetName()) {
689
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
690
      if (lastComparison != 0) {
691
        return lastComparison;
692
      }
693
    }
694
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
695
    if (lastComparison != 0) {
696
      return lastComparison;
697
    }
698
    if (isSetStatus()) {
699
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
700
      if (lastComparison != 0) {
701
        return lastComparison;
702
      }
703
    }
704
    lastComparison = Boolean.valueOf(isSetBidAmount()).compareTo(typedOther.isSetBidAmount());
705
    if (lastComparison != 0) {
706
      return lastComparison;
707
    }
708
    if (isSetBidAmount()) {
709
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bidAmount, typedOther.bidAmount);
710
      if (lastComparison != 0) {
711
        return lastComparison;
712
      }
713
    }
9057 manish.sha 714
    lastComparison = Boolean.valueOf(isSetStockLinked()).compareTo(typedOther.isSetStockLinked());
715
    if (lastComparison != 0) {
716
      return lastComparison;
717
    }
718
    if (isSetStockLinked()) {
719
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stockLinked, typedOther.stockLinked);
720
      if (lastComparison != 0) {
721
        return lastComparison;
722
      }
723
    }
9048 manish.sha 724
    return 0;
725
  }
726
 
727
  public _Fields fieldForId(int fieldId) {
728
    return _Fields.findByThriftId(fieldId);
729
  }
730
 
731
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
732
    org.apache.thrift.protocol.TField field;
733
    iprot.readStructBegin();
734
    while (true)
735
    {
736
      field = iprot.readFieldBegin();
737
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
738
        break;
739
      }
740
      switch (field.id) {
741
        case 1: // ID
742
          if (field.type == org.apache.thrift.protocol.TType.I64) {
743
            this.id = iprot.readI64();
744
            setIdIsSet(true);
745
          } else { 
746
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
747
          }
748
          break;
749
        case 2: // CAMPAIGN_ID
750
          if (field.type == org.apache.thrift.protocol.TType.I64) {
751
            this.campaignId = iprot.readI64();
752
            setCampaignIdIsSet(true);
753
          } else { 
754
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
755
          }
756
          break;
757
        case 3: // ADGROUP_ID
758
          if (field.type == org.apache.thrift.protocol.TType.I64) {
759
            this.adgroupId = iprot.readI64();
760
            setAdgroupIdIsSet(true);
761
          } else { 
762
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
763
          }
764
          break;
765
        case 4: // CATALOG_ITEM_ID
766
          if (field.type == org.apache.thrift.protocol.TType.I64) {
767
            this.catalogItemId = iprot.readI64();
768
            setCatalogItemIdIsSet(true);
769
          } else { 
770
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
771
          }
772
          break;
773
        case 5: // NAME
774
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
775
            this.name = iprot.readString();
776
          } else { 
777
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
778
          }
779
          break;
780
        case 6: // STATUS
781
          if (field.type == org.apache.thrift.protocol.TType.I32) {
782
            this.status = AdwordsAdGroupStatus.findByValue(iprot.readI32());
783
          } else { 
784
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
785
          }
786
          break;
787
        case 7: // BID_AMOUNT
788
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
789
            this.bidAmount = iprot.readDouble();
790
            setBidAmountIsSet(true);
791
          } else { 
792
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
793
          }
794
          break;
9057 manish.sha 795
        case 8: // STOCK_LINKED
796
          if (field.type == org.apache.thrift.protocol.TType.I32) {
797
            this.stockLinked = iprot.readI32();
798
            setStockLinkedIsSet(true);
799
          } else { 
800
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
801
          }
802
          break;
9048 manish.sha 803
        default:
804
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
805
      }
806
      iprot.readFieldEnd();
807
    }
808
    iprot.readStructEnd();
809
    validate();
810
  }
811
 
812
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
813
    validate();
814
 
815
    oprot.writeStructBegin(STRUCT_DESC);
816
    oprot.writeFieldBegin(ID_FIELD_DESC);
817
    oprot.writeI64(this.id);
818
    oprot.writeFieldEnd();
819
    oprot.writeFieldBegin(CAMPAIGN_ID_FIELD_DESC);
820
    oprot.writeI64(this.campaignId);
821
    oprot.writeFieldEnd();
822
    oprot.writeFieldBegin(ADGROUP_ID_FIELD_DESC);
823
    oprot.writeI64(this.adgroupId);
824
    oprot.writeFieldEnd();
825
    oprot.writeFieldBegin(CATALOG_ITEM_ID_FIELD_DESC);
826
    oprot.writeI64(this.catalogItemId);
827
    oprot.writeFieldEnd();
828
    if (this.name != null) {
829
      oprot.writeFieldBegin(NAME_FIELD_DESC);
830
      oprot.writeString(this.name);
831
      oprot.writeFieldEnd();
832
    }
833
    if (this.status != null) {
834
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
835
      oprot.writeI32(this.status.getValue());
836
      oprot.writeFieldEnd();
837
    }
838
    oprot.writeFieldBegin(BID_AMOUNT_FIELD_DESC);
839
    oprot.writeDouble(this.bidAmount);
840
    oprot.writeFieldEnd();
9057 manish.sha 841
    oprot.writeFieldBegin(STOCK_LINKED_FIELD_DESC);
842
    oprot.writeI32(this.stockLinked);
843
    oprot.writeFieldEnd();
9048 manish.sha 844
    oprot.writeFieldStop();
845
    oprot.writeStructEnd();
846
  }
847
 
848
  @Override
849
  public String toString() {
850
    StringBuilder sb = new StringBuilder("AdwordsAdGroup(");
851
    boolean first = true;
852
 
853
    sb.append("id:");
854
    sb.append(this.id);
855
    first = false;
856
    if (!first) sb.append(", ");
857
    sb.append("campaignId:");
858
    sb.append(this.campaignId);
859
    first = false;
860
    if (!first) sb.append(", ");
861
    sb.append("adgroupId:");
862
    sb.append(this.adgroupId);
863
    first = false;
864
    if (!first) sb.append(", ");
865
    sb.append("catalogItemId:");
866
    sb.append(this.catalogItemId);
867
    first = false;
868
    if (!first) sb.append(", ");
869
    sb.append("name:");
870
    if (this.name == null) {
871
      sb.append("null");
872
    } else {
873
      sb.append(this.name);
874
    }
875
    first = false;
876
    if (!first) sb.append(", ");
877
    sb.append("status:");
878
    if (this.status == null) {
879
      sb.append("null");
880
    } else {
881
      sb.append(this.status);
882
    }
883
    first = false;
884
    if (!first) sb.append(", ");
885
    sb.append("bidAmount:");
886
    sb.append(this.bidAmount);
887
    first = false;
9057 manish.sha 888
    if (!first) sb.append(", ");
889
    sb.append("stockLinked:");
890
    sb.append(this.stockLinked);
891
    first = false;
9048 manish.sha 892
    sb.append(")");
893
    return sb.toString();
894
  }
895
 
896
  public void validate() throws org.apache.thrift.TException {
897
    // check for required fields
898
  }
899
 
900
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
901
    try {
902
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
903
    } catch (org.apache.thrift.TException te) {
904
      throw new java.io.IOException(te);
905
    }
906
  }
907
 
908
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
909
    try {
910
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
911
      __isset_bit_vector = new BitSet(1);
912
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
913
    } catch (org.apache.thrift.TException te) {
914
      throw new java.io.IOException(te);
915
    }
916
  }
917
 
918
}
919