@Test public void notEqualsOtherType() { final MfgData osd = new MfgData(code, name); assertFalse(osd.equals("bogus")); assertFalse("bogus".equals(osd)); }
@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; }