@Test public void testEquals() { InterfaceOspfNeighbor neighbor1 = new InterfaceOspfNeighbor(Ip.parse("1.1.1.1")); neighbor1.setDesignated(true); InterfaceOspfNeighbor neighbor2 = new InterfaceOspfNeighbor(Ip.parse("1.1.1.1")); neighbor2.setDesignated(true); InterfaceOspfNeighbor neighbor3 = new InterfaceOspfNeighbor(Ip.parse("1.1.1.1")); neighbor3.setDesignated(false); new EqualsTester() .addEqualityGroup(neighbor1, neighbor2) .addEqualityGroup(neighbor3) .addEqualityGroup(new InterfaceOspfNeighbor(Ip.parse("1.1.1.2"))) .testEquals(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof InterfaceOspfNeighbor)) { return false; } InterfaceOspfNeighbor other = (InterfaceOspfNeighbor) o; return other.getIp().equals(_ip) && Objects.equals(_isDesignated, other.getDesignated()); }
InterfaceOspfNeighbor implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof InterfaceOspfNeighbor)) { return false; } InterfaceOspfNeighbor other = (InterfaceOspfNeighbor) o; return other.getIp().equals(_ip) && Objects.equals(_isDesignated, other.getDesignated()); } }
InterfaceOspfNeighbor implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof InterfaceOspfNeighbor)) { return false; } InterfaceOspfNeighbor other = (InterfaceOspfNeighbor) o; return other.getIp().equals(_ip) && Objects.equals(_isDesignated, other.getDesignated()); } InterfaceOspfNeighbor(@Nonnull Ip ip); }
InterfaceOspfNeighbor implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof InterfaceOspfNeighbor)) { return false; } InterfaceOspfNeighbor other = (InterfaceOspfNeighbor) o; return other.getIp().equals(_ip) && Objects.equals(_isDesignated, other.getDesignated()); } InterfaceOspfNeighbor(@Nonnull Ip ip); @Nonnull Ip getIp(); @Nullable Boolean getDesignated(); void setDesignated(@Nullable Boolean designated); @Override boolean equals(Object o); @Override int hashCode(); }
InterfaceOspfNeighbor implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof InterfaceOspfNeighbor)) { return false; } InterfaceOspfNeighbor other = (InterfaceOspfNeighbor) o; return other.getIp().equals(_ip) && Objects.equals(_isDesignated, other.getDesignated()); } InterfaceOspfNeighbor(@Nonnull Ip ip); @Nonnull Ip getIp(); @Nullable Boolean getDesignated(); void setDesignated(@Nullable Boolean designated); @Override boolean equals(Object o); @Override int hashCode();  }