@Test public void testAsPositiveIpWildcards() { assertThat(asPositiveIpWildcards(null), nullValue()); }
public static SortedSet<IpWildcard> asPositiveIpWildcards(IpSpace ipSpace) { if (ipSpace == null) { return null; } else if (ipSpace instanceof IpWildcardIpSpace) { return ImmutableSortedSet.of(((IpWildcardIpSpace) ipSpace).getIpWildcard()); } else if (ipSpace instanceof IpWildcardSetIpSpace) { return ((IpWildcardSetIpSpace) ipSpace).getWhitelist(); } else if (ipSpace instanceof UniverseIpSpace) { return ImmutableSortedSet.of(); } else { throw new BatfishException( String.format("Cannot represent as SortedSet<IpWildcard>: %s", ipSpace)); } }
PrefixUtils { public static SortedSet<IpWildcard> asPositiveIpWildcards(IpSpace ipSpace) { if (ipSpace == null) { return null; } else if (ipSpace instanceof IpWildcardIpSpace) { return ImmutableSortedSet.of(((IpWildcardIpSpace) ipSpace).getIpWildcard()); } else if (ipSpace instanceof IpWildcardSetIpSpace) { return ((IpWildcardSetIpSpace) ipSpace).getWhitelist(); } else if (ipSpace instanceof UniverseIpSpace) { return ImmutableSortedSet.of(); } else { throw new BatfishException( String.format("Cannot represent as SortedSet<IpWildcard>: %s", ipSpace)); } } }
PrefixUtils { public static SortedSet<IpWildcard> asPositiveIpWildcards(IpSpace ipSpace) { if (ipSpace == null) { return null; } else if (ipSpace instanceof IpWildcardIpSpace) { return ImmutableSortedSet.of(((IpWildcardIpSpace) ipSpace).getIpWildcard()); } else if (ipSpace instanceof IpWildcardSetIpSpace) { return ((IpWildcardSetIpSpace) ipSpace).getWhitelist(); } else if (ipSpace instanceof UniverseIpSpace) { return ImmutableSortedSet.of(); } else { throw new BatfishException( String.format("Cannot represent as SortedSet<IpWildcard>: %s", ipSpace)); } }  }
PrefixUtils { public static SortedSet<IpWildcard> asPositiveIpWildcards(IpSpace ipSpace) { if (ipSpace == null) { return null; } else if (ipSpace instanceof IpWildcardIpSpace) { return ImmutableSortedSet.of(((IpWildcardIpSpace) ipSpace).getIpWildcard()); } else if (ipSpace instanceof IpWildcardSetIpSpace) { return ((IpWildcardSetIpSpace) ipSpace).getWhitelist(); } else if (ipSpace instanceof UniverseIpSpace) { return ImmutableSortedSet.of(); } else { throw new BatfishException( String.format("Cannot represent as SortedSet<IpWildcard>: %s", ipSpace)); } }  static boolean overlap(Prefix p1, Prefix p2); static boolean overlap(Prefix p, Collection<Prefix> ps); static boolean isContainedBy(Prefix p, @Nullable Collection<Prefix> ps); static SortedSet<IpWildcard> asPositiveIpWildcards(IpSpace ipSpace); static SortedSet<IpWildcard> asNegativeIpWildcards(IpSpace ipSpace); }
PrefixUtils { public static SortedSet<IpWildcard> asPositiveIpWildcards(IpSpace ipSpace) { if (ipSpace == null) { return null; } else if (ipSpace instanceof IpWildcardIpSpace) { return ImmutableSortedSet.of(((IpWildcardIpSpace) ipSpace).getIpWildcard()); } else if (ipSpace instanceof IpWildcardSetIpSpace) { return ((IpWildcardSetIpSpace) ipSpace).getWhitelist(); } else if (ipSpace instanceof UniverseIpSpace) { return ImmutableSortedSet.of(); } else { throw new BatfishException( String.format("Cannot represent as SortedSet<IpWildcard>: %s", ipSpace)); } }  static boolean overlap(Prefix p1, Prefix p2); static boolean overlap(Prefix p, Collection<Prefix> ps); static boolean isContainedBy(Prefix p, @Nullable Collection<Prefix> ps); static SortedSet<IpWildcard> asPositiveIpWildcards(IpSpace ipSpace); static SortedSet<IpWildcard> asNegativeIpWildcards(IpSpace ipSpace);  }