ReplicationStoreMeta implements Serializable { @Override public boolean equals(Object obj) { return EqualsBuilder.reflectionEquals(this, obj, "rdbLastKeeperOffset", "keeperBeginOffset"); } ReplicationStoreMeta();  ReplicationStoreMeta(ReplicationStoreMeta proto); long getRdbFileSize(); String getRdbEofMark(); void setRdbFileSize(long rdbFileSize); void setRdbEofMark(String rdbEofMark); String getRdbFile(); void setRdbFile(String rdbFile); DefaultEndPoint getMasterAddress(); void setMasterAddress(DefaultEndPoint masterAddress); Long getBeginOffset(); void setBeginOffset(Long beginOffset); String getKeeperRunid(); void setKeeperRunid(String keeperRunid); String getCmdFilePrefix(); String getReplId(); void setReplId(String replId); Long getRdbLastOffset(); void setRdbLastOffset(Long rdbLastOffset); String getReplId2(); void setReplId2(String replId2); Long getSecondReplIdOffset(); void setSecondReplIdOffset(Long secondReplIdOffset); void setCmdFilePrefix(String cmdFilePrefix); KeeperState getKeeperState(); void setKeeperState(KeeperState keeperState); @Deprecated void setMasterRunid(String masterRunid); @Deprecated void setRdbLastKeeperOffset(Long rdbLastKeeperOffset); @Deprecated void setKeeperBeginOffset(Long keeperBeginOffset); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); static final String EMPTY_REPL_ID; static final long DEFAULT_BEGIN_OFFSET; static final long DEFAULT_END_OFFSET; static final long DEFAULT_SECOND_REPLID_OFFSET; }
@Test public void testEquals(){ ReplicationStoreMeta meta = createRandomMeta(); ReplicationStoreMeta meta2 = SerializationUtils.clone(meta); Assert.assertEquals(meta, meta2); ReplicationStoreMeta meta3 = new ReplicationStoreMeta(meta); Assert.assertEquals(meta, meta3); meta3.setBeginOffset(meta3.getBeginOffset()+1); Assert.assertNotEquals(meta, meta3); }