@Override public int compareTo(PersistFile other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetBlockIds()).compareTo(other.isSetBlockIds()); if (lastComparison != 0) { return lastComparison; } if (isSetBlockIds()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockIds, other.blockIds); if (lastComparison != 0) { return lastComparison; } } return 0; }
/** Performs a deep copy on <i>other</i>. */ public PersistFile(PersistFile other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetBlockIds()) { List<Long> __this__blockIds = new ArrayList<Long>(other.blockIds); this.blockIds = __this__blockIds; } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, PersistFile struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetBlockIds()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetFileId()) { oprot.writeI64(struct.fileId); } if (struct.isSetBlockIds()) { { oprot.writeI32(struct.blockIds.size()); for (long _iter20 : struct.blockIds) { oprot.writeI64(_iter20); } } } }
public boolean equals(PersistFile that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_blockIds = true && this.isSetBlockIds(); boolean that_present_blockIds = true && that.isSetBlockIds(); if (this_present_blockIds || that_present_blockIds) { if (!(this_present_blockIds && that_present_blockIds)) return false; if (!this.blockIds.equals(that.blockIds)) return false; } return true; }