@Test public void testGetPrefixLength() throws Exception { assertEquals(32, IpPrefixConv.getPrefixLength(ipPrefix1)); assertEquals(16, IpPrefixConv.getPrefixLength(ipPrefix2)); assertEquals(128, IpPrefixConv.getPrefixLength(ipPrefix3)); assertEquals(32, IpPrefixConv.getPrefixLength(ipPrefix4)); }
public static int getPrefixLength(IpPrefix ipPrefix) { String _ipPrefix = ipPrefix.stringValue(); int i = _ipPrefix.lastIndexOf('/'); if (i == -1) { return i; } return Integer.parseInt(_ipPrefix.substring(i + 1)); }
IpPrefixConv { public static int getPrefixLength(IpPrefix ipPrefix) { String _ipPrefix = ipPrefix.stringValue(); int i = _ipPrefix.lastIndexOf('/'); if (i == -1) { return i; } return Integer.parseInt(_ipPrefix.substring(i + 1)); } }
IpPrefixConv { public static int getPrefixLength(IpPrefix ipPrefix) { String _ipPrefix = ipPrefix.stringValue(); int i = _ipPrefix.lastIndexOf('/'); if (i == -1) { return i; } return Integer.parseInt(_ipPrefix.substring(i + 1)); } private  IpPrefixConv(); }
IpPrefixConv { public static int getPrefixLength(IpPrefix ipPrefix) { String _ipPrefix = ipPrefix.stringValue(); int i = _ipPrefix.lastIndexOf('/'); if (i == -1) { return i; } return Integer.parseInt(_ipPrefix.substring(i + 1)); } private  IpPrefixConv(); static IpPrefix createPrefix(String ipPrefix); static List<IpPrefix> decodeIpv4(byte[] array, boolean compact); static List<IpPrefix> decodeIpv6(byte[] array, boolean compact); static boolean equalTo(IpPrefix prefix1, IpPrefix prefix2); static int getBytesLength(int prefixLength); static int getPrefixLength(IpPrefix ipPrefix); static InetSocketAddress parseInetPrefix(String ipPrefix); static byte[] toBytes(IpPrefix prefix); static byte[] toBytes(List<IpPrefix> prefixes); static String toString(IpPrefix prefix); static String toString(List<IpPrefix> prefixes); static byte[] trimPrefix(byte[] prefix, int blength); }
IpPrefixConv { public static int getPrefixLength(IpPrefix ipPrefix) { String _ipPrefix = ipPrefix.stringValue(); int i = _ipPrefix.lastIndexOf('/'); if (i == -1) { return i; } return Integer.parseInt(_ipPrefix.substring(i + 1)); } private  IpPrefixConv(); static IpPrefix createPrefix(String ipPrefix); static List<IpPrefix> decodeIpv4(byte[] array, boolean compact); static List<IpPrefix> decodeIpv6(byte[] array, boolean compact); static boolean equalTo(IpPrefix prefix1, IpPrefix prefix2); static int getBytesLength(int prefixLength); static int getPrefixLength(IpPrefix ipPrefix); static InetSocketAddress parseInetPrefix(String ipPrefix); static byte[] toBytes(IpPrefix prefix); static byte[] toBytes(List<IpPrefix> prefixes); static String toString(IpPrefix prefix); static String toString(List<IpPrefix> prefixes); static byte[] trimPrefix(byte[] prefix, int blength);  }