Subversion Repositories SmartDukaan

Rev

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

Rev 614 Rev 648
Line 24... Line 24...
24
import org.apache.thrift.protocol.*;
24
import org.apache.thrift.protocol.*;
25
 
25
 
26
public class Line implements TBase<Line._Fields>, java.io.Serializable, Cloneable, Comparable<Line> {
26
public class Line implements TBase<Line._Fields>, java.io.Serializable, Cloneable, Comparable<Line> {
27
  private static final TStruct STRUCT_DESC = new TStruct("Line");
27
  private static final TStruct STRUCT_DESC = new TStruct("Line");
28
 
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
29
  private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
30
  private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);
30
  private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);
31
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)3);
31
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)3);
32
  private static final TField CREATED_ON_FIELD_DESC = new TField("createdOn", TType.I64, (short)4);
32
  private static final TField CREATED_ON_FIELD_DESC = new TField("createdOn", TType.I64, (short)4);
33
  private static final TField UPDATED_ON_FIELD_DESC = new TField("updatedOn", TType.I64, (short)5);
33
  private static final TField UPDATED_ON_FIELD_DESC = new TField("updatedOn", TType.I64, (short)5);
34
  private static final TField LINE_STATUS_FIELD_DESC = new TField("lineStatus", TType.I32, (short)6);
34
  private static final TField LINE_STATUS_FIELD_DESC = new TField("lineStatus", TType.I32, (short)6);
35
  private static final TField ESTIMATE_FIELD_DESC = new TField("estimate", TType.I32, (short)7);
35
  private static final TField ESTIMATE_FIELD_DESC = new TField("estimate", TType.I32, (short)7);
36
 
36
 
37
  private long id;
37
  private long cartId;
38
  private long itemId;
38
  private long itemId;
39
  private double quantity;
39
  private double quantity;
40
  private long createdOn;
40
  private long createdOn;
41
  private long updatedOn;
41
  private long updatedOn;
42
  private LineStatus lineStatus;
42
  private LineStatus lineStatus;
43
  private int estimate;
43
  private int estimate;
44
 
44
 
45
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
45
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
46
  public enum _Fields implements TFieldIdEnum {
46
  public enum _Fields implements TFieldIdEnum {
47
    ID((short)1, "id"),
47
    CART_ID((short)1, "cartId"),
48
    ITEM_ID((short)2, "itemId"),
48
    ITEM_ID((short)2, "itemId"),
49
    QUANTITY((short)3, "quantity"),
49
    QUANTITY((short)3, "quantity"),
50
    CREATED_ON((short)4, "createdOn"),
50
    CREATED_ON((short)4, "createdOn"),
51
    UPDATED_ON((short)5, "updatedOn"),
51
    UPDATED_ON((short)5, "updatedOn"),
52
    /**
52
    /**
Line 106... Line 106...
106
      return _fieldName;
106
      return _fieldName;
107
    }
107
    }
108
  }
108
  }
109
 
109
 
110
  // isset id assignments
110
  // isset id assignments
111
  private static final int __ID_ISSET_ID = 0;
111
  private static final int __CARTID_ISSET_ID = 0;
112
  private static final int __ITEMID_ISSET_ID = 1;
112
  private static final int __ITEMID_ISSET_ID = 1;
113
  private static final int __QUANTITY_ISSET_ID = 2;
113
  private static final int __QUANTITY_ISSET_ID = 2;
114
  private static final int __CREATEDON_ISSET_ID = 3;
114
  private static final int __CREATEDON_ISSET_ID = 3;
115
  private static final int __UPDATEDON_ISSET_ID = 4;
115
  private static final int __UPDATEDON_ISSET_ID = 4;
116
  private static final int __ESTIMATE_ISSET_ID = 5;
116
  private static final int __ESTIMATE_ISSET_ID = 5;
117
  private BitSet __isset_bit_vector = new BitSet(6);
117
  private BitSet __isset_bit_vector = new BitSet(6);
118
 
118
 
119
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
119
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
120
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
120
    put(_Fields.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
121
        new FieldValueMetaData(TType.I64)));
121
        new FieldValueMetaData(TType.I64)));
122
    put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
122
    put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
123
        new FieldValueMetaData(TType.I64)));
123
        new FieldValueMetaData(TType.I64)));
124
    put(_Fields.QUANTITY, new FieldMetaData("quantity", TFieldRequirementType.DEFAULT, 
124
    put(_Fields.QUANTITY, new FieldMetaData("quantity", TFieldRequirementType.DEFAULT, 
125
        new FieldValueMetaData(TType.DOUBLE)));
125
        new FieldValueMetaData(TType.DOUBLE)));
Line 139... Line 139...
139
 
139
 
140
  public Line() {
140
  public Line() {
141
  }
141
  }
142
 
142
 
143
  public Line(
143
  public Line(
144
    long id,
144
    long cartId,
145
    long itemId,
145
    long itemId,
146
    double quantity,
146
    double quantity,
147
    long createdOn,
147
    long createdOn,
148
    long updatedOn,
148
    long updatedOn,
149
    LineStatus lineStatus,
149
    LineStatus lineStatus,
150
    int estimate)
150
    int estimate)
151
  {
151
  {
152
    this();
152
    this();
153
    this.id = id;
153
    this.cartId = cartId;
154
    setIdIsSet(true);
154
    setCartIdIsSet(true);
155
    this.itemId = itemId;
155
    this.itemId = itemId;
156
    setItemIdIsSet(true);
156
    setItemIdIsSet(true);
157
    this.quantity = quantity;
157
    this.quantity = quantity;
158
    setQuantityIsSet(true);
158
    setQuantityIsSet(true);
159
    this.createdOn = createdOn;
159
    this.createdOn = createdOn;
Line 169... Line 169...
169
   * Performs a deep copy on <i>other</i>.
169
   * Performs a deep copy on <i>other</i>.
170
   */
170
   */
171
  public Line(Line other) {
171
  public Line(Line other) {
172
    __isset_bit_vector.clear();
172
    __isset_bit_vector.clear();
173
    __isset_bit_vector.or(other.__isset_bit_vector);
173
    __isset_bit_vector.or(other.__isset_bit_vector);
174
    this.id = other.id;
174
    this.cartId = other.cartId;
175
    this.itemId = other.itemId;
175
    this.itemId = other.itemId;
176
    this.quantity = other.quantity;
176
    this.quantity = other.quantity;
177
    this.createdOn = other.createdOn;
177
    this.createdOn = other.createdOn;
178
    this.updatedOn = other.updatedOn;
178
    this.updatedOn = other.updatedOn;
179
    if (other.isSetLineStatus()) {
179
    if (other.isSetLineStatus()) {
Line 189... Line 189...
189
  @Deprecated
189
  @Deprecated
190
  public Line clone() {
190
  public Line clone() {
191
    return new Line(this);
191
    return new Line(this);
192
  }
192
  }
193
 
193
 
194
  public long getId() {
194
  public long getCartId() {
195
    return this.id;
195
    return this.cartId;
196
  }
196
  }
197
 
197
 
198
  public Line setId(long id) {
198
  public Line setCartId(long cartId) {
199
    this.id = id;
199
    this.cartId = cartId;
200
    setIdIsSet(true);
200
    setCartIdIsSet(true);
201
    return this;
201
    return this;
202
  }
202
  }
203
 
203
 
204
  public void unsetId() {
204
  public void unsetCartId() {
205
    __isset_bit_vector.clear(__ID_ISSET_ID);
205
    __isset_bit_vector.clear(__CARTID_ISSET_ID);
206
  }
206
  }
207
 
207
 
208
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
208
  /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
209
  public boolean isSetId() {
209
  public boolean isSetCartId() {
210
    return __isset_bit_vector.get(__ID_ISSET_ID);
210
    return __isset_bit_vector.get(__CARTID_ISSET_ID);
211
  }
211
  }
212
 
212
 
213
  public void setIdIsSet(boolean value) {
213
  public void setCartIdIsSet(boolean value) {
214
    __isset_bit_vector.set(__ID_ISSET_ID, value);
214
    __isset_bit_vector.set(__CARTID_ISSET_ID, value);
215
  }
215
  }
216
 
216
 
217
  public long getItemId() {
217
  public long getItemId() {
218
    return this.itemId;
218
    return this.itemId;
219
  }
219
  }
Line 361... Line 361...
361
    __isset_bit_vector.set(__ESTIMATE_ISSET_ID, value);
361
    __isset_bit_vector.set(__ESTIMATE_ISSET_ID, value);
362
  }
362
  }
363
 
363
 
364
  public void setFieldValue(_Fields field, Object value) {
364
  public void setFieldValue(_Fields field, Object value) {
365
    switch (field) {
365
    switch (field) {
366
    case ID:
366
    case CART_ID:
367
      if (value == null) {
367
      if (value == null) {
368
        unsetId();
368
        unsetCartId();
369
      } else {
369
      } else {
370
        setId((Long)value);
370
        setCartId((Long)value);
371
      }
371
      }
372
      break;
372
      break;
373
 
373
 
374
    case ITEM_ID:
374
    case ITEM_ID:
375
      if (value == null) {
375
      if (value == null) {
Line 426... Line 426...
426
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
426
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
427
  }
427
  }
428
 
428
 
429
  public Object getFieldValue(_Fields field) {
429
  public Object getFieldValue(_Fields field) {
430
    switch (field) {
430
    switch (field) {
431
    case ID:
431
    case CART_ID:
432
      return new Long(getId());
432
      return new Long(getCartId());
433
 
433
 
434
    case ITEM_ID:
434
    case ITEM_ID:
435
      return new Long(getItemId());
435
      return new Long(getItemId());
436
 
436
 
437
    case QUANTITY:
437
    case QUANTITY:
Line 458... Line 458...
458
  }
458
  }
459
 
459
 
460
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
460
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
461
  public boolean isSet(_Fields field) {
461
  public boolean isSet(_Fields field) {
462
    switch (field) {
462
    switch (field) {
463
    case ID:
463
    case CART_ID:
464
      return isSetId();
464
      return isSetCartId();
465
    case ITEM_ID:
465
    case ITEM_ID:
466
      return isSetItemId();
466
      return isSetItemId();
467
    case QUANTITY:
467
    case QUANTITY:
468
      return isSetQuantity();
468
      return isSetQuantity();
469
    case CREATED_ON:
469
    case CREATED_ON:
Line 493... Line 493...
493
 
493
 
494
  public boolean equals(Line that) {
494
  public boolean equals(Line that) {
495
    if (that == null)
495
    if (that == null)
496
      return false;
496
      return false;
497
 
497
 
498
    boolean this_present_id = true;
498
    boolean this_present_cartId = true;
499
    boolean that_present_id = true;
499
    boolean that_present_cartId = true;
500
    if (this_present_id || that_present_id) {
500
    if (this_present_cartId || that_present_cartId) {
501
      if (!(this_present_id && that_present_id))
501
      if (!(this_present_cartId && that_present_cartId))
502
        return false;
502
        return false;
503
      if (this.id != that.id)
503
      if (this.cartId != that.cartId)
504
        return false;
504
        return false;
505
    }
505
    }
506
 
506
 
507
    boolean this_present_itemId = true;
507
    boolean this_present_itemId = true;
508
    boolean that_present_itemId = true;
508
    boolean that_present_itemId = true;
Line 572... Line 572...
572
    }
572
    }
573
 
573
 
574
    int lastComparison = 0;
574
    int lastComparison = 0;
575
    Line typedOther = (Line)other;
575
    Line typedOther = (Line)other;
576
 
576
 
577
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
577
    lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
578
    if (lastComparison != 0) {
578
    if (lastComparison != 0) {
579
      return lastComparison;
579
      return lastComparison;
580
    }
580
    }
581
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
581
    lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
582
    if (lastComparison != 0) {
582
    if (lastComparison != 0) {
583
      return lastComparison;
583
      return lastComparison;
584
    }
584
    }
585
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
585
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
586
    if (lastComparison != 0) {
586
    if (lastComparison != 0) {
Line 645... Line 645...
645
      _Fields fieldId = _Fields.findByThriftId(field.id);
645
      _Fields fieldId = _Fields.findByThriftId(field.id);
646
      if (fieldId == null) {
646
      if (fieldId == null) {
647
        TProtocolUtil.skip(iprot, field.type);
647
        TProtocolUtil.skip(iprot, field.type);
648
      } else {
648
      } else {
649
        switch (fieldId) {
649
        switch (fieldId) {
650
          case ID:
650
          case CART_ID:
651
            if (field.type == TType.I64) {
651
            if (field.type == TType.I64) {
652
              this.id = iprot.readI64();
652
              this.cartId = iprot.readI64();
653
              setIdIsSet(true);
653
              setCartIdIsSet(true);
654
            } else { 
654
            } else { 
655
              TProtocolUtil.skip(iprot, field.type);
655
              TProtocolUtil.skip(iprot, field.type);
656
            }
656
            }
657
            break;
657
            break;
658
          case ITEM_ID:
658
          case ITEM_ID:
Line 712... Line 712...
712
 
712
 
713
  public void write(TProtocol oprot) throws TException {
713
  public void write(TProtocol oprot) throws TException {
714
    validate();
714
    validate();
715
 
715
 
716
    oprot.writeStructBegin(STRUCT_DESC);
716
    oprot.writeStructBegin(STRUCT_DESC);
717
    oprot.writeFieldBegin(ID_FIELD_DESC);
717
    oprot.writeFieldBegin(CART_ID_FIELD_DESC);
718
    oprot.writeI64(this.id);
718
    oprot.writeI64(this.cartId);
719
    oprot.writeFieldEnd();
719
    oprot.writeFieldEnd();
720
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
720
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
721
    oprot.writeI64(this.itemId);
721
    oprot.writeI64(this.itemId);
722
    oprot.writeFieldEnd();
722
    oprot.writeFieldEnd();
723
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
723
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
Line 744... Line 744...
744
  @Override
744
  @Override
745
  public String toString() {
745
  public String toString() {
746
    StringBuilder sb = new StringBuilder("Line(");
746
    StringBuilder sb = new StringBuilder("Line(");
747
    boolean first = true;
747
    boolean first = true;
748
 
748
 
749
    sb.append("id:");
749
    sb.append("cartId:");
750
    sb.append(this.id);
750
    sb.append(this.cartId);
751
    first = false;
751
    first = false;
752
    if (!first) sb.append(", ");
752
    if (!first) sb.append(", ");
753
    sb.append("itemId:");
753
    sb.append("itemId:");
754
    sb.append(this.itemId);
754
    sb.append(this.itemId);
755
    first = false;
755
    first = false;