@Test public void testEqualsNotEqual() { DeviceEntity deviceEntity2 = new DeviceEntity("Smartphone", "Hello", "123"); assertThat(this.deviceEntity.equals(deviceEntity2), equalTo(false)); DeviceEntity deviceEntity3 = new DeviceEntity("Smartphone", "Hallo", "123"); assertThat(this.deviceEntity.equals(deviceEntity3), equalTo(false)); DeviceEntity deviceEntity4 = new DeviceEntity("Computer", "Hallo", "123"); assertThat(this.deviceEntity.equals(deviceEntity4), equalTo(false)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DeviceEntity that = (DeviceEntity) o; return this.persistentId == that.persistentId && this.name.equals(that.name) && this.type.equals(that.type) && this.id.equals(that.id); }
DeviceEntity extends Entity implements RegistryEntity { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DeviceEntity that = (DeviceEntity) o; return this.persistentId == that.persistentId && this.name.equals(that.name) && this.type.equals(that.type) && this.id.equals(that.id); } }
DeviceEntity extends Entity implements RegistryEntity { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DeviceEntity that = (DeviceEntity) o; return this.persistentId == that.persistentId && this.name.equals(that.name) && this.type.equals(that.type) && this.id.equals(that.id); } DeviceEntity();  DeviceEntity(String type, String name, String uri); }
DeviceEntity extends Entity implements RegistryEntity { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DeviceEntity that = (DeviceEntity) o; return this.persistentId == that.persistentId && this.name.equals(that.name) && this.type.equals(that.type) && this.id.equals(that.id); } DeviceEntity();  DeviceEntity(String type, String name, String uri); String getType(); void setType(String type); String getName(); void setName(String name); String getID(); void setID(String uri); @Override int getPersistentId(); @Override boolean equals(Object o); @Override int hashCode(); }
DeviceEntity extends Entity implements RegistryEntity { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DeviceEntity that = (DeviceEntity) o; return this.persistentId == that.persistentId && this.name.equals(that.name) && this.type.equals(that.type) && this.id.equals(that.id); } DeviceEntity();  DeviceEntity(String type, String name, String uri); String getType(); void setType(String type); String getName(); void setName(String name); String getID(); void setID(String uri); @Override int getPersistentId(); @Override boolean equals(Object o); @Override int hashCode();  }