@Test public void testVisitDiscard() { _fwTerm.getThens().add(FwThenDiscard.INSTANCE); assertThat( TermFwThenToPacketPolicyStatement.convert(_fwTerm, "someVRF"), equalTo(ImmutableList.of(new Return(Drop.instance())))); }
public static List<Statement> convert(FwTerm term, String vrfName) { TermFwThenToPacketPolicyStatement thenConverter = new TermFwThenToPacketPolicyStatement(vrfName); return term.getThens().stream() .map(thenConverter::visit) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); }
TermFwThenToPacketPolicyStatement implements FwThenVisitor<Statement> { public static List<Statement> convert(FwTerm term, String vrfName) { TermFwThenToPacketPolicyStatement thenConverter = new TermFwThenToPacketPolicyStatement(vrfName); return term.getThens().stream() .map(thenConverter::visit) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); } }
TermFwThenToPacketPolicyStatement implements FwThenVisitor<Statement> { public static List<Statement> convert(FwTerm term, String vrfName) { TermFwThenToPacketPolicyStatement thenConverter = new TermFwThenToPacketPolicyStatement(vrfName); return term.getThens().stream() .map(thenConverter::visit) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); } private  TermFwThenToPacketPolicyStatement(String vrfToUse); }
TermFwThenToPacketPolicyStatement implements FwThenVisitor<Statement> { public static List<Statement> convert(FwTerm term, String vrfName) { TermFwThenToPacketPolicyStatement thenConverter = new TermFwThenToPacketPolicyStatement(vrfName); return term.getThens().stream() .map(thenConverter::visit) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); } private  TermFwThenToPacketPolicyStatement(String vrfToUse); @Override @Nullable Statement visitFwThenAccept(FwThenAccept accept); @Override @Nullable Statement visitFwThenDiscard(FwThenDiscard discard); @Override @Nullable Statement visitFwThenNextIp(FwThenNextIp nextIp); @Override @Nullable Statement visitFwThenNextTerm(FwThenNextTerm accept); @Override @Nullable Statement visitFwThenNop(FwThenNop nop); @Override @Nullable Statement visitThenRoutingInstance(FwThenRoutingInstance routingInstance); static List<Statement> convert(FwTerm term, String vrfName); }
TermFwThenToPacketPolicyStatement implements FwThenVisitor<Statement> { public static List<Statement> convert(FwTerm term, String vrfName) { TermFwThenToPacketPolicyStatement thenConverter = new TermFwThenToPacketPolicyStatement(vrfName); return term.getThens().stream() .map(thenConverter::visit) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); } private  TermFwThenToPacketPolicyStatement(String vrfToUse); @Override @Nullable Statement visitFwThenAccept(FwThenAccept accept); @Override @Nullable Statement visitFwThenDiscard(FwThenDiscard discard); @Override @Nullable Statement visitFwThenNextIp(FwThenNextIp nextIp); @Override @Nullable Statement visitFwThenNextTerm(FwThenNextTerm accept); @Override @Nullable Statement visitFwThenNop(FwThenNop nop); @Override @Nullable Statement visitThenRoutingInstance(FwThenRoutingInstance routingInstance); static List<Statement> convert(FwTerm term, String vrfName);  }