@Test public void testEquals() { BlueprintConfigEntityPK pk = new BlueprintConfigEntityPK(); BlueprintConfigEntityPK pk2 = new BlueprintConfigEntityPK(); pk.setBlueprintName("foo"); pk.setType("core-site"); pk2.setBlueprintName("foo"); pk2.setType("core-site"); assertEquals(pk, pk2); assertEquals(pk2, pk); pk.setBlueprintName("foo2"); assertFalse(pk.equals(pk2)); assertFalse(pk2.equals(pk)); pk2.setBlueprintName("foo2"); assertEquals(pk, pk2); assertEquals(pk2, pk); pk.setType("other-type"); assertFalse(pk.equals(pk2)); assertFalse(pk2.equals(pk)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BlueprintConfigEntityPK that = (BlueprintConfigEntityPK) o; return this.blueprintName.equals(that.blueprintName) && this.type.equals(that.type); }
BlueprintConfigEntityPK { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BlueprintConfigEntityPK that = (BlueprintConfigEntityPK) o; return this.blueprintName.equals(that.blueprintName) && this.type.equals(that.type); } }
BlueprintConfigEntityPK { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BlueprintConfigEntityPK that = (BlueprintConfigEntityPK) o; return this.blueprintName.equals(that.blueprintName) && this.type.equals(that.type); }  }
BlueprintConfigEntityPK { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BlueprintConfigEntityPK that = (BlueprintConfigEntityPK) o; return this.blueprintName.equals(that.blueprintName) && this.type.equals(that.type); }  String getBlueprintName(); void setBlueprintName(String blueprintName); String getType(); void setType(String type); @Override boolean equals(Object o); @Override int hashCode(); }
BlueprintConfigEntityPK { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BlueprintConfigEntityPK that = (BlueprintConfigEntityPK) o; return this.blueprintName.equals(that.blueprintName) && this.type.equals(that.type); }  String getBlueprintName(); void setBlueprintName(String blueprintName); String getType(); void setType(String type); @Override boolean equals(Object o); @Override int hashCode();  }