@Test public void testApply() { assertThat( RENAMER.apply( IpAccessList.builder() .setName("a") .setLines( ImmutableList.of( accepting(TRUE), rejecting(ACL_A), accepting(MATCH_HEADER_SPACE_ORIG))) .build()), equalTo( IpAccessList.builder() .setName("b") .setLines( ImmutableList.of( accepting(TRUE), rejecting(ACL_B), accepting(MATCH_HEADER_SPACE_RENAMED))) .build())); }
@Override public IpAccessList apply(IpAccessList ipAccessList) { return IpAccessList.builder() .setName(_aclRenamer.apply(ipAccessList.getName())) .setLines( ipAccessList.getLines().stream() .map(_visitor::visit) .collect(ImmutableList.toImmutableList())) .build(); }
IpAccessListRenamer implements Function<IpAccessList, IpAccessList> { @Override public IpAccessList apply(IpAccessList ipAccessList) { return IpAccessList.builder() .setName(_aclRenamer.apply(ipAccessList.getName())) .setLines( ipAccessList.getLines().stream() .map(_visitor::visit) .collect(ImmutableList.toImmutableList())) .build(); } }
IpAccessListRenamer implements Function<IpAccessList, IpAccessList> { @Override public IpAccessList apply(IpAccessList ipAccessList) { return IpAccessList.builder() .setName(_aclRenamer.apply(ipAccessList.getName())) .setLines( ipAccessList.getLines().stream() .map(_visitor::visit) .collect(ImmutableList.toImmutableList())) .build(); } IpAccessListRenamer(Function<String, String> aclRenamer, IpSpaceRenamer ipSpaceRenamer); }
IpAccessListRenamer implements Function<IpAccessList, IpAccessList> { @Override public IpAccessList apply(IpAccessList ipAccessList) { return IpAccessList.builder() .setName(_aclRenamer.apply(ipAccessList.getName())) .setLines( ipAccessList.getLines().stream() .map(_visitor::visit) .collect(ImmutableList.toImmutableList())) .build(); } IpAccessListRenamer(Function<String, String> aclRenamer, IpSpaceRenamer ipSpaceRenamer); @Override IpAccessList apply(IpAccessList ipAccessList); }
IpAccessListRenamer implements Function<IpAccessList, IpAccessList> { @Override public IpAccessList apply(IpAccessList ipAccessList) { return IpAccessList.builder() .setName(_aclRenamer.apply(ipAccessList.getName())) .setLines( ipAccessList.getLines().stream() .map(_visitor::visit) .collect(ImmutableList.toImmutableList())) .build(); } IpAccessListRenamer(Function<String, String> aclRenamer, IpSpaceRenamer ipSpaceRenamer); @Override IpAccessList apply(IpAccessList ipAccessList);  }