@Test public void getAddresses() throws Exception { String addressesString = "168.61.2.23:2181,168.61.2.24:2181,168.61.2.25:2181"; List<InetSocketAddress> result = ClusterAddressUtils.getAddresses(addressesString); Assert.assertEquals("168.61.2.23", result.get(0).getHostName()); Assert.assertEquals(2181, result.get(1).getPort()); Assert.assertEquals("168.61.2.25", result.get(2).getHostName()); }
public static List<InetSocketAddress> getAddresses(String addressesString) { if (StringUtils.isEmpty(addressesString)) { return null; } addressesString = addressesString.trim(); List<String> addressList = Arrays.asList(addressesString.split("\\s*,\\s*")); return getAddressesByList(addressList); }
ClusterAddressUtils { public static List<InetSocketAddress> getAddresses(String addressesString) { if (StringUtils.isEmpty(addressesString)) { return null; } addressesString = addressesString.trim(); List<String> addressList = Arrays.asList(addressesString.split("\\s*,\\s*")); return getAddressesByList(addressList); } }
ClusterAddressUtils { public static List<InetSocketAddress> getAddresses(String addressesString) { if (StringUtils.isEmpty(addressesString)) { return null; } addressesString = addressesString.trim(); List<String> addressList = Arrays.asList(addressesString.split("\\s*,\\s*")); return getAddressesByList(addressList); }  }
ClusterAddressUtils { public static List<InetSocketAddress> getAddresses(String addressesString) { if (StringUtils.isEmpty(addressesString)) { return null; } addressesString = addressesString.trim(); List<String> addressList = Arrays.asList(addressesString.split("\\s*,\\s*")); return getAddressesByList(addressList); }  static List<InetSocketAddress> getAddresses(String addressesString); }
ClusterAddressUtils { public static List<InetSocketAddress> getAddresses(String addressesString) { if (StringUtils.isEmpty(addressesString)) { return null; } addressesString = addressesString.trim(); List<String> addressList = Arrays.asList(addressesString.split("\\s*,\\s*")); return getAddressesByList(addressList); }  static List<InetSocketAddress> getAddresses(String addressesString);  }