@Test public void testEquals() { TopologyContext.Builder builder = TopologyContext.builder(); TopologyContext base = builder.build(); MutableValueGraph<BgpPeerConfigId, BgpSessionProperties> bgpTopology = ValueGraphBuilder.directed().build(); bgpTopology.addNode(new BgpPeerConfigId("a", "b", "c")); MutableValueGraph<IpsecPeerConfigId, IpsecSession> ipsecTopology = ValueGraphBuilder.directed().allowsSelfLoops(false).build(); ipsecTopology.putEdgeValue( new IpsecPeerConfigId("a", "b"), new IpsecPeerConfigId("c", "d"), IpsecSession.builder().build()); MutableNetwork<EigrpNeighborConfigId, EigrpEdge> eigrpTopology = NetworkBuilder.directed().build(); eigrpTopology.addNode(new EigrpNeighborConfigId(1L, "a", "b", "c")); MutableNetwork<IsisNode, IsisEdge> isisTopology = NetworkBuilder.directed().build(); isisTopology.addNode(new IsisNode("a", "b")); MutableValueGraph<OspfNeighborConfigId, OspfSessionProperties> ospfTopology = ValueGraphBuilder.directed().build(); ospfTopology.addNode( new OspfNeighborConfigId( "a", "b", "c", "d", ConcreteInterfaceAddress.parse("192.0.2.0/31"))); MutableGraph<VxlanNode> vxlanTopology = GraphBuilder.undirected().allowsSelfLoops(false).build(); vxlanTopology.addNode(new VxlanNode("a", 5)); new EqualsTester() .addEqualityGroup(new Object()) .addEqualityGroup(base, base, builder.build()) .addEqualityGroup(builder.setBgpTopology(new BgpTopology(bgpTopology)).build()) .addEqualityGroup(builder.setEigrpTopology(new EigrpTopology(eigrpTopology)).build()) .addEqualityGroup(builder.setIpsecTopology(new IpsecTopology(ipsecTopology)).build()) .addEqualityGroup(builder.setIsisTopology(new IsisTopology(isisTopology)).build()) .addEqualityGroup( builder .setLayer1LogicalTopology( Optional.of( new Layer1Topology(ImmutableList.of(new Layer1Edge("a", "b", "c", "d"))))) .build()) .addEqualityGroup( builder .setLayer2Topology( Optional.of( Layer2Topology.fromDomains( ImmutableList.of(ImmutableSet.of(new Layer2Node("a", "b", 5)))))) .build()) .addEqualityGroup( builder .setLayer3Topology(new Topology(ImmutableSortedSet.of(Edge.of("a", "b", "c", "d")))) .build()) .addEqualityGroup(builder.setOspfTopology(new OspfTopology(ospfTopology)).build()) .addEqualityGroup( builder .setRawLayer1PhysicalTopology( Optional.of( new Layer1Topology(ImmutableList.of(new Layer1Edge("a", "b", "c", "d"))))) .build()) .addEqualityGroup( builder .setTunnelTopology( TunnelTopology.builder() .add(NodeInterfacePair.of("n1", "i1"), NodeInterfacePair.of("n2", "i2")) .build()) .build()) .addEqualityGroup(builder.setVxlanTopology(new VxlanTopology(vxlanTopology)).build()) .testEquals(); }
@Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof TopologyContext)) { return false; } TopologyContext rhs = (TopologyContext) obj; return _bgpTopology.equals(rhs._bgpTopology) && _eigrpTopology.equals(rhs._eigrpTopology) && _ipsecTopology.equals(rhs._ipsecTopology) && _isisTopology.equals(rhs._isisTopology) && _layer1LogicalTopology.equals(rhs._layer1LogicalTopology) && _layer2Topology.equals(rhs._layer2Topology) && _layer3Topology.equals(rhs._layer3Topology) && _ospfTopology.equals(rhs._ospfTopology) && _rawLayer1PhysicalTopology.equals(rhs._rawLayer1PhysicalTopology) && _tunnelTopology.equals(rhs._tunnelTopology) && _vxlanTopology.equals(rhs._vxlanTopology); }
TopologyContext implements TopologyContainer { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof TopologyContext)) { return false; } TopologyContext rhs = (TopologyContext) obj; return _bgpTopology.equals(rhs._bgpTopology) && _eigrpTopology.equals(rhs._eigrpTopology) && _ipsecTopology.equals(rhs._ipsecTopology) && _isisTopology.equals(rhs._isisTopology) && _layer1LogicalTopology.equals(rhs._layer1LogicalTopology) && _layer2Topology.equals(rhs._layer2Topology) && _layer3Topology.equals(rhs._layer3Topology) && _ospfTopology.equals(rhs._ospfTopology) && _rawLayer1PhysicalTopology.equals(rhs._rawLayer1PhysicalTopology) && _tunnelTopology.equals(rhs._tunnelTopology) && _vxlanTopology.equals(rhs._vxlanTopology); } }
TopologyContext implements TopologyContainer { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof TopologyContext)) { return false; } TopologyContext rhs = (TopologyContext) obj; return _bgpTopology.equals(rhs._bgpTopology) && _eigrpTopology.equals(rhs._eigrpTopology) && _ipsecTopology.equals(rhs._ipsecTopology) && _isisTopology.equals(rhs._isisTopology) && _layer1LogicalTopology.equals(rhs._layer1LogicalTopology) && _layer2Topology.equals(rhs._layer2Topology) && _layer3Topology.equals(rhs._layer3Topology) && _ospfTopology.equals(rhs._ospfTopology) && _rawLayer1PhysicalTopology.equals(rhs._rawLayer1PhysicalTopology) && _tunnelTopology.equals(rhs._tunnelTopology) && _vxlanTopology.equals(rhs._vxlanTopology); } private  TopologyContext(
      BgpTopology bgpTopology,
      EigrpTopology eigrpTopology,
      IpsecTopology ipsecTopology,
      IsisTopology isisTopology,
      Optional<Layer1Topology> layer1LogicalTopology,
      Optional<Layer2Topology> layer2Topology,
      Topology layer3Topology,
      OspfTopology ospfTopology,
      Optional<Layer1Topology> rawLayer1PhysicalTopology,
      TunnelTopology tunnelTopology,
      VxlanTopology vxlanTopology); }
TopologyContext implements TopologyContainer { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof TopologyContext)) { return false; } TopologyContext rhs = (TopologyContext) obj; return _bgpTopology.equals(rhs._bgpTopology) && _eigrpTopology.equals(rhs._eigrpTopology) && _ipsecTopology.equals(rhs._ipsecTopology) && _isisTopology.equals(rhs._isisTopology) && _layer1LogicalTopology.equals(rhs._layer1LogicalTopology) && _layer2Topology.equals(rhs._layer2Topology) && _layer3Topology.equals(rhs._layer3Topology) && _ospfTopology.equals(rhs._ospfTopology) && _rawLayer1PhysicalTopology.equals(rhs._rawLayer1PhysicalTopology) && _tunnelTopology.equals(rhs._tunnelTopology) && _vxlanTopology.equals(rhs._vxlanTopology); } private  TopologyContext(
      BgpTopology bgpTopology,
      EigrpTopology eigrpTopology,
      IpsecTopology ipsecTopology,
      IsisTopology isisTopology,
      Optional<Layer1Topology> layer1LogicalTopology,
      Optional<Layer2Topology> layer2Topology,
      Topology layer3Topology,
      OspfTopology ospfTopology,
      Optional<Layer1Topology> rawLayer1PhysicalTopology,
      TunnelTopology tunnelTopology,
      VxlanTopology vxlanTopology); static @Nonnull Builder builder(); @Override @Nonnull BgpTopology getBgpTopology(); @Override @Nonnull EigrpTopology getEigrpTopology(); @Nonnull IpsecTopology getIpsecTopology(); @Override @Nonnull IsisTopology getIsisTopology(); @Nonnull Optional<Layer1Topology> getLayer1LogicalTopology(); @Override @Nonnull Optional<Layer2Topology> getLayer2Topology(); @Override @Nonnull Topology getLayer3Topology(); @Override @Nonnull OspfTopology getOspfTopology(); @Nonnull Optional<Layer1Topology> getRawLayer1PhysicalTopology(); @Override @Nonnull VxlanTopology getVxlanTopology(); @Override @Nonnull TunnelTopology getTunnelTopology(); @Override boolean equals(@Nullable Object obj); @Override int hashCode(); @Nonnull Builder toBuilder(); }
TopologyContext implements TopologyContainer { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof TopologyContext)) { return false; } TopologyContext rhs = (TopologyContext) obj; return _bgpTopology.equals(rhs._bgpTopology) && _eigrpTopology.equals(rhs._eigrpTopology) && _ipsecTopology.equals(rhs._ipsecTopology) && _isisTopology.equals(rhs._isisTopology) && _layer1LogicalTopology.equals(rhs._layer1LogicalTopology) && _layer2Topology.equals(rhs._layer2Topology) && _layer3Topology.equals(rhs._layer3Topology) && _ospfTopology.equals(rhs._ospfTopology) && _rawLayer1PhysicalTopology.equals(rhs._rawLayer1PhysicalTopology) && _tunnelTopology.equals(rhs._tunnelTopology) && _vxlanTopology.equals(rhs._vxlanTopology); } private  TopologyContext(
      BgpTopology bgpTopology,
      EigrpTopology eigrpTopology,
      IpsecTopology ipsecTopology,
      IsisTopology isisTopology,
      Optional<Layer1Topology> layer1LogicalTopology,
      Optional<Layer2Topology> layer2Topology,
      Topology layer3Topology,
      OspfTopology ospfTopology,
      Optional<Layer1Topology> rawLayer1PhysicalTopology,
      TunnelTopology tunnelTopology,
      VxlanTopology vxlanTopology); static @Nonnull Builder builder(); @Override @Nonnull BgpTopology getBgpTopology(); @Override @Nonnull EigrpTopology getEigrpTopology(); @Nonnull IpsecTopology getIpsecTopology(); @Override @Nonnull IsisTopology getIsisTopology(); @Nonnull Optional<Layer1Topology> getLayer1LogicalTopology(); @Override @Nonnull Optional<Layer2Topology> getLayer2Topology(); @Override @Nonnull Topology getLayer3Topology(); @Override @Nonnull OspfTopology getOspfTopology(); @Nonnull Optional<Layer1Topology> getRawLayer1PhysicalTopology(); @Override @Nonnull VxlanTopology getVxlanTopology(); @Override @Nonnull TunnelTopology getTunnelTopology(); @Override boolean equals(@Nullable Object obj); @Override int hashCode(); @Nonnull Builder toBuilder();  }