@Test public void testEquals() { StaticRoute sr = new StaticRoute(Prefix.ZERO, Ip.ZERO, "iface", null); new EqualsTester() .addEqualityGroup(sr, sr, new StaticRoute(Prefix.ZERO, Ip.ZERO, "iface", null)) .addEqualityGroup(new StaticRoute(Prefix.parse("1.1.1.1/32"), Ip.ZERO, "iface", null)) .addEqualityGroup( new StaticRoute(Prefix.parse("1.1.1.1/32"), Ip.parse("2.2.2.2"), "iface", null)) .addEqualityGroup( new StaticRoute(Prefix.parse("1.1.1.1/32"), Ip.parse("2.2.2.2"), "otherIface", null)) .addEqualityGroup( new StaticRoute(Prefix.parse("1.1.1.1/32"), Ip.parse("2.2.2.2"), "iface", 250)) .addEqualityGroup(new Object()) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) obj; return _network.equals(rhs._network) && Objects.equals(_nextHopIp, rhs._nextHopIp) && Objects.equals(_nextHopInterface, rhs._nextHopInterface) && Objects.equals(_distance, rhs._distance); }
StaticRoute implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) obj; return _network.equals(rhs._network) && Objects.equals(_nextHopIp, rhs._nextHopIp) && Objects.equals(_nextHopInterface, rhs._nextHopInterface) && Objects.equals(_distance, rhs._distance); } }
StaticRoute implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) obj; return _network.equals(rhs._network) && Objects.equals(_nextHopIp, rhs._nextHopIp) && Objects.equals(_nextHopInterface, rhs._nextHopInterface) && Objects.equals(_distance, rhs._distance); } StaticRoute(
      Prefix network,
      @Nullable Ip nextHopIp,
      @Nullable String nextHopInterface,
      @Nullable Integer distance); }
StaticRoute implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) obj; return _network.equals(rhs._network) && Objects.equals(_nextHopIp, rhs._nextHopIp) && Objects.equals(_nextHopInterface, rhs._nextHopInterface) && Objects.equals(_distance, rhs._distance); } StaticRoute(
      Prefix network,
      @Nullable Ip nextHopIp,
      @Nullable String nextHopInterface,
      @Nullable Integer distance); @Nonnull Prefix getNetwork(); @Nullable Ip getNextHopIp(); @Nullable String getNextHopInterface(); @Nullable Integer getDistance(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); }
StaticRoute implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) obj; return _network.equals(rhs._network) && Objects.equals(_nextHopIp, rhs._nextHopIp) && Objects.equals(_nextHopInterface, rhs._nextHopInterface) && Objects.equals(_distance, rhs._distance); } StaticRoute(
      Prefix network,
      @Nullable Ip nextHopIp,
      @Nullable String nextHopInterface,
      @Nullable Integer distance); @Nonnull Prefix getNetwork(); @Nullable Ip getNextHopIp(); @Nullable String getNextHopInterface(); @Nullable Integer getDistance(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }