@Override
 public void read(org.apache.thrift.protocol.TProtocol prot, CardStatistics struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.iTotalPaymentsLastMonth = iprot.readDouble();
   struct.setITotalPaymentsLastMonthIsSet(true);
   struct.iTotalPaymentsLastThreeMonths = iprot.readDouble();
   struct.setITotalPaymentsLastThreeMonthsIsSet(true);
 }
  @Override
  public int compareTo(CardStatistics other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison =
        Boolean.valueOf(isSetITotalPaymentsLastMonth())
            .compareTo(other.isSetITotalPaymentsLastMonth());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetITotalPaymentsLastMonth()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.iTotalPaymentsLastMonth, other.iTotalPaymentsLastMonth);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetITotalPaymentsLastThreeMonths())
            .compareTo(other.isSetITotalPaymentsLastThreeMonths());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetITotalPaymentsLastThreeMonths()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.iTotalPaymentsLastThreeMonths, other.iTotalPaymentsLastThreeMonths);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
    public void write(org.apache.thrift.protocol.TProtocol oprot, CardStatistics struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(I_TOTAL_PAYMENTS_LAST_MONTH_FIELD_DESC);
      oprot.writeDouble(struct.iTotalPaymentsLastMonth);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(I_TOTAL_PAYMENTS_LAST_THREE_MONTHS_FIELD_DESC);
      oprot.writeDouble(struct.iTotalPaymentsLastThreeMonths);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    public void read(org.apache.thrift.protocol.TProtocol iprot, CardStatistics struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // I_TOTAL_PAYMENTS_LAST_MONTH
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.iTotalPaymentsLastMonth = iprot.readDouble();
              struct.setITotalPaymentsLastMonthIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // I_TOTAL_PAYMENTS_LAST_THREE_MONTHS
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.iTotalPaymentsLastThreeMonths = iprot.readDouble();
              struct.setITotalPaymentsLastThreeMonthsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      if (!struct.isSetITotalPaymentsLastMonth()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'iTotalPaymentsLastMonth' was not found in serialized data! Struct: "
                + toString());
      }
      if (!struct.isSetITotalPaymentsLastThreeMonths()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'iTotalPaymentsLastThreeMonths' was not found in serialized data! Struct: "
                + toString());
      }
      struct.validate();
    }