@Test public void testHashCode() { SerialId testSerialId0 = new SerialId("bob", 3, 6L, 12); SerialId testSerialId1 = new SerialId("bob", 3, 6L, 12); SerialId testSerialId2 = new SerialId("bob", 3, 6L, 16); assertEquals(testSerialId0.hashCode(), testSerialId1.hashCode()); assertNotEquals(testSerialId0.hashCode(), testSerialId2.hashCode()); testSerialId2.setStreamId(null); assertNotEquals(testSerialId1.hashCode(), testSerialId2.hashCode()); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (bundleId ^ (bundleId >>> 32)); result = prime * result + bundleSize; result = prime * result + recordId; result = prime * result + ((streamId == null) ? 0 : streamId.hashCode()); return result; }
SerialId { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (bundleId ^ (bundleId >>> 32)); result = prime * result + bundleSize; result = prime * result + recordId; result = prime * result + ((streamId == null) ? 0 : streamId.hashCode()); return result; } }
SerialId { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (bundleId ^ (bundleId >>> 32)); result = prime * result + bundleSize; result = prime * result + recordId; result = prime * result + ((streamId == null) ? 0 : streamId.hashCode()); return result; } SerialId();  SerialId(String streamId, int bundleSize, 
         long bundleId, int recordId);  SerialId(String serialId);  SerialId(String streamId, 
         int bundleSize, long bundleId, int recordId,
         long serialNumber);  SerialId(JsonNode jsonNode); }
SerialId { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (bundleId ^ (bundleId >>> 32)); result = prime * result + bundleSize; result = prime * result + recordId; result = prime * result + ((streamId == null) ? 0 : streamId.hashCode()); return result; } SerialId();  SerialId(String streamId, int bundleSize, 
         long bundleId, int recordId);  SerialId(String serialId);  SerialId(String streamId, 
         int bundleSize, long bundleId, int recordId,
         long serialNumber);  SerialId(JsonNode jsonNode); int nextRecordId(); long nextSerialNumber(); SerialId nextSerialId(); synchronized long increment(); SerialId clone(); boolean isRightAfter(SerialId prev); boolean isRightBefore(SerialId next); String getStreamId(); SerialId setStreamId(String streamId); int getBundleSize(); SerialId setBundleSize(int bundleSize); long getBundleId(); SerialId setBundleId(long bundleId); SerialId addBundleId(long num); int getRecordId(); SerialId setRecordId(int recordId); SerialId addRecordId(int num); long getSerialNumber(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
SerialId { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (bundleId ^ (bundleId >>> 32)); result = prime * result + bundleSize; result = prime * result + recordId; result = prime * result + ((streamId == null) ? 0 : streamId.hashCode()); return result; } SerialId();  SerialId(String streamId, int bundleSize, 
         long bundleId, int recordId);  SerialId(String serialId);  SerialId(String streamId, 
         int bundleSize, long bundleId, int recordId,
         long serialNumber);  SerialId(JsonNode jsonNode); int nextRecordId(); long nextSerialNumber(); SerialId nextSerialId(); synchronized long increment(); SerialId clone(); boolean isRightAfter(SerialId prev); boolean isRightBefore(SerialId next); String getStreamId(); SerialId setStreamId(String streamId); int getBundleSize(); SerialId setBundleSize(int bundleSize); long getBundleId(); SerialId setBundleId(long bundleId); SerialId addBundleId(long num); int getRecordId(); SerialId setRecordId(int recordId); SerialId addRecordId(int num); long getSerialNumber(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }