@Test public void testToStringException() { assertEquals( "InetPoint { port = 5 (0x5); address = 00000000000000000000000000000000 (IPv6, null); forward = false }", new InetPoint(new byte[16], 5).toString()); }
@Override public String toString() { String host = "?"; try { host = InetAddress.getByAddress(address).getHostAddress(); } catch (UnknownHostException e) { logger.error("Error", e); } return String.format("%s { port = %d (0x%x); address = %s (%s, %s); forward = %s }", getClass().getSimpleName(), port, port, CodecUtils.toHex(address), address.length == 4 ? "IPv4" : "IPv6", host, forward ? "true" : "false" ); }
InetPoint { @Override public String toString() { String host = "?"; try { host = InetAddress.getByAddress(address).getHostAddress(); } catch (UnknownHostException e) { logger.error("Error", e); } return String.format("%s { port = %d (0x%x); address = %s (%s, %s); forward = %s }", getClass().getSimpleName(), port, port, CodecUtils.toHex(address), address.length == 4 ? "IPv4" : "IPv6", host, forward ? "true" : "false" ); } }
InetPoint { @Override public String toString() { String host = "?"; try { host = InetAddress.getByAddress(address).getHostAddress(); } catch (UnknownHostException e) { logger.error("Error", e); } return String.format("%s { port = %d (0x%x); address = %s (%s, %s); forward = %s }", getClass().getSimpleName(), port, port, CodecUtils.toHex(address), address.length == 4 ? "IPv4" : "IPv6", host, forward ? "true" : "false" ); } InetPoint(String host, int port, boolean forward);  InetPoint(byte[] address, int port);  InetPoint(byte[] address, int port, boolean forward ); }
InetPoint { @Override public String toString() { String host = "?"; try { host = InetAddress.getByAddress(address).getHostAddress(); } catch (UnknownHostException e) { logger.error("Error", e); } return String.format("%s { port = %d (0x%x); address = %s (%s, %s); forward = %s }", getClass().getSimpleName(), port, port, CodecUtils.toHex(address), address.length == 4 ? "IPv4" : "IPv6", host, forward ? "true" : "false" ); } InetPoint(String host, int port, boolean forward);  InetPoint(byte[] address, int port);  InetPoint(byte[] address, int port, boolean forward ); InetAddress getInetAddress(); boolean isIPv6Address(); @Override String toString(); }
InetPoint { @Override public String toString() { String host = "?"; try { host = InetAddress.getByAddress(address).getHostAddress(); } catch (UnknownHostException e) { logger.error("Error", e); } return String.format("%s { port = %d (0x%x); address = %s (%s, %s); forward = %s }", getClass().getSimpleName(), port, port, CodecUtils.toHex(address), address.length == 4 ? "IPv4" : "IPv6", host, forward ? "true" : "false" ); } InetPoint(String host, int port, boolean forward);  InetPoint(byte[] address, int port);  InetPoint(byte[] address, int port, boolean forward ); InetAddress getInetAddress(); boolean isIPv6Address(); @Override String toString(); final byte[] address; final int port; final boolean forward; }