@Override public void write(org.apache.thrift.protocol.TProtocol prot, WorkerNetAddress struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetHost()) { optionals.set(0); } if (struct.isSetRpcPort()) { optionals.set(1); } if (struct.isSetDataPort()) { optionals.set(2); } if (struct.isSetWebPort()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetHost()) { oprot.writeString(struct.host); } if (struct.isSetRpcPort()) { oprot.writeI32(struct.rpcPort); } if (struct.isSetDataPort()) { oprot.writeI32(struct.dataPort); } if (struct.isSetWebPort()) { oprot.writeI32(struct.webPort); } }
public boolean equals(WorkerNetAddress that) { if (that == null) return false; boolean this_present_host = true && this.isSetHost(); boolean that_present_host = true && that.isSetHost(); if (this_present_host || that_present_host) { if (!(this_present_host && that_present_host)) return false; if (!this.host.equals(that.host)) return false; } boolean this_present_rpcPort = true; boolean that_present_rpcPort = true; if (this_present_rpcPort || that_present_rpcPort) { if (!(this_present_rpcPort && that_present_rpcPort)) return false; if (this.rpcPort != that.rpcPort) return false; } boolean this_present_dataPort = true; boolean that_present_dataPort = true; if (this_present_dataPort || that_present_dataPort) { if (!(this_present_dataPort && that_present_dataPort)) return false; if (this.dataPort != that.dataPort) return false; } boolean this_present_webPort = true; boolean that_present_webPort = true; if (this_present_webPort || that_present_webPort) { if (!(this_present_webPort && that_present_webPort)) return false; if (this.webPort != that.webPort) return false; } return true; }
/** Performs a deep copy on <i>other</i>. */ public WorkerNetAddress(WorkerNetAddress other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetHost()) { this.host = other.host; } this.rpcPort = other.rpcPort; this.dataPort = other.dataPort; this.webPort = other.webPort; }
@Override public int compareTo(WorkerNetAddress other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetHost()).compareTo(other.isSetHost()); if (lastComparison != 0) { return lastComparison; } if (isSetHost()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRpcPort()).compareTo(other.isSetRpcPort()); if (lastComparison != 0) { return lastComparison; } if (isSetRpcPort()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rpcPort, other.rpcPort); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDataPort()).compareTo(other.isSetDataPort()); if (lastComparison != 0) { return lastComparison; } if (isSetDataPort()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataPort, other.dataPort); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetWebPort()).compareTo(other.isSetWebPort()); if (lastComparison != 0) { return lastComparison; } if (isSetWebPort()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.webPort, other.webPort); if (lastComparison != 0) { return lastComparison; } } return 0; }