@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_nodeId = true && (isSetNodeId()); list.add(present_nodeId); if (present_nodeId) list.add(nodeId); boolean present_address = true && (isSetAddress()); list.add(present_address); if (present_address) list.add(address); return list.hashCode(); }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case NODE_ID: return isSetNodeId(); case ADDRESS: return isSetAddress(); } throw new IllegalStateException(); }
@Override public int compareTo(ThriftEntityClusterAddress other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetNodeId()).compareTo(other.isSetNodeId()); if (lastComparison != 0) { return lastComparison; } if (isSetNodeId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nodeId, other.nodeId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetAddress()).compareTo(other.isSetAddress()); if (lastComparison != 0) { return lastComparison; } if (isSetAddress()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, other.address); if (lastComparison != 0) { return lastComparison; } } return 0; }
/** * Performs a deep copy on <i>other</i>. */ public ThriftEntityClusterAddress(ThriftEntityClusterAddress other) { if (other.isSetNodeId()) { this.nodeId = other.nodeId; } if (other.isSetAddress()) { this.address = new ThriftEntityAddress(other.address); } }
public boolean equals(ThriftEntityClusterAddress that) { if (that == null) return false; boolean this_present_nodeId = true && this.isSetNodeId(); boolean that_present_nodeId = true && that.isSetNodeId(); if (this_present_nodeId || that_present_nodeId) { if (!(this_present_nodeId && that_present_nodeId)) return false; if (!this.nodeId.equals(that.nodeId)) return false; } boolean this_present_address = true && this.isSetAddress(); boolean that_present_address = true && that.isSetAddress(); if (this_present_address || that_present_address) { if (!(this_present_address && that_present_address)) return false; if (!this.address.equals(that.address)) return false; } return true; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, ThriftEntityClusterAddress struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetNodeId()) { optionals.set(0); } if (struct.isSetAddress()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetNodeId()) { oprot.writeString(struct.nodeId); } if (struct.isSetAddress()) { struct.address.write(oprot); } }