@Test public void testToRouteFilter() { IpPrefixList prefixList = new IpPrefixList("name"); prefixList .getLines() .put( 10L, new IpPrefixListLine( LineAction.DENY, 10, Prefix.parse("10.0.0.1/24"), new SubRange(27, 30))); prefixList .getLines() .put( 20L, new IpPrefixListLine( LineAction.PERMIT, 20, Prefix.parse("10.0.2.1/24"), new SubRange(28, 31))); RouteFilterList rfl = toRouteFilterList(prefixList); assertThat( rfl, equalTo( new RouteFilterList( "name", ImmutableList.of( new RouteFilterLine( LineAction.DENY, Prefix.parse("10.0.0.1/24"), new SubRange(27, 30)), new RouteFilterLine( LineAction.PERMIT, Prefix.parse("10.0.2.1/24"), new SubRange(28, 31)))))); }
@VisibleForTesting static @Nonnull RouteFilterList toRouteFilterList(IpPrefixList ipPrefixList) { String name = ipPrefixList.getName(); RouteFilterList rfl = new RouteFilterList(name); rfl.setLines( ipPrefixList.getLines().values().stream() .map(CumulusConversions::toRouteFilterLine) .collect(ImmutableList.toImmutableList())); return rfl; }
CumulusConversions { @VisibleForTesting static @Nonnull RouteFilterList toRouteFilterList(IpPrefixList ipPrefixList) { String name = ipPrefixList.getName(); RouteFilterList rfl = new RouteFilterList(name); rfl.setLines( ipPrefixList.getLines().values().stream() .map(CumulusConversions::toRouteFilterLine) .collect(ImmutableList.toImmutableList())); return rfl; } }
CumulusConversions { @VisibleForTesting static @Nonnull RouteFilterList toRouteFilterList(IpPrefixList ipPrefixList) { String name = ipPrefixList.getName(); RouteFilterList rfl = new RouteFilterList(name); rfl.setLines( ipPrefixList.getLines().values().stream() .map(CumulusConversions::toRouteFilterLine) .collect(ImmutableList.toImmutableList())); return rfl; }  }
CumulusConversions { @VisibleForTesting static @Nonnull RouteFilterList toRouteFilterList(IpPrefixList ipPrefixList) { String name = ipPrefixList.getName(); RouteFilterList rfl = new RouteFilterList(name); rfl.setLines( ipPrefixList.getLines().values().stream() .map(CumulusConversions::toRouteFilterLine) .collect(ImmutableList.toImmutableList())); return rfl; }  static @Nonnull String computeBgpCommonExportPolicyName(String vrfName); @VisibleForTesting static @Nonnull String computeBgpPeerExportPolicyName(
      String vrfName, String peerInterface); static @Nonnull String computeBgpPeerImportPolicyName(String vrf, String peer); static String computeBgpGenerationPolicyName(boolean ipv4, String vrfName, String prefix); static String computeMatchSuppressedSummaryOnlyPolicyName(String vrfName); static String computeOspfExportPolicyName(String vrfName); }
CumulusConversions { @VisibleForTesting static @Nonnull RouteFilterList toRouteFilterList(IpPrefixList ipPrefixList) { String name = ipPrefixList.getName(); RouteFilterList rfl = new RouteFilterList(name); rfl.setLines( ipPrefixList.getLines().values().stream() .map(CumulusConversions::toRouteFilterLine) .collect(ImmutableList.toImmutableList())); return rfl; }  static @Nonnull String computeBgpCommonExportPolicyName(String vrfName); @VisibleForTesting static @Nonnull String computeBgpPeerExportPolicyName(
      String vrfName, String peerInterface); static @Nonnull String computeBgpPeerImportPolicyName(String vrf, String peer); static String computeBgpGenerationPolicyName(boolean ipv4, String vrfName, String prefix); static String computeMatchSuppressedSummaryOnlyPolicyName(String vrfName); static String computeOspfExportPolicyName(String vrfName); static final int DEFAULT_STATIC_ROUTE_ADMINISTRATIVE_DISTANCE; static final int DEFAULT_STATIC_ROUTE_METRIC; static final Ip CLAG_LINK_LOCAL_IP; static final long DEFAULT_MAX_MED; static final double SPEED_CONVERSION_FACTOR; static final double DEFAULT_LOOPBACK_BANDWIDTH; static final double DEFAULT_PORT_BANDWIDTH; }