@Test public void testAclIpSpace() { IpSpaceDereferencer dereferencer = new IpSpaceDereferencer(NAMED_IP_SPACES); AclIpSpace input = (AclIpSpace) AclIpSpace.builder() .thenPermitting(new IpSpaceReference("empty")) .thenRejecting(new IpSpaceReference("prefix")) .thenPermitting(new IpSpaceReference("namedIp")) .thenRejecting(UniverseIpSpace.INSTANCE) .build(); IpSpace expected = AclIpSpace.builder() .thenPermitting(NAMED_IP_SPACES.get("empty")) .thenRejecting(NAMED_IP_SPACES.get("prefix")) .thenPermitting(NAMED_IP_SPACES.get("ip")) .thenRejecting(UniverseIpSpace.INSTANCE) .build(); assertThat(dereferencer.visitAclIpSpace(input), equalTo(expected)); }
@Override public IpSpace visitAclIpSpace(AclIpSpace aclIpSpace) throws CircularReferenceException, UndefinedReferenceException { AclIpSpace.Builder sanitizedSpace = AclIpSpace.builder(); for (AclIpSpaceLine line : aclIpSpace.getLines()) { IpSpace ipSpace = line.getIpSpace().accept(this); sanitizedSpace.thenAction(line.getAction(), ipSpace); } return sanitizedSpace.build(); }
IpSpaceDereferencer implements GenericIpSpaceVisitor<IpSpace> { @Override public IpSpace visitAclIpSpace(AclIpSpace aclIpSpace) throws CircularReferenceException, UndefinedReferenceException { AclIpSpace.Builder sanitizedSpace = AclIpSpace.builder(); for (AclIpSpaceLine line : aclIpSpace.getLines()) { IpSpace ipSpace = line.getIpSpace().accept(this); sanitizedSpace.thenAction(line.getAction(), ipSpace); } return sanitizedSpace.build(); } }
IpSpaceDereferencer implements GenericIpSpaceVisitor<IpSpace> { @Override public IpSpace visitAclIpSpace(AclIpSpace aclIpSpace) throws CircularReferenceException, UndefinedReferenceException { AclIpSpace.Builder sanitizedSpace = AclIpSpace.builder(); for (AclIpSpaceLine line : aclIpSpace.getLines()) { IpSpace ipSpace = line.getIpSpace().accept(this); sanitizedSpace.thenAction(line.getAction(), ipSpace); } return sanitizedSpace.build(); } IpSpaceDereferencer(Map<String, IpSpace> namedIpSpaces); }
IpSpaceDereferencer implements GenericIpSpaceVisitor<IpSpace> { @Override public IpSpace visitAclIpSpace(AclIpSpace aclIpSpace) throws CircularReferenceException, UndefinedReferenceException { AclIpSpace.Builder sanitizedSpace = AclIpSpace.builder(); for (AclIpSpaceLine line : aclIpSpace.getLines()) { IpSpace ipSpace = line.getIpSpace().accept(this); sanitizedSpace.thenAction(line.getAction(), ipSpace); } return sanitizedSpace.build(); } IpSpaceDereferencer(Map<String, IpSpace> namedIpSpaces); static HeaderSpace dereferenceHeaderSpace(
      HeaderSpace headerSpace, Map<String, IpSpace> namedIpSpaces); @Override IpSpace castToGenericIpSpaceVisitorReturnType(Object o); @Override IpSpace visitAclIpSpace(AclIpSpace aclIpSpace); @Override IpSpace visitEmptyIpSpace(EmptyIpSpace emptyIpSpace); @Override IpSpace visitIpIpSpace(IpIpSpace ipIpSpace); @Override IpSpace visitIpSpaceReference(IpSpaceReference ipSpaceReference); @Override IpSpace visitIpWildcardIpSpace(IpWildcardIpSpace ipWildcardIpSpace); @Override IpSpace visitIpWildcardSetIpSpace(IpWildcardSetIpSpace ipWildcardSetIpSpace); @Override IpSpace visitPrefixIpSpace(PrefixIpSpace prefixIpSpace); @Override IpSpace visitUniverseIpSpace(UniverseIpSpace universeIpSpace); }
IpSpaceDereferencer implements GenericIpSpaceVisitor<IpSpace> { @Override public IpSpace visitAclIpSpace(AclIpSpace aclIpSpace) throws CircularReferenceException, UndefinedReferenceException { AclIpSpace.Builder sanitizedSpace = AclIpSpace.builder(); for (AclIpSpaceLine line : aclIpSpace.getLines()) { IpSpace ipSpace = line.getIpSpace().accept(this); sanitizedSpace.thenAction(line.getAction(), ipSpace); } return sanitizedSpace.build(); } IpSpaceDereferencer(Map<String, IpSpace> namedIpSpaces); static HeaderSpace dereferenceHeaderSpace(
      HeaderSpace headerSpace, Map<String, IpSpace> namedIpSpaces); @Override IpSpace castToGenericIpSpaceVisitorReturnType(Object o); @Override IpSpace visitAclIpSpace(AclIpSpace aclIpSpace); @Override IpSpace visitEmptyIpSpace(EmptyIpSpace emptyIpSpace); @Override IpSpace visitIpIpSpace(IpIpSpace ipIpSpace); @Override IpSpace visitIpSpaceReference(IpSpaceReference ipSpaceReference); @Override IpSpace visitIpWildcardIpSpace(IpWildcardIpSpace ipWildcardIpSpace); @Override IpSpace visitIpWildcardSetIpSpace(IpWildcardSetIpSpace ipWildcardSetIpSpace); @Override IpSpace visitPrefixIpSpace(PrefixIpSpace prefixIpSpace); @Override IpSpace visitUniverseIpSpace(UniverseIpSpace universeIpSpace);  }