Subversion Repositories SmartDukaan

Rev

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