@Test public void shouldCheckIfGivenRecordIsSameBasedOnKeyFields() { Properties existingProperties = new Properties(); existingProperties.setProperty("existingKey", "existingValue"); Properties updatedProperties = new Properties(); updatedProperties.setProperty("updatedKey", "updatedValue"); ModulePropertiesRecord existing = new ModulePropertiesRecord(existingProperties, "module", "1.0.0", "file1.properties", false); assertTrue(existing.sameAs(new ModulePropertiesRecord(updatedProperties, "module", "1.0.0", "file1.properties", false))); assertFalse(existing.sameAs(new ModulePropertiesRecord(existingProperties, "differentModule", "module", "file1.properties", false))); assertFalse(existing.sameAs(new ModulePropertiesRecord(existingProperties, "module", "1.0.0", "differentFile.properties", false))); assertFalse(existing.sameAs(new ModulePropertiesRecord(existingProperties, "module", "1.0.0", "file1.properties", true))); }
public boolean sameAs(Object dataObject) { ModulePropertiesRecord record = (ModulePropertiesRecord) dataObject; return new EqualsBuilder() .append(this.version, record.version) .append(this.bundle, record.bundle) .append(this.filename, record.filename) .append(this.raw, record.raw) .isEquals(); }
ModulePropertiesRecord { public boolean sameAs(Object dataObject) { ModulePropertiesRecord record = (ModulePropertiesRecord) dataObject; return new EqualsBuilder() .append(this.version, record.version) .append(this.bundle, record.bundle) .append(this.filename, record.filename) .append(this.raw, record.raw) .isEquals(); } }
ModulePropertiesRecord { public boolean sameAs(Object dataObject) { ModulePropertiesRecord record = (ModulePropertiesRecord) dataObject; return new EqualsBuilder() .append(this.version, record.version) .append(this.bundle, record.bundle) .append(this.filename, record.filename) .append(this.raw, record.raw) .isEquals(); } ModulePropertiesRecord();  ModulePropertiesRecord(Map<String, Object> properties, String bundle, String version, String filename, boolean raw);  ModulePropertiesRecord(Properties props, String bundle, String version, String filename, boolean raw); }
ModulePropertiesRecord { public boolean sameAs(Object dataObject) { ModulePropertiesRecord record = (ModulePropertiesRecord) dataObject; return new EqualsBuilder() .append(this.version, record.version) .append(this.bundle, record.bundle) .append(this.filename, record.filename) .append(this.raw, record.raw) .isEquals(); } ModulePropertiesRecord();  ModulePropertiesRecord(Map<String, Object> properties, String bundle, String version, String filename, boolean raw);  ModulePropertiesRecord(Properties props, String bundle, String version, String filename, boolean raw); static ModulePropertiesRecord buildFrom(File file); Map<String, Object> getProperties(); void setProperties(Map<String, Object> properties); String getBundle(); void setBundle(String bundle); String getVersion(); void setVersion(String version); String getFilename(); void setFilename(String filename); boolean isRaw(); void setRaw(boolean raw); boolean sameAs(Object dataObject); @Override int hashCode(); @Override String toString(); @Override boolean equals(Object obj); }
ModulePropertiesRecord { public boolean sameAs(Object dataObject) { ModulePropertiesRecord record = (ModulePropertiesRecord) dataObject; return new EqualsBuilder() .append(this.version, record.version) .append(this.bundle, record.bundle) .append(this.filename, record.filename) .append(this.raw, record.raw) .isEquals(); } ModulePropertiesRecord();  ModulePropertiesRecord(Map<String, Object> properties, String bundle, String version, String filename, boolean raw);  ModulePropertiesRecord(Properties props, String bundle, String version, String filename, boolean raw); static ModulePropertiesRecord buildFrom(File file); Map<String, Object> getProperties(); void setProperties(Map<String, Object> properties); String getBundle(); void setBundle(String bundle); String getVersion(); void setVersion(String version); String getFilename(); void setFilename(String filename); boolean isRaw(); void setRaw(boolean raw); boolean sameAs(Object dataObject); @Override int hashCode(); @Override String toString(); @Override boolean equals(Object obj); @Ignore
    static final String PROPERTIES_FILE_EXTENSION; }