@Override public HostAddress deepCopy() { return new HostAddress(this); }
public static HostAddress getHostAddress(final String hostNameAndAddress, final int port) { final int slashIndex = hostNameAndAddress.indexOf('/'); if (slashIndex > 0) { final String hostName = hostNameAndAddress.substring(0, slashIndex); final String ipAddress = hostNameAndAddress.substring(slashIndex + 1); if (ipAddress.length() > 0 && !hostName.equals(ipAddress)) { return new HostAddress(hostName, port).setIpAddress(ipAddress); } else { return new HostAddress(hostName, port); } } else if (slashIndex == 0) { return new HostAddress(hostNameAndAddress.substring(1), port); } else { return new HostAddress(hostNameAndAddress, port); } }
/** * Performs a deep copy on <i>other</i>. */ public getAllServersWithPreferredServer_result(getAllServersWithPreferredServer_result other) { if (other.isSetSuccess()) { List<HostAddress> __this__success = new ArrayList<HostAddress>(other.success.size()); for (HostAddress other_element : other.success) { __this__success.add(new HostAddress(other_element)); } this.success = __this__success; } if (other.isSetError()) { this.error = new SnappyException(other.error); } }
/** * Performs a deep copy on <i>other</i>. */ public getPreferredServer_args(getPreferredServer_args other) { if (other.isSetServerTypes()) { Set<ServerType> __this__serverTypes = new HashSet<ServerType>(other.serverTypes.size()); for (ServerType other_element : other.serverTypes) { __this__serverTypes.add(other_element); } this.serverTypes = __this__serverTypes; } if (other.isSetServerGroups()) { Set<String> __this__serverGroups = new HashSet<String>(other.serverGroups); this.serverGroups = __this__serverGroups; } if (other.isSetFailedServers()) { Set<HostAddress> __this__failedServers = new HashSet<HostAddress>(other.failedServers.size()); for (HostAddress other_element : other.failedServers) { __this__failedServers.add(new HostAddress(other_element)); } this.failedServers = __this__failedServers; } }
/** * Performs a deep copy on <i>other</i>. */ public getAllServersWithPreferredServer_args(getAllServersWithPreferredServer_args other) { if (other.isSetServerTypes()) { Set<ServerType> __this__serverTypes = new HashSet<ServerType>(other.serverTypes.size()); for (ServerType other_element : other.serverTypes) { __this__serverTypes.add(other_element); } this.serverTypes = __this__serverTypes; } if (other.isSetServerGroups()) { Set<String> __this__serverGroups = new HashSet<String>(other.serverGroups); this.serverGroups = __this__serverGroups; } if (other.isSetFailedServers()) { Set<HostAddress> __this__failedServers = new HashSet<HostAddress>(other.failedServers.size()); for (HostAddress other_element : other.failedServers) { __this__failedServers.add(new HostAddress(other_element)); } this.failedServers = __this__failedServers; } }
/** * Performs a deep copy on <i>other</i>. */ public getPreferredServer_result(getPreferredServer_result other) { if (other.isSetSuccess()) { this.success = new HostAddress(other.success); } if (other.isSetError()) { this.error = new SnappyException(other.error); } }
case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new HostAddress(); struct.success.read(iprot); struct.setSuccessIsSet(true);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, getPreferredServer_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new HostAddress(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.error = new SnappyException(); struct.error.read(iprot); struct.setErrorIsSet(true); } } }
for (int _i320 = 0; _i320 < _list318.size; ++_i320) _elem319 = new HostAddress(); _elem319.read(iprot); struct.success.add(_elem319);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, getAllServersWithPreferredServer_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list323 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<HostAddress>(_list323.size); HostAddress _elem324; for (int _i325 = 0; _i325 < _list323.size; ++_i325) { _elem324 = new HostAddress(); _elem324.read(iprot); struct.success.add(_elem324); } } struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.error = new SnappyException(); struct.error.read(iprot); struct.setErrorIsSet(true); } } }
for (int _i278 = 0; _i278 < _set276.size; ++_i278) _elem277 = new HostAddress(); _elem277.read(iprot); struct.failedServers.add(_elem277);
for (int _i302 = 0; _i302 < _set300.size; ++_i302) _elem301 = new HostAddress(); _elem301.read(iprot); struct.failedServers.add(_elem301);
this.source = new HostAddress(other.source);
for (int _i293 = 0; _i293 < _set291.size; ++_i293) _elem292 = new HostAddress(); _elem292.read(iprot); struct.failedServers.add(_elem292);
for (int _i317 = 0; _i317 < _set315.size; ++_i317) _elem316 = new HostAddress(); _elem316.read(iprot); struct.failedServers.add(_elem316);
case 7: // SOURCE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.source = new HostAddress(); struct.source.read(iprot); struct.setSourceIsSet(true);
struct.source = new HostAddress(); struct.source.read(iprot); struct.setSourceIsSet(true);