@Test public void testIpSpace() { IpWildcardSetIpSpace any = IpWildcardSetIpSpace.builder().including(IpWildcard.ANY).build(); IpWildcardSetIpSpace justMax = IpWildcardSetIpSpace.builder().including(IpWildcard.create(Ip.MAX)).build(); IpWildcardSetIpSpace anyExceptMax = IpWildcardSetIpSpace.builder() .including(IpWildcard.ANY) .excluding(IpWildcard.create(Ip.MAX)) .build(); IpWildcardSetIpSpace none1 = IpWildcardSetIpSpace.builder().build(); IpWildcardSetIpSpace none2 = IpWildcardSetIpSpace.builder().including(IpWildcard.ANY).excluding(IpWildcard.ANY).build(); IpWildcardSetIpSpace someButNotMax = IpWildcardSetIpSpace.builder().including(IpWildcard.parse("1.2.3.4")).build(); assertThat(any, containsIp(Ip.MAX)); assertThat(justMax, containsIp(Ip.MAX)); assertThat(anyExceptMax, not(containsIp(Ip.MAX))); assertThat(none1, not(containsIp(Ip.MAX))); assertThat(none2, not(containsIp(Ip.MAX))); assertThat(someButNotMax, not(containsIp(Ip.MAX))); }
public final boolean containsIp(@Nonnull Ip ip, @Nonnull Map<String, IpSpace> namedIpSpaces) { return accept(new IpSpaceContainsIp(ip, namedIpSpaces)); }
IpSpace implements Comparable<IpSpace>, Serializable { public final boolean containsIp(@Nonnull Ip ip, @Nonnull Map<String, IpSpace> namedIpSpaces) { return accept(new IpSpaceContainsIp(ip, namedIpSpaces)); } }
IpSpace implements Comparable<IpSpace>, Serializable { public final boolean containsIp(@Nonnull Ip ip, @Nonnull Map<String, IpSpace> namedIpSpaces) { return accept(new IpSpaceContainsIp(ip, namedIpSpaces)); }  }
IpSpace implements Comparable<IpSpace>, Serializable { public final boolean containsIp(@Nonnull Ip ip, @Nonnull Map<String, IpSpace> namedIpSpaces) { return accept(new IpSpaceContainsIp(ip, namedIpSpaces)); }  abstract R accept(GenericIpSpaceVisitor<R> visitor); final boolean containsIp(@Nonnull Ip ip, @Nonnull Map<String, IpSpace> namedIpSpaces); final IpSpace complement(); @Override final int compareTo(IpSpace o); @Override final boolean equals(Object o); @Override abstract int hashCode(); @Override abstract String toString(); }
IpSpace implements Comparable<IpSpace>, Serializable { public final boolean containsIp(@Nonnull Ip ip, @Nonnull Map<String, IpSpace> namedIpSpaces) { return accept(new IpSpaceContainsIp(ip, namedIpSpaces)); }  abstract R accept(GenericIpSpaceVisitor<R> visitor); final boolean containsIp(@Nonnull Ip ip, @Nonnull Map<String, IpSpace> namedIpSpaces); final IpSpace complement(); @Override final int compareTo(IpSpace o); @Override final boolean equals(Object o); @Override abstract int hashCode(); @Override abstract String toString();  }