@Test public void testParsingHostAndPort() { AddressHolder addressHolder = AddressUtil.getAddressHolder("[fe80::62c5:*:fe05:480a%en0]:8080"); Assert.assertEquals("fe80::62c5:*:fe05:480a", addressHolder.address); Assert.assertEquals(8080, addressHolder.port); Assert.assertEquals("en0", addressHolder.scopeId); addressHolder = AddressUtil.getAddressHolder("[::ffff:192.0.2.128]:5700"); Assert.assertEquals("::ffff:192.0.2.128", addressHolder.address); Assert.assertEquals(5700, addressHolder.port); addressHolder = AddressUtil.getAddressHolder("192.168.1.1:5700"); Assert.assertEquals("192.168.1.1", addressHolder.address); Assert.assertEquals(5700, addressHolder.port); addressHolder = AddressUtil.getAddressHolder("hazelcast.com:80"); Assert.assertEquals("hazelcast.com", addressHolder.address); Assert.assertEquals(80, addressHolder.port); }
public static AddressHolder getAddressHolder(String address) { return getAddressHolder(address, -1); }
AddressUtil { public static AddressHolder getAddressHolder(String address) { return getAddressHolder(address, -1); } }
AddressUtil { public static AddressHolder getAddressHolder(String address) { return getAddressHolder(address, -1); } private  AddressUtil(); }
AddressUtil { public static AddressHolder getAddressHolder(String address) { return getAddressHolder(address, -1); } private  AddressUtil(); static boolean matchAnyInterface(final String address, final Collection<String> interfaces); static boolean matchInterface(final String address, final String interfaceMask); static AddressHolder getAddressHolder(String address); static AddressHolder getAddressHolder(final String address, int defaultPort); static boolean isIpAddress(String address); static InetAddress fixScopeIdAndGetInetAddress(final InetAddress inetAddress); static Inet6Address getInetAddressFor(final Inet6Address inetAddress, String scope); static Collection<Inet6Address> getPossibleInetAddressesFor(final Inet6Address inet6Address); static Collection<String> getMatchingIpv4Addresses(final AddressMatcher addressMatcher); static AddressMatcher getAddressMatcher(String address); }
AddressUtil { public static AddressHolder getAddressHolder(String address) { return getAddressHolder(address, -1); } private  AddressUtil(); static boolean matchAnyInterface(final String address, final Collection<String> interfaces); static boolean matchInterface(final String address, final String interfaceMask); static AddressHolder getAddressHolder(String address); static AddressHolder getAddressHolder(final String address, int defaultPort); static boolean isIpAddress(String address); static InetAddress fixScopeIdAndGetInetAddress(final InetAddress inetAddress); static Inet6Address getInetAddressFor(final Inet6Address inetAddress, String scope); static Collection<Inet6Address> getPossibleInetAddressesFor(final Inet6Address inet6Address); static Collection<String> getMatchingIpv4Addresses(final AddressMatcher addressMatcher); static AddressMatcher getAddressMatcher(String address);  }