@Test public void testEquals() { new EqualsTester() .addEqualityGroup( EMPTY, EMPTY, new OspfTopology(ValueGraphBuilder.directed().allowsSelfLoops(false).build())) .addEqualityGroup(nonTrivialTopology()) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OspfTopology topology = (OspfTopology) o; return _graph.equals(topology._graph); }
OspfTopology { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OspfTopology topology = (OspfTopology) o; return _graph.equals(topology._graph); } }
OspfTopology { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OspfTopology topology = (OspfTopology) o; return _graph.equals(topology._graph); } OspfTopology(ValueGraph<OspfNeighborConfigId, OspfSessionProperties> graph); }
OspfTopology { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OspfTopology topology = (OspfTopology) o; return _graph.equals(topology._graph); } OspfTopology(ValueGraph<OspfNeighborConfigId, OspfSessionProperties> graph); @Nonnull Set<OspfNeighborConfigId> neighbors(OspfNeighborConfigId node); @Nonnull Set<EdgeId> edges(); @JsonProperty(PROP_NODES) @Nonnull Set<OspfNeighborConfigId> getNodes(); @Nonnull Optional<OspfSessionProperties> getSession(EdgeId id); @Nonnull Set<EdgeId> incomingEdges(OspfNeighborConfigId head); static EdgeId makeEdge(OspfNeighborConfigId tail, OspfNeighborConfigId head); @Override boolean equals(@Nullable Object o); @JsonIgnore ValueGraph<OspfNeighborConfigId, OspfSessionProperties> getGraph(); @Override int hashCode(); }
OspfTopology { @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OspfTopology topology = (OspfTopology) o; return _graph.equals(topology._graph); } OspfTopology(ValueGraph<OspfNeighborConfigId, OspfSessionProperties> graph); @Nonnull Set<OspfNeighborConfigId> neighbors(OspfNeighborConfigId node); @Nonnull Set<EdgeId> edges(); @JsonProperty(PROP_NODES) @Nonnull Set<OspfNeighborConfigId> getNodes(); @Nonnull Optional<OspfSessionProperties> getSession(EdgeId id); @Nonnull Set<EdgeId> incomingEdges(OspfNeighborConfigId head); static EdgeId makeEdge(OspfNeighborConfigId tail, OspfNeighborConfigId head); @Override boolean equals(@Nullable Object o); @JsonIgnore ValueGraph<OspfNeighborConfigId, OspfSessionProperties> getGraph(); @Override int hashCode(); static final OspfTopology EMPTY; }