@Test public void testRemoveRoute() { StaticRoute r = StaticRoute.builder() .setNetwork(Ip.parse("1.1.1.1").toPrefix()) .setNextHopIp(Ip.ZERO) .setNextHopInterface(null) .setAdministrativeCost(1) .setMetric(0L) .setTag(1L) .build(); _rib.mergeRoute(_mostGeneralRoute); _rib.mergeRoute(r); RibDelta<StaticRoute> d = _rib.removeRouteGetDelta(_mostGeneralRoute); List<RouteAdvertisement<StaticRoute>> actions = d.getActions().collect(Collectors.toList()); assertThat(_rib.getTypedRoutes(), contains(r)); assertThat(actions, contains(new RouteAdvertisement<>(_mostGeneralRoute, Reason.WITHDRAW))); d = _rib.removeRouteGetDelta(r); actions = d.getActions().collect(Collectors.toList()); assertThat(_rib.getTypedRoutes(), empty()); assertThat(actions, contains(new RouteAdvertisement<>(r, Reason.WITHDRAW))); }
public boolean removeRoute(R route) { return !removeRouteGetDelta(route, Reason.WITHDRAW).isEmpty(); }
AbstractRib implements GenericRib<R> { public boolean removeRoute(R route) { return !removeRouteGetDelta(route, Reason.WITHDRAW).isEmpty(); } }
AbstractRib implements GenericRib<R> { public boolean removeRoute(R route) { return !removeRouteGetDelta(route, Reason.WITHDRAW).isEmpty(); } protected  AbstractRib(boolean withBackupRoutes); protected  AbstractRib(); }
AbstractRib implements GenericRib<R> { public boolean removeRoute(R route) { return !removeRouteGetDelta(route, Reason.WITHDRAW).isEmpty(); } protected  AbstractRib(boolean withBackupRoutes); protected  AbstractRib(); @Nonnull static RibDelta<U> importRib(
      AbstractRib<U> importingRib, AbstractRib<T> exportingRib); @Nonnull static RibDelta<AnnotatedRoute<U>> importRib(
      AnnotatedRib<U> importingRib, AbstractRib<T> exportingRib, String vrfName); @Nonnull static RibDelta<AnnotatedRoute<U>> importRib(
      AnnotatedRib<U> importingRib, AnnotatedRib<T> exportingRib); final void clear(); @Override @SuppressWarnings("unchecked") final boolean containsRoute(AbstractRouteDecorator route); @Override @Nonnull Set<AbstractRoute> getRoutes(); @Override @Nonnull Set<R> getTypedRoutes(); @Override abstract int comparePreference(R lhs, R rhs); @Override @Nonnull Set<R> longestPrefixMatch(Ip address); @Override @Nonnull Set<R> longestPrefixMatch(Ip address, int maxPrefixLength); @Nonnull RibDelta<R> mergeRouteGetDelta(R route); @Override boolean mergeRoute(R route); @Nonnull RibDelta<R> removeRouteGetDelta(R route, Reason reason); @Nonnull RibDelta<R> removeRouteGetDelta(R route); boolean removeRoute(R route); @Override boolean equals(@Nullable Object other); @Override int hashCode(); }
AbstractRib implements GenericRib<R> { public boolean removeRoute(R route) { return !removeRouteGetDelta(route, Reason.WITHDRAW).isEmpty(); } protected  AbstractRib(boolean withBackupRoutes); protected  AbstractRib(); @Nonnull static RibDelta<U> importRib(
      AbstractRib<U> importingRib, AbstractRib<T> exportingRib); @Nonnull static RibDelta<AnnotatedRoute<U>> importRib(
      AnnotatedRib<U> importingRib, AbstractRib<T> exportingRib, String vrfName); @Nonnull static RibDelta<AnnotatedRoute<U>> importRib(
      AnnotatedRib<U> importingRib, AnnotatedRib<T> exportingRib); final void clear(); @Override @SuppressWarnings("unchecked") final boolean containsRoute(AbstractRouteDecorator route); @Override @Nonnull Set<AbstractRoute> getRoutes(); @Override @Nonnull Set<R> getTypedRoutes(); @Override abstract int comparePreference(R lhs, R rhs); @Override @Nonnull Set<R> longestPrefixMatch(Ip address); @Override @Nonnull Set<R> longestPrefixMatch(Ip address, int maxPrefixLength); @Nonnull RibDelta<R> mergeRouteGetDelta(R route); @Override boolean mergeRoute(R route); @Nonnull RibDelta<R> removeRouteGetDelta(R route, Reason reason); @Nonnull RibDelta<R> removeRouteGetDelta(R route); boolean removeRoute(R route); @Override boolean equals(@Nullable Object other); @Override int hashCode();  }