@Test public void testVisitAclIpSpace() { AclIpSpace ipSpace = (AclIpSpace) rejecting(IP2.toIpSpace()).thenPermitting(UniverseIpSpace.INSTANCE).build(); assertTrue(containsIp(IP1).visitAclIpSpace(ipSpace)); assertFalse(containsIp(IP2).visitAclIpSpace(ipSpace)); }
@Override public final Boolean visitAclIpSpace(AclIpSpace aclIpSpace) { for (AclIpSpaceLine line : aclIpSpace.getLines()) { if (line.getIpSpace().accept(this)) { return line.getAction() == LineAction.PERMIT; } } return false; }
AbstractIpSpaceContainsIp implements GenericIpSpaceVisitor<Boolean> { @Override public final Boolean visitAclIpSpace(AclIpSpace aclIpSpace) { for (AclIpSpaceLine line : aclIpSpace.getLines()) { if (line.getIpSpace().accept(this)) { return line.getAction() == LineAction.PERMIT; } } return false; } }
AbstractIpSpaceContainsIp implements GenericIpSpaceVisitor<Boolean> { @Override public final Boolean visitAclIpSpace(AclIpSpace aclIpSpace) { for (AclIpSpaceLine line : aclIpSpace.getLines()) { if (line.getIpSpace().accept(this)) { return line.getAction() == LineAction.PERMIT; } } return false; } AbstractIpSpaceContainsIp(Ip ip); }
AbstractIpSpaceContainsIp implements GenericIpSpaceVisitor<Boolean> { @Override public final Boolean visitAclIpSpace(AclIpSpace aclIpSpace) { for (AclIpSpaceLine line : aclIpSpace.getLines()) { if (line.getIpSpace().accept(this)) { return line.getAction() == LineAction.PERMIT; } } 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 visitAclIpSpace(AclIpSpace aclIpSpace) { for (AclIpSpaceLine line : aclIpSpace.getLines()) { if (line.getIpSpace().accept(this)) { return line.getAction() == LineAction.PERMIT; } } 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);  }