@Override
 public void write(org.apache.thrift.protocol.TProtocol prot, ODSRateOfChangeKeyInfo struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetKey()) {
     optionals.set(0);
   }
   if (struct.isSetUnixTime()) {
     optionals.set(1);
   }
   if (struct.isSetAllowable_time_diff()) {
     optionals.set(2);
   }
   if (struct.isSetValue()) {
     optionals.set(3);
   }
   if (struct.isSetMin_rate()) {
     optionals.set(4);
   }
   if (struct.isSetMax_rate()) {
     optionals.set(5);
   }
   oprot.writeBitSet(optionals, 6);
   if (struct.isSetKey()) {
     oprot.writeString(struct.key);
   }
   if (struct.isSetUnixTime()) {
     oprot.writeI64(struct.unixTime);
   }
   if (struct.isSetAllowable_time_diff()) {
     oprot.writeI64(struct.allowable_time_diff);
   }
   if (struct.isSetValue()) {
     oprot.writeI64(struct.value);
   }
   if (struct.isSetMin_rate()) {
     oprot.writeI64(struct.min_rate);
   }
   if (struct.isSetMax_rate()) {
     oprot.writeI64(struct.max_rate);
   }
 }
  @Override
  public int compareTo(ODSRateOfChangeKeyInfo other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetKey()).compareTo(other.isSetKey());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetKey()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUnixTime()).compareTo(other.isSetUnixTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUnixTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unixTime, other.unixTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetAllowable_time_diff()).compareTo(other.isSetAllowable_time_diff());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAllowable_time_diff()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.allowable_time_diff, other.allowable_time_diff);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetValue()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMin_rate()).compareTo(other.isSetMin_rate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMin_rate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.min_rate, other.min_rate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMax_rate()).compareTo(other.isSetMax_rate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMax_rate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_rate, other.max_rate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }