@Test public void testContainsRoute() { Rib rib = new Rib(); StaticRoute sr = StaticRoute.builder() .setAdministrativeCost(1) .setNetwork(Prefix.ZERO) .setNextHopInterface("iface") .build(); AnnotatedRoute<StaticRoute> ar = new AnnotatedRoute<>(sr, "vrf"); rib.mergeRoute(new AnnotatedRoute<>(sr, "vrf")); assertTrue(rib.containsRoute(ar)); assertFalse(rib.containsRoute(new AnnotatedRoute<>(sr, "othervrf"))); assertFalse( rib.containsRoute( new AnnotatedRoute<>( StaticRoute.builder() .setAdministrativeCost(1) .setNetwork(Prefix.ZERO) .setNextHopInterface("iface2") .build(), "othervrf"))); }
@SuppressWarnings("unchecked") public boolean containsRoute(AnnotatedRoute<? extends R> route) { return super.containsRoute((AnnotatedRoute<R>) route); }
AnnotatedRib extends AbstractRib<AnnotatedRoute<R>> implements Serializable { @SuppressWarnings("unchecked") public boolean containsRoute(AnnotatedRoute<? extends R> route) { return super.containsRoute((AnnotatedRoute<R>) route); } }
AnnotatedRib extends AbstractRib<AnnotatedRoute<R>> implements Serializable { @SuppressWarnings("unchecked") public boolean containsRoute(AnnotatedRoute<? extends R> route) { return super.containsRoute((AnnotatedRoute<R>) route); } AnnotatedRib(); }
AnnotatedRib extends AbstractRib<AnnotatedRoute<R>> implements Serializable { @SuppressWarnings("unchecked") public boolean containsRoute(AnnotatedRoute<? extends R> route) { return super.containsRoute((AnnotatedRoute<R>) route); } AnnotatedRib(); @Override abstract int comparePreference(AnnotatedRoute<R> lhs, AnnotatedRoute<R> rhs); @SuppressWarnings("unchecked") // Since R is a supertype, this cast should be fine boolean containsRoute(AnnotatedRoute<? extends R> route); }
AnnotatedRib extends AbstractRib<AnnotatedRoute<R>> implements Serializable { @SuppressWarnings("unchecked") public boolean containsRoute(AnnotatedRoute<? extends R> route) { return super.containsRoute((AnnotatedRoute<R>) route); } AnnotatedRib(); @Override abstract int comparePreference(AnnotatedRoute<R> lhs, AnnotatedRoute<R> rhs); @SuppressWarnings("unchecked") // Since R is a supertype, this cast should be fine boolean containsRoute(AnnotatedRoute<? extends R> route);  }