@Test public void testToBuilder() { GeneratedRoute gr = GeneratedRoute.builder().setNetwork(Prefix.parse("1.1.1.0/24")).setMetric(1L).build(); assertThat(gr.toBuilder().build(), equalTo(gr)); }
@Override public Builder toBuilder() { return new Builder() .setNetwork(getNetwork()) .setAdmin(getAdministrativeCost()) .setNonForwarding(getNonForwarding()) .setNonRouting(getNonRouting()) .setMetric(firstNonNull(getMetric(), 0L)) .setNextHopInterface(getNextHopInterface()) .setNextHopIp(getNextHopIp()) .setTag(getTag()) .setAsPath(getAsPath()) .setAttributePolicy(getAttributePolicy()) .setCommunities(getCommunities()) .setDiscard(getDiscard()) .setGenerationPolicy(getGenerationPolicy()); }
GeneratedRoute extends AbstractRoute implements Comparable<GeneratedRoute> { @Override public Builder toBuilder() { return new Builder() .setNetwork(getNetwork()) .setAdmin(getAdministrativeCost()) .setNonForwarding(getNonForwarding()) .setNonRouting(getNonRouting()) .setMetric(firstNonNull(getMetric(), 0L)) .setNextHopInterface(getNextHopInterface()) .setNextHopIp(getNextHopIp()) .setTag(getTag()) .setAsPath(getAsPath()) .setAttributePolicy(getAttributePolicy()) .setCommunities(getCommunities()) .setDiscard(getDiscard()) .setGenerationPolicy(getGenerationPolicy()); } }
GeneratedRoute extends AbstractRoute implements Comparable<GeneratedRoute> { @Override public Builder toBuilder() { return new Builder() .setNetwork(getNetwork()) .setAdmin(getAdministrativeCost()) .setNonForwarding(getNonForwarding()) .setNonRouting(getNonRouting()) .setMetric(firstNonNull(getMetric(), 0L)) .setNextHopInterface(getNextHopInterface()) .setNextHopIp(getNextHopIp()) .setTag(getTag()) .setAsPath(getAsPath()) .setAttributePolicy(getAttributePolicy()) .setCommunities(getCommunities()) .setDiscard(getDiscard()) .setGenerationPolicy(getGenerationPolicy()); } private  GeneratedRoute(
      Prefix network,
      int administrativeCost,
      Ip nextHopIp,
      AsPath asPath,
      @Nullable String attributePolicy,
      @Nullable SortedSet<Community> communities,
      boolean discard,
      @Nullable String generationPolicy,
      long metric,
      String nextHopInterface,
      long tag,
      boolean nonForwarding,
      boolean nonRouting); }
GeneratedRoute extends AbstractRoute implements Comparable<GeneratedRoute> { @Override public Builder toBuilder() { return new Builder() .setNetwork(getNetwork()) .setAdmin(getAdministrativeCost()) .setNonForwarding(getNonForwarding()) .setNonRouting(getNonRouting()) .setMetric(firstNonNull(getMetric(), 0L)) .setNextHopInterface(getNextHopInterface()) .setNextHopIp(getNextHopIp()) .setTag(getTag()) .setAsPath(getAsPath()) .setAttributePolicy(getAttributePolicy()) .setCommunities(getCommunities()) .setDiscard(getDiscard()) .setGenerationPolicy(getGenerationPolicy()); } private  GeneratedRoute(
      Prefix network,
      int administrativeCost,
      Ip nextHopIp,
      AsPath asPath,
      @Nullable String attributePolicy,
      @Nullable SortedSet<Community> communities,
      boolean discard,
      @Nullable String generationPolicy,
      long metric,
      String nextHopInterface,
      long tag,
      boolean nonForwarding,
      boolean nonRouting); static Builder builder(); @JsonProperty(PROP_AS_PATH) AsPath getAsPath(); @Nullable @JsonProperty(PROP_ATTRIBUTE_POLICY) String getAttributePolicy(); @JsonProperty(PROP_ATTRIBUTE_POLICY_SOURCES) SortedSet<String> getAttributePolicySources(); @Nonnull @JsonProperty(PROP_COMMUNITIES) SortedSet<Community> getCommunities(); @JsonProperty(PROP_DISCARD) boolean getDiscard(); @Nullable @JsonProperty(PROP_GENERATION_POLICY) String getGenerationPolicy(); @JsonProperty(PROP_GENERATION_POLICY_SOURCES) SortedSet<String> getGenerationPolicySources(); @JsonIgnore(false) @JsonProperty(PROP_METRIC) @Override Long getMetric(); @Nonnull @Override String getNextHopInterface(); @Nonnull @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_IP) @Override Ip getNextHopIp(); @Override RoutingProtocol getProtocol(); @Override int compareTo(GeneratedRoute rhs); @JsonProperty(PROP_ATTRIBUTE_POLICY_SOURCES) void setAttributePolicySources(SortedSet<String> attributePolicySources); @JsonProperty(PROP_GENERATION_POLICY_SOURCES) void setGenerationPolicySources(SortedSet<String> generationPolicySources); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); }
GeneratedRoute extends AbstractRoute implements Comparable<GeneratedRoute> { @Override public Builder toBuilder() { return new Builder() .setNetwork(getNetwork()) .setAdmin(getAdministrativeCost()) .setNonForwarding(getNonForwarding()) .setNonRouting(getNonRouting()) .setMetric(firstNonNull(getMetric(), 0L)) .setNextHopInterface(getNextHopInterface()) .setNextHopIp(getNextHopIp()) .setTag(getTag()) .setAsPath(getAsPath()) .setAttributePolicy(getAttributePolicy()) .setCommunities(getCommunities()) .setDiscard(getDiscard()) .setGenerationPolicy(getGenerationPolicy()); } private  GeneratedRoute(
      Prefix network,
      int administrativeCost,
      Ip nextHopIp,
      AsPath asPath,
      @Nullable String attributePolicy,
      @Nullable SortedSet<Community> communities,
      boolean discard,
      @Nullable String generationPolicy,
      long metric,
      String nextHopInterface,
      long tag,
      boolean nonForwarding,
      boolean nonRouting); static Builder builder(); @JsonProperty(PROP_AS_PATH) AsPath getAsPath(); @Nullable @JsonProperty(PROP_ATTRIBUTE_POLICY) String getAttributePolicy(); @JsonProperty(PROP_ATTRIBUTE_POLICY_SOURCES) SortedSet<String> getAttributePolicySources(); @Nonnull @JsonProperty(PROP_COMMUNITIES) SortedSet<Community> getCommunities(); @JsonProperty(PROP_DISCARD) boolean getDiscard(); @Nullable @JsonProperty(PROP_GENERATION_POLICY) String getGenerationPolicy(); @JsonProperty(PROP_GENERATION_POLICY_SOURCES) SortedSet<String> getGenerationPolicySources(); @JsonIgnore(false) @JsonProperty(PROP_METRIC) @Override Long getMetric(); @Nonnull @Override String getNextHopInterface(); @Nonnull @JsonIgnore(false) @JsonProperty(PROP_NEXT_HOP_IP) @Override Ip getNextHopIp(); @Override RoutingProtocol getProtocol(); @Override int compareTo(GeneratedRoute rhs); @JsonProperty(PROP_ATTRIBUTE_POLICY_SOURCES) void setAttributePolicySources(SortedSet<String> attributePolicySources); @JsonProperty(PROP_GENERATION_POLICY_SOURCES) void setGenerationPolicySources(SortedSet<String> generationPolicySources); @Override Builder toBuilder(); @Override boolean equals(@Nullable Object o); @Override int hashCode();  }