package org.batfish.datamodel.collections;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import javax.annotation.Nonnull;
import org.batfish.datamodel.RipNeighbor;

public final class VerboseRipEdge implements Serializable, Comparable<VerboseRipEdge> {

  private static final String PROP_EDGE_SUMMARY = "edgeSummary";

  private static final String PROP_NODE1_SESSION = "node1Session";

  private static final String PROP_NODE2_SESSION = "node2Session";

  private static final long serialVersionUID = 1L;

  @Nonnull private final IpEdge _edgeSummary;
  @Nonnull private final RipNeighbor _session1;
  @Nonnull private final RipNeighbor _session2;

  @JsonCreator
  public VerboseRipEdge(
      @Nonnull @JsonProperty(PROP_NODE1_SESSION) RipNeighbor s1,
      @Nonnull @JsonProperty(PROP_NODE2_SESSION) RipNeighbor s2,
      @Nonnull @JsonProperty(PROP_EDGE_SUMMARY) IpEdge e) {
    this._session1 = s1;
    this._session2 = s2;
    this._edgeSummary = e;
  }

  @JsonProperty(PROP_EDGE_SUMMARY)
  public IpEdge getEdgeSummary() {
    return _edgeSummary;
  }

  @JsonProperty(PROP_NODE1_SESSION)
  public RipNeighbor getSession1() {
    return _session1;
  }

  @JsonProperty(PROP_NODE2_SESSION)
  public RipNeighbor getSession2() {
    return _session2;
  }

  @Override
  public int compareTo(VerboseRipEdge o) {
    int cmp = _edgeSummary.compareTo(o._edgeSummary);
    if (cmp != 0) {
      return cmp;
    }
    cmp = _session1.compareTo(o._session1);
    if (cmp != 0) {
      return cmp;
    }
    cmp = _session2.compareTo(o._session2);
    return cmp;
  }
}

@@ -310,36 +310,8 @@
 able
-, Comparable%3CVerboseRipEdge%3E
  %7B%0A%0A
@@ -1321,313 +1321,7 @@
 %0A  %7D
-%0A%0A  @Override%0A  public int compareTo(VerboseRipEdge o) %7B%0A    int cmp = _edgeSummary.compareTo(o._edgeSummary);%0A    if (cmp != 0) %7B%0A      return cmp;%0A    %7D%0A    cmp = _session1.compareTo(o._session1);%0A    if (cmp != 0) %7B%0A      return cmp;%0A    %7D%0A    cmp = _session2.compareTo(o._session2);%0A    return cmp;%0A  %7D
 %0A%7D%0A

remove Comparable implementation from VerboseRipEdge (#1763)