@Test public void testVisitIpWildcardSetIpSpace() { IpWildcardSetIpSpace ipSpace = new IpWildcardSetIpSpace( ImmutableSet.of(IpWildcard.create(IP2)), ImmutableSet.of(IpWildcard.create(IP1))); assertTrue(containsIp(IP1).visitIpWildcardSetIpSpace(ipSpace)); assertFalse(containsIp(IP2).visitIpWildcardSetIpSpace(ipSpace)); }
@Override public final Boolean visitIpWildcardSetIpSpace(IpWildcardSetIpSpace ipWildcardSetIpSpace) { for (IpWildcard w : ipWildcardSetIpSpace.getBlacklist()) { if (w.containsIp(_ip)) { return false; } } for (IpWildcard w : ipWildcardSetIpSpace.getWhitelist()) { if (w.containsIp(_ip)) { return true; } } return false; }
AbstractIpSpaceContainsIp implements GenericIpSpaceVisitor<Boolean> { @Override public final Boolean visitIpWildcardSetIpSpace(IpWildcardSetIpSpace ipWildcardSetIpSpace) { for (IpWildcard w : ipWildcardSetIpSpace.getBlacklist()) { if (w.containsIp(_ip)) { return false; } } for (IpWildcard w : ipWildcardSetIpSpace.getWhitelist()) { if (w.containsIp(_ip)) { return true; } } return false; } }
AbstractIpSpaceContainsIp implements GenericIpSpaceVisitor<Boolean> { @Override public final Boolean visitIpWildcardSetIpSpace(IpWildcardSetIpSpace ipWildcardSetIpSpace) { for (IpWildcard w : ipWildcardSetIpSpace.getBlacklist()) { if (w.containsIp(_ip)) { return false; } } for (IpWildcard w : ipWildcardSetIpSpace.getWhitelist()) { if (w.containsIp(_ip)) { return true; } } return false; } AbstractIpSpaceContainsIp(Ip ip); }
AbstractIpSpaceContainsIp implements GenericIpSpaceVisitor<Boolean> { @Override public final Boolean visitIpWildcardSetIpSpace(IpWildcardSetIpSpace ipWildcardSetIpSpace) { for (IpWildcard w : ipWildcardSetIpSpace.getBlacklist()) { if (w.containsIp(_ip)) { return false; } } for (IpWildcard w : ipWildcardSetIpSpace.getWhitelist()) { if (w.containsIp(_ip)) { return true; } } return false; } AbstractIpSpaceContainsIp(Ip ip); @Override final Boolean castToGenericIpSpaceVisitorReturnType(Object o); @Override final Boolean visitAclIpSpace(AclIpSpace aclIpSpace); @Override final Boolean visitEmptyIpSpace(EmptyIpSpace emptyIpSpace); @Override final Boolean visitIpIpSpace(IpIpSpace ipIpSpace); @Override final Boolean visitIpWildcardIpSpace(IpWildcardIpSpace ipWildcardIpSpace); @Override final Boolean visitIpWildcardSetIpSpace(IpWildcardSetIpSpace ipWildcardSetIpSpace); @Override final Boolean visitPrefixIpSpace(PrefixIpSpace prefixIpSpace); @Override final Boolean visitUniverseIpSpace(UniverseIpSpace universeIpSpace); }
AbstractIpSpaceContainsIp implements GenericIpSpaceVisitor<Boolean> { @Override public final Boolean visitIpWildcardSetIpSpace(IpWildcardSetIpSpace ipWildcardSetIpSpace) { for (IpWildcard w : ipWildcardSetIpSpace.getBlacklist()) { if (w.containsIp(_ip)) { return false; } } for (IpWildcard w : ipWildcardSetIpSpace.getWhitelist()) { if (w.containsIp(_ip)) { return true; } } return false; } AbstractIpSpaceContainsIp(Ip ip); @Override final Boolean castToGenericIpSpaceVisitorReturnType(Object o); @Override final Boolean visitAclIpSpace(AclIpSpace aclIpSpace); @Override final Boolean visitEmptyIpSpace(EmptyIpSpace emptyIpSpace); @Override final Boolean visitIpIpSpace(IpIpSpace ipIpSpace); @Override final Boolean visitIpWildcardIpSpace(IpWildcardIpSpace ipWildcardIpSpace); @Override final Boolean visitIpWildcardSetIpSpace(IpWildcardSetIpSpace ipWildcardSetIpSpace); @Override final Boolean visitPrefixIpSpace(PrefixIpSpace prefixIpSpace); @Override final Boolean visitUniverseIpSpace(UniverseIpSpace universeIpSpace);  }