@Override public int compareTo(TransferMessage other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetOrig_branchId()).compareTo(other.isSetOrig_branchId()); if (lastComparison != 0) { return lastComparison; } if (isSetOrig_branchId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orig_branchId, other.orig_branchId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetAmount()).compareTo(other.isSetAmount()); if (lastComparison != 0) { return lastComparison; } if (isSetAmount()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, other.amount); if (lastComparison != 0) { return lastComparison; } } return 0; }
/** Performs a deep copy on <i>other</i>. */ public TransferMessage(TransferMessage other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetOrig_branchId()) { this.orig_branchId = new BranchID(other.orig_branchId); } this.amount = other.amount; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TransferMessage struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetOrig_branchId()) { optionals.set(0); } if (struct.isSetAmount()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetOrig_branchId()) { struct.orig_branchId.write(oprot); } if (struct.isSetAmount()) { oprot.writeI32(struct.amount); } }
public boolean equals(TransferMessage that) { if (that == null) return false; boolean this_present_orig_branchId = true && this.isSetOrig_branchId(); boolean that_present_orig_branchId = true && that.isSetOrig_branchId(); if (this_present_orig_branchId || that_present_orig_branchId) { if (!(this_present_orig_branchId && that_present_orig_branchId)) return false; if (!this.orig_branchId.equals(that.orig_branchId)) return false; } boolean this_present_amount = true; boolean that_present_amount = true; if (this_present_amount || that_present_amount) { if (!(this_present_amount && that_present_amount)) return false; if (this.amount != that.amount) return false; } return true; }