@Test public void testRange() { testIpRange(Ip.ZERO, Ip.ZERO); testIpRange(Ip.ZERO, Ip.MAX); testIpRange(Ip.MAX, Ip.MAX); testIpRange(Ip.parse("4.23.32.21"), Ip.parse("5.0.0.1")); testIpRange(Ip.parse("5.0.0.1"), Ip.parse("5.0.0.1")); testIpRange(Ip.parse("123.0.0.0"), Ip.parse("123.0.0.255")); testIpRange(Ip.parse("1.255.255.255"), Ip.parse("2.255.255.255")); testIpRange(Ip.parse("0.0.0.1"), Ip.parse("255.255.255.254")); }
public static @Nonnull IpSpace range(Ip low, Ip high) { checkArgument( low.asLong() <= high.asLong(), "Invalid range: low IP must be <= high IP, but received low=%s and high=%s", low, high); ImmutableList.Builder<Prefix> prefixes = ImmutableList.builder(); collectPrefixes(low, high, prefixes); return AclIpSpace.builder() .thenPermitting(prefixes.build().stream().map(Prefix::toIpSpace)) .build(); }
IpRange { public static @Nonnull IpSpace range(Ip low, Ip high) { checkArgument( low.asLong() <= high.asLong(), "Invalid range: low IP must be <= high IP, but received low=%s and high=%s", low, high); ImmutableList.Builder<Prefix> prefixes = ImmutableList.builder(); collectPrefixes(low, high, prefixes); return AclIpSpace.builder() .thenPermitting(prefixes.build().stream().map(Prefix::toIpSpace)) .build(); } }
IpRange { public static @Nonnull IpSpace range(Ip low, Ip high) { checkArgument( low.asLong() <= high.asLong(), "Invalid range: low IP must be <= high IP, but received low=%s and high=%s", low, high); ImmutableList.Builder<Prefix> prefixes = ImmutableList.builder(); collectPrefixes(low, high, prefixes); return AclIpSpace.builder() .thenPermitting(prefixes.build().stream().map(Prefix::toIpSpace)) .build(); } private  IpRange(); }
IpRange { public static @Nonnull IpSpace range(Ip low, Ip high) { checkArgument( low.asLong() <= high.asLong(), "Invalid range: low IP must be <= high IP, but received low=%s and high=%s", low, high); ImmutableList.Builder<Prefix> prefixes = ImmutableList.builder(); collectPrefixes(low, high, prefixes); return AclIpSpace.builder() .thenPermitting(prefixes.build().stream().map(Prefix::toIpSpace)) .build(); } private  IpRange(); static @Nonnull IpSpace range(Ip low, Ip high); }
IpRange { public static @Nonnull IpSpace range(Ip low, Ip high) { checkArgument( low.asLong() <= high.asLong(), "Invalid range: low IP must be <= high IP, but received low=%s and high=%s", low, high); ImmutableList.Builder<Prefix> prefixes = ImmutableList.builder(); collectPrefixes(low, high, prefixes); return AclIpSpace.builder() .thenPermitting(prefixes.build().stream().map(Prefix::toIpSpace)) .build(); } private  IpRange(); static @Nonnull IpSpace range(Ip low, Ip high);  }