Subversion Repositories SmartDukaan

Rev

Rev 11580 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11580 Rev 11606
Line 31... Line 31...
31
  private static final org.apache.thrift.protocol.TField DEAL_TEXT_OPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("dealTextOption", org.apache.thrift.protocol.TType.I64, (short)6);
31
  private static final org.apache.thrift.protocol.TField DEAL_TEXT_OPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("dealTextOption", org.apache.thrift.protocol.TType.I64, (short)6);
32
  private static final org.apache.thrift.protocol.TField DEAL_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("dealText", org.apache.thrift.protocol.TType.STRING, (short)7);
32
  private static final org.apache.thrift.protocol.TField DEAL_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("dealText", org.apache.thrift.protocol.TType.STRING, (short)7);
33
  private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)8);
33
  private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)8);
34
  private static final org.apache.thrift.protocol.TField RANK_FIELD_DESC = new org.apache.thrift.protocol.TField("rank", org.apache.thrift.protocol.TType.I64, (short)9);
34
  private static final org.apache.thrift.protocol.TField RANK_FIELD_DESC = new org.apache.thrift.protocol.TField("rank", org.apache.thrift.protocol.TType.I64, (short)9);
35
  private static final org.apache.thrift.protocol.TField DEAL_FREEBIE_OPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("dealFreebieOption", org.apache.thrift.protocol.TType.I64, (short)10);
35
  private static final org.apache.thrift.protocol.TField DEAL_FREEBIE_OPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("dealFreebieOption", org.apache.thrift.protocol.TType.I64, (short)10);
-
 
36
  private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)11);
36
 
37
 
37
  private long item_id; // required
38
  private long item_id; // required
38
  private double dealPrice; // required
39
  private double dealPrice; // required
39
  private long dealFreebieItemId; // required
40
  private long dealFreebieItemId; // required
40
  private long startDate; // required
41
  private long startDate; // required
Line 42... Line 43...
42
  private long dealTextOption; // required
43
  private long dealTextOption; // required
43
  private String dealText; // required
44
  private String dealText; // required
44
  private boolean isCod; // required
45
  private boolean isCod; // required
45
  private long rank; // required
46
  private long rank; // required
46
  private long dealFreebieOption; // required
47
  private long dealFreebieOption; // required
-
 
48
  private boolean isActive; // required
47
 
49
 
48
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
50
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
49
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
51
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
50
    ITEM_ID((short)1, "item_id"),
52
    ITEM_ID((short)1, "item_id"),
51
    DEAL_PRICE((short)2, "dealPrice"),
53
    DEAL_PRICE((short)2, "dealPrice"),
Line 54... Line 56...
54
    END_DATE((short)5, "endDate"),
56
    END_DATE((short)5, "endDate"),
55
    DEAL_TEXT_OPTION((short)6, "dealTextOption"),
57
    DEAL_TEXT_OPTION((short)6, "dealTextOption"),
56
    DEAL_TEXT((short)7, "dealText"),
58
    DEAL_TEXT((short)7, "dealText"),
57
    IS_COD((short)8, "isCod"),
59
    IS_COD((short)8, "isCod"),
58
    RANK((short)9, "rank"),
60
    RANK((short)9, "rank"),
59
    DEAL_FREEBIE_OPTION((short)10, "dealFreebieOption");
61
    DEAL_FREEBIE_OPTION((short)10, "dealFreebieOption"),
-
 
62
    IS_ACTIVE((short)11, "isActive");
60
 
63
 
61
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
64
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
62
 
65
 
63
    static {
66
    static {
64
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
67
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 89... Line 92...
89
          return IS_COD;
92
          return IS_COD;
90
        case 9: // RANK
93
        case 9: // RANK
91
          return RANK;
94
          return RANK;
92
        case 10: // DEAL_FREEBIE_OPTION
95
        case 10: // DEAL_FREEBIE_OPTION
93
          return DEAL_FREEBIE_OPTION;
96
          return DEAL_FREEBIE_OPTION;
-
 
97
        case 11: // IS_ACTIVE
-
 
98
          return IS_ACTIVE;
94
        default:
99
        default:
95
          return null;
100
          return null;
96
      }
101
      }
97
    }
102
    }
98
 
103
 
Line 138... Line 143...
138
  private static final int __ENDDATE_ISSET_ID = 4;
143
  private static final int __ENDDATE_ISSET_ID = 4;
139
  private static final int __DEALTEXTOPTION_ISSET_ID = 5;
144
  private static final int __DEALTEXTOPTION_ISSET_ID = 5;
140
  private static final int __ISCOD_ISSET_ID = 6;
145
  private static final int __ISCOD_ISSET_ID = 6;
141
  private static final int __RANK_ISSET_ID = 7;
146
  private static final int __RANK_ISSET_ID = 7;
142
  private static final int __DEALFREEBIEOPTION_ISSET_ID = 8;
147
  private static final int __DEALFREEBIEOPTION_ISSET_ID = 8;
-
 
148
  private static final int __ISACTIVE_ISSET_ID = 9;
143
  private BitSet __isset_bit_vector = new BitSet(9);
149
  private BitSet __isset_bit_vector = new BitSet(10);
144
 
150
 
145
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
151
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
146
  static {
152
  static {
147
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
153
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
148
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
Line 163... Line 169...
163
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
169
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
164
    tmpMap.put(_Fields.RANK, new org.apache.thrift.meta_data.FieldMetaData("rank", org.apache.thrift.TFieldRequirementType.DEFAULT, 
170
    tmpMap.put(_Fields.RANK, new org.apache.thrift.meta_data.FieldMetaData("rank", org.apache.thrift.TFieldRequirementType.DEFAULT, 
165
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
171
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
166
    tmpMap.put(_Fields.DEAL_FREEBIE_OPTION, new org.apache.thrift.meta_data.FieldMetaData("dealFreebieOption", org.apache.thrift.TFieldRequirementType.DEFAULT, 
172
    tmpMap.put(_Fields.DEAL_FREEBIE_OPTION, new org.apache.thrift.meta_data.FieldMetaData("dealFreebieOption", org.apache.thrift.TFieldRequirementType.DEFAULT, 
167
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
173
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
174
    tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
175
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
168
    metaDataMap = Collections.unmodifiableMap(tmpMap);
176
    metaDataMap = Collections.unmodifiableMap(tmpMap);
169
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PrivateDeal.class, metaDataMap);
177
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PrivateDeal.class, metaDataMap);
170
  }
178
  }
171
 
179
 
172
  public PrivateDeal() {
180
  public PrivateDeal() {
Line 180... Line 188...
180
    long endDate,
188
    long endDate,
181
    long dealTextOption,
189
    long dealTextOption,
182
    String dealText,
190
    String dealText,
183
    boolean isCod,
191
    boolean isCod,
184
    long rank,
192
    long rank,
185
    long dealFreebieOption)
193
    long dealFreebieOption,
-
 
194
    boolean isActive)
186
  {
195
  {
187
    this();
196
    this();
188
    this.item_id = item_id;
197
    this.item_id = item_id;
189
    setItem_idIsSet(true);
198
    setItem_idIsSet(true);
190
    this.dealPrice = dealPrice;
199
    this.dealPrice = dealPrice;
Line 202... Line 211...
202
    setIsCodIsSet(true);
211
    setIsCodIsSet(true);
203
    this.rank = rank;
212
    this.rank = rank;
204
    setRankIsSet(true);
213
    setRankIsSet(true);
205
    this.dealFreebieOption = dealFreebieOption;
214
    this.dealFreebieOption = dealFreebieOption;
206
    setDealFreebieOptionIsSet(true);
215
    setDealFreebieOptionIsSet(true);
-
 
216
    this.isActive = isActive;
-
 
217
    setIsActiveIsSet(true);
207
  }
218
  }
208
 
219
 
209
  /**
220
  /**
210
   * Performs a deep copy on <i>other</i>.
221
   * Performs a deep copy on <i>other</i>.
211
   */
222
   */
Line 222... Line 233...
222
      this.dealText = other.dealText;
233
      this.dealText = other.dealText;
223
    }
234
    }
224
    this.isCod = other.isCod;
235
    this.isCod = other.isCod;
225
    this.rank = other.rank;
236
    this.rank = other.rank;
226
    this.dealFreebieOption = other.dealFreebieOption;
237
    this.dealFreebieOption = other.dealFreebieOption;
-
 
238
    this.isActive = other.isActive;
227
  }
239
  }
228
 
240
 
229
  public PrivateDeal deepCopy() {
241
  public PrivateDeal deepCopy() {
230
    return new PrivateDeal(this);
242
    return new PrivateDeal(this);
231
  }
243
  }
Line 249... Line 261...
249
    this.isCod = false;
261
    this.isCod = false;
250
    setRankIsSet(false);
262
    setRankIsSet(false);
251
    this.rank = 0;
263
    this.rank = 0;
252
    setDealFreebieOptionIsSet(false);
264
    setDealFreebieOptionIsSet(false);
253
    this.dealFreebieOption = 0;
265
    this.dealFreebieOption = 0;
-
 
266
    setIsActiveIsSet(false);
-
 
267
    this.isActive = false;
254
  }
268
  }
255
 
269
 
256
  public long getItem_id() {
270
  public long getItem_id() {
257
    return this.item_id;
271
    return this.item_id;
258
  }
272
  }
Line 472... Line 486...
472
 
486
 
473
  public void setDealFreebieOptionIsSet(boolean value) {
487
  public void setDealFreebieOptionIsSet(boolean value) {
474
    __isset_bit_vector.set(__DEALFREEBIEOPTION_ISSET_ID, value);
488
    __isset_bit_vector.set(__DEALFREEBIEOPTION_ISSET_ID, value);
475
  }
489
  }
476
 
490
 
-
 
491
  public boolean isIsActive() {
-
 
492
    return this.isActive;
-
 
493
  }
-
 
494
 
-
 
495
  public void setIsActive(boolean isActive) {
-
 
496
    this.isActive = isActive;
-
 
497
    setIsActiveIsSet(true);
-
 
498
  }
-
 
499
 
-
 
500
  public void unsetIsActive() {
-
 
501
    __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
-
 
502
  }
-
 
503
 
-
 
504
  /** Returns true if field isActive is set (has been assigned a value) and false otherwise */
-
 
505
  public boolean isSetIsActive() {
-
 
506
    return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
-
 
507
  }
-
 
508
 
-
 
509
  public void setIsActiveIsSet(boolean value) {
-
 
510
    __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
-
 
511
  }
-
 
512
 
477
  public void setFieldValue(_Fields field, Object value) {
513
  public void setFieldValue(_Fields field, Object value) {
478
    switch (field) {
514
    switch (field) {
479
    case ITEM_ID:
515
    case ITEM_ID:
480
      if (value == null) {
516
      if (value == null) {
481
        unsetItem_id();
517
        unsetItem_id();
Line 554... Line 590...
554
      } else {
590
      } else {
555
        setDealFreebieOption((Long)value);
591
        setDealFreebieOption((Long)value);
556
      }
592
      }
557
      break;
593
      break;
558
 
594
 
-
 
595
    case IS_ACTIVE:
-
 
596
      if (value == null) {
-
 
597
        unsetIsActive();
-
 
598
      } else {
-
 
599
        setIsActive((Boolean)value);
-
 
600
      }
-
 
601
      break;
-
 
602
 
559
    }
603
    }
560
  }
604
  }
561
 
605
 
562
  public Object getFieldValue(_Fields field) {
606
  public Object getFieldValue(_Fields field) {
563
    switch (field) {
607
    switch (field) {
Line 589... Line 633...
589
      return Long.valueOf(getRank());
633
      return Long.valueOf(getRank());
590
 
634
 
591
    case DEAL_FREEBIE_OPTION:
635
    case DEAL_FREEBIE_OPTION:
592
      return Long.valueOf(getDealFreebieOption());
636
      return Long.valueOf(getDealFreebieOption());
593
 
637
 
-
 
638
    case IS_ACTIVE:
-
 
639
      return Boolean.valueOf(isIsActive());
-
 
640
 
594
    }
641
    }
595
    throw new IllegalStateException();
642
    throw new IllegalStateException();
596
  }
643
  }
597
 
644
 
598
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
645
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 620... Line 667...
620
      return isSetIsCod();
667
      return isSetIsCod();
621
    case RANK:
668
    case RANK:
622
      return isSetRank();
669
      return isSetRank();
623
    case DEAL_FREEBIE_OPTION:
670
    case DEAL_FREEBIE_OPTION:
624
      return isSetDealFreebieOption();
671
      return isSetDealFreebieOption();
-
 
672
    case IS_ACTIVE:
-
 
673
      return isSetIsActive();
625
    }
674
    }
626
    throw new IllegalStateException();
675
    throw new IllegalStateException();
627
  }
676
  }
628
 
677
 
629
  @Override
678
  @Override
Line 727... Line 776...
727
        return false;
776
        return false;
728
      if (this.dealFreebieOption != that.dealFreebieOption)
777
      if (this.dealFreebieOption != that.dealFreebieOption)
729
        return false;
778
        return false;
730
    }
779
    }
731
 
780
 
-
 
781
    boolean this_present_isActive = true;
-
 
782
    boolean that_present_isActive = true;
-
 
783
    if (this_present_isActive || that_present_isActive) {
-
 
784
      if (!(this_present_isActive && that_present_isActive))
-
 
785
        return false;
-
 
786
      if (this.isActive != that.isActive)
-
 
787
        return false;
-
 
788
    }
-
 
789
 
732
    return true;
790
    return true;
733
  }
791
  }
734
 
792
 
735
  @Override
793
  @Override
736
  public int hashCode() {
794
  public int hashCode() {
Line 843... Line 901...
843
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealFreebieOption, typedOther.dealFreebieOption);
901
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealFreebieOption, typedOther.dealFreebieOption);
844
      if (lastComparison != 0) {
902
      if (lastComparison != 0) {
845
        return lastComparison;
903
        return lastComparison;
846
      }
904
      }
847
    }
905
    }
-
 
906
    lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(typedOther.isSetIsActive());
-
 
907
    if (lastComparison != 0) {
-
 
908
      return lastComparison;
-
 
909
    }
-
 
910
    if (isSetIsActive()) {
-
 
911
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, typedOther.isActive);
-
 
912
      if (lastComparison != 0) {
-
 
913
        return lastComparison;
-
 
914
      }
-
 
915
    }
848
    return 0;
916
    return 0;
849
  }
917
  }
850
 
918
 
851
  public _Fields fieldForId(int fieldId) {
919
  public _Fields fieldForId(int fieldId) {
852
    return _Fields.findByThriftId(fieldId);
920
    return _Fields.findByThriftId(fieldId);
Line 939... Line 1007...
939
            setDealFreebieOptionIsSet(true);
1007
            setDealFreebieOptionIsSet(true);
940
          } else { 
1008
          } else { 
941
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1009
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
942
          }
1010
          }
943
          break;
1011
          break;
-
 
1012
        case 11: // IS_ACTIVE
-
 
1013
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
-
 
1014
            this.isActive = iprot.readBool();
-
 
1015
            setIsActiveIsSet(true);
-
 
1016
          } else { 
-
 
1017
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
1018
          }
-
 
1019
          break;
944
        default:
1020
        default:
945
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1021
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
946
      }
1022
      }
947
      iprot.readFieldEnd();
1023
      iprot.readFieldEnd();
948
    }
1024
    }
Line 984... Line 1060...
984
    oprot.writeI64(this.rank);
1060
    oprot.writeI64(this.rank);
985
    oprot.writeFieldEnd();
1061
    oprot.writeFieldEnd();
986
    oprot.writeFieldBegin(DEAL_FREEBIE_OPTION_FIELD_DESC);
1062
    oprot.writeFieldBegin(DEAL_FREEBIE_OPTION_FIELD_DESC);
987
    oprot.writeI64(this.dealFreebieOption);
1063
    oprot.writeI64(this.dealFreebieOption);
988
    oprot.writeFieldEnd();
1064
    oprot.writeFieldEnd();
-
 
1065
    oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
-
 
1066
    oprot.writeBool(this.isActive);
-
 
1067
    oprot.writeFieldEnd();
989
    oprot.writeFieldStop();
1068
    oprot.writeFieldStop();
990
    oprot.writeStructEnd();
1069
    oprot.writeStructEnd();
991
  }
1070
  }
992
 
1071
 
993
  @Override
1072
  @Override
Line 1036... Line 1115...
1036
    first = false;
1115
    first = false;
1037
    if (!first) sb.append(", ");
1116
    if (!first) sb.append(", ");
1038
    sb.append("dealFreebieOption:");
1117
    sb.append("dealFreebieOption:");
1039
    sb.append(this.dealFreebieOption);
1118
    sb.append(this.dealFreebieOption);
1040
    first = false;
1119
    first = false;
-
 
1120
    if (!first) sb.append(", ");
-
 
1121
    sb.append("isActive:");
-
 
1122
    sb.append(this.isActive);
-
 
1123
    first = false;
1041
    sb.append(")");
1124
    sb.append(")");
1042
    return sb.toString();
1125
    return sb.toString();
1043
  }
1126
  }
1044
 
1127
 
1045
  public void validate() throws org.apache.thrift.TException {
1128
  public void validate() throws org.apache.thrift.TException {