public void write(org.apache.thrift.protocol.TProtocol oprot, ODSRateOfChangeKeyInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } oprot.writeFieldBegin(UNIX_TIME_FIELD_DESC); oprot.writeI64(struct.unixTime); oprot.writeFieldEnd(); oprot.writeFieldBegin(ALLOWABLE_TIME_DIFF_FIELD_DESC); oprot.writeI64(struct.allowable_time_diff); oprot.writeFieldEnd(); oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeI64(struct.value); oprot.writeFieldEnd(); oprot.writeFieldBegin(MIN_RATE_FIELD_DESC); oprot.writeI64(struct.min_rate); oprot.writeFieldEnd(); oprot.writeFieldBegin(MAX_RATE_FIELD_DESC); oprot.writeI64(struct.max_rate); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); }
/** Performs a deep copy on <i>other</i>. */ public ODSRateOfChangeKeyInfo(ODSRateOfChangeKeyInfo other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetKey()) { this.key = other.key; } this.unixTime = other.unixTime; this.allowable_time_diff = other.allowable_time_diff; this.value = other.value; this.min_rate = other.min_rate; this.max_rate = other.max_rate; }
public boolean equals(ODSRateOfChangeKeyInfo that) { if (that == null) return false; boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_unixTime = true; boolean that_present_unixTime = true; if (this_present_unixTime || that_present_unixTime) { if (!(this_present_unixTime && that_present_unixTime)) return false; if (this.unixTime != that.unixTime) return false; } boolean this_present_allowable_time_diff = true; boolean that_present_allowable_time_diff = true; if (this_present_allowable_time_diff || that_present_allowable_time_diff) { if (!(this_present_allowable_time_diff && that_present_allowable_time_diff)) return false; if (this.allowable_time_diff != that.allowable_time_diff) return false; } boolean this_present_value = true; boolean that_present_value = true; if (this_present_value || that_present_value) { if (!(this_present_value && that_present_value)) return false; if (this.value != that.value) return false; } boolean this_present_min_rate = true; boolean that_present_min_rate = true; if (this_present_min_rate || that_present_min_rate) { if (!(this_present_min_rate && that_present_min_rate)) return false; if (this.min_rate != that.min_rate) return false; } boolean this_present_max_rate = true; boolean that_present_max_rate = true; if (this_present_max_rate || that_present_max_rate) { if (!(this_present_max_rate && that_present_max_rate)) return false; if (this.max_rate != that.max_rate) return false; } return true; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ODSRateOfChangeKeyInfo struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } if (incoming.get(1)) { struct.unixTime = iprot.readI64(); struct.setUnixTimeIsSet(true); } if (incoming.get(2)) { struct.allowable_time_diff = iprot.readI64(); struct.setAllowable_time_diffIsSet(true); } if (incoming.get(3)) { struct.value = iprot.readI64(); struct.setValueIsSet(true); } if (incoming.get(4)) { struct.min_rate = iprot.readI64(); struct.setMin_rateIsSet(true); } if (incoming.get(5)) { struct.max_rate = iprot.readI64(); struct.setMax_rateIsSet(true); } }
@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); } }
public void read(org.apache.thrift.protocol.TProtocol iprot, ODSRateOfChangeKeyInfo 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: // KEY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // UNIX_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.unixTime = iprot.readI64(); struct.setUnixTimeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // ALLOWABLE_TIME_DIFF if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.allowable_time_diff = iprot.readI64(); struct.setAllowable_time_diffIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // VALUE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.value = iprot.readI64(); struct.setValueIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // MIN_RATE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.min_rate = iprot.readI64(); struct.setMin_rateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // MAX_RATE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.max_rate = iprot.readI64(); struct.setMax_rateIsSet(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 struct.validate(); }
@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; }