@Test public final void testCreateIpPrefix_emptyString() { thrown.expect(IllegalArgumentException.class); Utils.createIpPrefix(""); }
public static IpPrefix createIpPrefix(String cidr) { checkArgument(!Strings.isNullOrEmpty(cidr), "Cannot be null or empty."); String[] ipAndPrefix = cidr.split("/"); checkArgument(ipAndPrefix.length == 2, "Bad format."); InetAddress ip = InetAddresses.forString(ipAndPrefix[0]); if (ip instanceof Inet4Address) { return new IpPrefix(new Ipv4Prefix(cidr)); } return new IpPrefix(new Ipv6Prefix(cidr)); }
Utils { public static IpPrefix createIpPrefix(String cidr) { checkArgument(!Strings.isNullOrEmpty(cidr), "Cannot be null or empty."); String[] ipAndPrefix = cidr.split("/"); checkArgument(ipAndPrefix.length == 2, "Bad format."); InetAddress ip = InetAddresses.forString(ipAndPrefix[0]); if (ip instanceof Inet4Address) { return new IpPrefix(new Ipv4Prefix(cidr)); } return new IpPrefix(new Ipv6Prefix(cidr)); } }
Utils { public static IpPrefix createIpPrefix(String cidr) { checkArgument(!Strings.isNullOrEmpty(cidr), "Cannot be null or empty."); String[] ipAndPrefix = cidr.split("/"); checkArgument(ipAndPrefix.length == 2, "Bad format."); InetAddress ip = InetAddresses.forString(ipAndPrefix[0]); if (ip instanceof Inet4Address) { return new IpPrefix(new Ipv4Prefix(cidr)); } return new IpPrefix(new Ipv6Prefix(cidr)); } private  Utils(); }
Utils { public static IpPrefix createIpPrefix(String cidr) { checkArgument(!Strings.isNullOrEmpty(cidr), "Cannot be null or empty."); String[] ipAndPrefix = cidr.split("/"); checkArgument(ipAndPrefix.length == 2, "Bad format."); InetAddress ip = InetAddresses.forString(ipAndPrefix[0]); if (ip instanceof Inet4Address) { return new IpPrefix(new Ipv4Prefix(cidr)); } return new IpPrefix(new Ipv6Prefix(cidr)); } private  Utils(); static IpPrefix createIpPrefix(String cidr); static IpAddress createIpAddress(String ipAddress); static String getStringIpPrefix(IpPrefix ipPrefix); static String getStringIpAddress(IpAddress ipAddress); static String normalizeUuid(String string); static void syncNat(ReadWriteTransaction rwTx, Floatingip oldFloatingIp, Floatingip newFloatingIp); static void removeNat(ReadWriteTransaction rwTx, Floatingip removedFloatingIp); }
Utils { public static IpPrefix createIpPrefix(String cidr) { checkArgument(!Strings.isNullOrEmpty(cidr), "Cannot be null or empty."); String[] ipAndPrefix = cidr.split("/"); checkArgument(ipAndPrefix.length == 2, "Bad format."); InetAddress ip = InetAddresses.forString(ipAndPrefix[0]); if (ip instanceof Inet4Address) { return new IpPrefix(new Ipv4Prefix(cidr)); } return new IpPrefix(new Ipv6Prefix(cidr)); } private  Utils(); static IpPrefix createIpPrefix(String cidr); static IpAddress createIpAddress(String ipAddress); static String getStringIpPrefix(IpPrefix ipPrefix); static String getStringIpAddress(IpAddress ipAddress); static String normalizeUuid(String string); static void syncNat(ReadWriteTransaction rwTx, Floatingip oldFloatingIp, Floatingip newFloatingIp); static void removeNat(ReadWriteTransaction rwTx, Floatingip removedFloatingIp);  }