@Override public void write(org.apache.thrift.protocol.TProtocol prot, BlockInfo struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetBlockId()) { optionals.set(0); } if (struct.isSetLength()) { optionals.set(1); } if (struct.isSetLocations()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetBlockId()) { oprot.writeI64(struct.blockId); } if (struct.isSetLength()) { oprot.writeI64(struct.length); } if (struct.isSetLocations()) { { oprot.writeI32(struct.locations.size()); for (BlockLocation _iter4 : struct.locations) { _iter4.write(oprot); } } } }
public boolean equals(BlockInfo that) { if (that == null) return false; boolean this_present_blockId = true; boolean that_present_blockId = true; if (this_present_blockId || that_present_blockId) { if (!(this_present_blockId && that_present_blockId)) return false; if (this.blockId != that.blockId) return false; } boolean this_present_length = true; boolean that_present_length = true; if (this_present_length || that_present_length) { if (!(this_present_length && that_present_length)) return false; if (this.length != that.length) return false; } boolean this_present_locations = true && this.isSetLocations(); boolean that_present_locations = true && that.isSetLocations(); if (this_present_locations || that_present_locations) { if (!(this_present_locations && that_present_locations)) return false; if (!this.locations.equals(that.locations)) return false; } return true; }
/** Performs a deep copy on <i>other</i>. */ public BlockInfo(BlockInfo other) { __isset_bitfield = other.__isset_bitfield; this.blockId = other.blockId; this.length = other.length; if (other.isSetLocations()) { List<BlockLocation> __this__locations = new ArrayList<BlockLocation>(other.locations.size()); for (BlockLocation other_element : other.locations) { __this__locations.add(other_element); } this.locations = __this__locations; } }
@Override public int compareTo(BlockInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId()); if (lastComparison != 0) { return lastComparison; } if (isSetBlockId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLength()).compareTo(other.isSetLength()); if (lastComparison != 0) { return lastComparison; } if (isSetLength()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.length, other.length); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLocations()).compareTo(other.isSetLocations()); if (lastComparison != 0) { return lastComparison; } if (isSetLocations()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.locations, other.locations); if (lastComparison != 0) { return lastComparison; } } return 0; }