@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;
  }