/** * Performs a deep copy on <i>other</i>. */ public HostAddress(HostAddress other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetHostName()) { this.hostName = other.hostName; } this.port = other.port; if (other.isSetIpAddress()) { this.ipAddress = other.ipAddress; } if (other.isSetServerType()) { this.serverType = other.serverType; } }
/** * 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 HOST_NAME: return isSetHostName(); case PORT: return isSetPort(); case IP_ADDRESS: return isSetIpAddress(); case SERVER_TYPE: return isSetServerType(); } throw new IllegalStateException(); }
public void write(org.apache.thrift.protocol.TProtocol oprot, HostAddress struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.hostName != null) { oprot.writeFieldBegin(HOST_NAME_FIELD_DESC); oprot.writeString(struct.hostName); oprot.writeFieldEnd(); } oprot.writeFieldBegin(PORT_FIELD_DESC); oprot.writeI32(struct.port); oprot.writeFieldEnd(); if (struct.ipAddress != null) { if (struct.isSetIpAddress()) { oprot.writeFieldBegin(IP_ADDRESS_FIELD_DESC); oprot.writeString(struct.ipAddress); oprot.writeFieldEnd(); } } if (struct.serverType != null) { if (struct.isSetServerType()) { oprot.writeFieldBegin(SERVER_TYPE_FIELD_DESC); oprot.writeI32(struct.serverType.getValue()); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, HostAddress struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol)prot; oprot.writeString(struct.hostName); oprot.writeI32(struct.port); BitSet optionals = new BitSet(); if (struct.isSetIpAddress()) { optionals.set(0); } if (struct.isSetServerType()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetIpAddress()) { oprot.writeString(struct.ipAddress); } if (struct.isSetServerType()) { oprot.writeI32(struct.serverType.getValue()); } }