@Test public void equalsSame() { final MfgData a = new MfgData(code, name); final MfgData b = new MfgData(code, name); assertTrue(a.equals(b)); assertTrue(b.equals(a)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof MfgData)) return false; final MfgData d = (MfgData) o; return code.equals(d.code) && name.equals(d.name); }
MfgData { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof MfgData)) return false; final MfgData d = (MfgData) o; return code.equals(d.code) && name.equals(d.name); } }
MfgData { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof MfgData)) return false; final MfgData d = (MfgData) o; return code.equals(d.code) && name.equals(d.name); } MfgData(String code, String name); }
MfgData { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof MfgData)) return false; final MfgData d = (MfgData) o; return code.equals(d.code) && name.equals(d.name); } MfgData(String code, String name); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
MfgData { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof MfgData)) return false; final MfgData d = (MfgData) o; return code.equals(d.code) && name.equals(d.name); } MfgData(String code, String name); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); final String code; final String name; }