@Test public void isValidIp() throws Exception { assertTrue(OtherUtilities.isValidIp("1.1.1.1")); assertTrue(OtherUtilities.isValidIp("255.255.255.255")); assertTrue(OtherUtilities.isValidIp("192.168.1.1")); assertTrue(OtherUtilities.isValidIp("::1")); assertTrue(OtherUtilities.isValidIp("2001:0db8:85a3:0000:0000:8a2e:0370:7334")); assertFalse(OtherUtilities.isValidIp(".1.1.1")); assertFalse(OtherUtilities.isValidIp("2001:0db8:85a3:0000:0000:8a2e:0370:73349999999")); assertFalse(OtherUtilities.isValidIp("2001:0db8:80123---5a3:0000:0000:8a2e:0370:7334")); }
public static boolean isValidIp(@NotNull final String ipStr) { return ipPattern.matcher(StringUtils.strip(ipStr)).matches(); }
OtherUtilities { public static boolean isValidIp(@NotNull final String ipStr) { return ipPattern.matcher(StringUtils.strip(ipStr)).matches(); } }
OtherUtilities { public static boolean isValidIp(@NotNull final String ipStr) { return ipPattern.matcher(StringUtils.strip(ipStr)).matches(); } private  OtherUtilities(); }
OtherUtilities { public static boolean isValidIp(@NotNull final String ipStr) { return ipPattern.matcher(StringUtils.strip(ipStr)).matches(); } private  OtherUtilities(); static boolean isValidEmail(@NotNull final String emailStr); static boolean isValidIpPort(@NotNull final String portStr); static boolean isValidIp(@NotNull final String ipStr); @NotNull static String changeNewLineFromWindowsToUnix(@NotNull final String string); @NotNull static String changeNewLineFromUnixToWindows(@NotNull final String string); }
OtherUtilities { public static boolean isValidIp(@NotNull final String ipStr) { return ipPattern.matcher(StringUtils.strip(ipStr)).matches(); } private  OtherUtilities(); static boolean isValidEmail(@NotNull final String emailStr); static boolean isValidIpPort(@NotNull final String portStr); static boolean isValidIp(@NotNull final String ipStr); @NotNull static String changeNewLineFromWindowsToUnix(@NotNull final String string); @NotNull static String changeNewLineFromUnixToWindows(@NotNull final String string);  }