@Test public void testToBuilder() { RouteAdvertisement<StaticRoute> ra = RouteAdvertisement.<StaticRoute>builder() .setRoute( StaticRoute.builder() .setAdministrativeCost(1) .setNetwork(Prefix.parse("1.1.1.0/24")) .setNextHopIp(Ip.parse("2.2.2.2")) .build()) .setReason(Reason.WITHDRAW) .build(); assertThat(ra.toBuilder().build(), equalTo(ra)); }
@Nonnull public Builder<T> toBuilder() { return RouteAdvertisement.<T>builder().setRoute(_route).setReason(_reason); }
RouteAdvertisement { @Nonnull public Builder<T> toBuilder() { return RouteAdvertisement.<T>builder().setRoute(_route).setReason(_reason); } }
RouteAdvertisement { @Nonnull public Builder<T> toBuilder() { return RouteAdvertisement.<T>builder().setRoute(_route).setReason(_reason); } @VisibleForTesting  RouteAdvertisement(T route, Reason reason);  RouteAdvertisement(T route); }
RouteAdvertisement { @Nonnull public Builder<T> toBuilder() { return RouteAdvertisement.<T>builder().setRoute(_route).setReason(_reason); } @VisibleForTesting  RouteAdvertisement(T route, Reason reason);  RouteAdvertisement(T route); static RouteAdvertisement<T> adding(T route); static RouteAdvertisement<T> replacing(T route); static RouteAdvertisement<T> withdrawing(T route); @Nonnull T getRoute(); @Nonnull Reason getReason(); boolean isWithdrawn(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString(); @Nonnull static Builder<T> builder(); @Nonnull Builder<T> toBuilder(); RouteAdvertisement<T> sanitizeForExport(); }
RouteAdvertisement { @Nonnull public Builder<T> toBuilder() { return RouteAdvertisement.<T>builder().setRoute(_route).setReason(_reason); } @VisibleForTesting  RouteAdvertisement(T route, Reason reason);  RouteAdvertisement(T route); static RouteAdvertisement<T> adding(T route); static RouteAdvertisement<T> replacing(T route); static RouteAdvertisement<T> withdrawing(T route); @Nonnull T getRoute(); @Nonnull Reason getReason(); boolean isWithdrawn(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString(); @Nonnull static Builder<T> builder(); @Nonnull Builder<T> toBuilder(); RouteAdvertisement<T> sanitizeForExport();  }