@Test public void testVoteEquals() { Vote v1 = new Vote("service", "username", "address", "1234"); assertEquals(v1, v1); assertEquals(v1.hashCode(), new Vote("service", "username", "address", "1234").hashCode()); assertEquals(v1, new Vote("service", "username", "address", "1234")); assertNotEquals(v1, new Object()); assertNotEquals(v1, null); assertNotEquals(v1, new Vote("service2", "username", "address", "1234")); assertNotEquals(v1, new Vote("service", "username1", "address", "1234")); assertNotEquals(v1, new Vote("service", "username", "address1", "1234")); assertNotEquals(v1, new Vote("service", "username", "address", "12345")); }
@Override public int hashCode() { int result = serviceName.hashCode(); result = 31 * result + username.hashCode(); result = 31 * result + address.hashCode(); result = 31 * result + timeStamp.hashCode(); return result; }
Vote { @Override public int hashCode() { int result = serviceName.hashCode(); result = 31 * result + username.hashCode(); result = 31 * result + address.hashCode(); result = 31 * result + timeStamp.hashCode(); return result; } }
Vote { @Override public int hashCode() { int result = serviceName.hashCode(); result = 31 * result + username.hashCode(); result = 31 * result + address.hashCode(); result = 31 * result + timeStamp.hashCode(); return result; } @Deprecated  Vote();  Vote(String serviceName, String username, String address, String timeStamp);  Vote(String serviceName, String username, String address, String timeStamp, byte[] additionalData);  Vote(Vote vote);  Vote(JsonObject jsonObject); }
Vote { @Override public int hashCode() { int result = serviceName.hashCode(); result = 31 * result + username.hashCode(); result = 31 * result + address.hashCode(); result = 31 * result + timeStamp.hashCode(); return result; } @Deprecated  Vote();  Vote(String serviceName, String username, String address, String timeStamp);  Vote(String serviceName, String username, String address, String timeStamp, byte[] additionalData);  Vote(Vote vote);  Vote(JsonObject jsonObject); @Override String toString(); @Deprecated void setServiceName(String serviceName); String getServiceName(); @Deprecated void setUsername(String username); String getUsername(); @Deprecated void setAddress(String address); String getAddress(); @Deprecated void setTimeStamp(String timeStamp); String getTimeStamp(); byte[] getAdditionalData(); JsonObject serialize(); @Override boolean equals(Object o); @Override int hashCode(); }
Vote { @Override public int hashCode() { int result = serviceName.hashCode(); result = 31 * result + username.hashCode(); result = 31 * result + address.hashCode(); result = 31 * result + timeStamp.hashCode(); return result; } @Deprecated  Vote();  Vote(String serviceName, String username, String address, String timeStamp);  Vote(String serviceName, String username, String address, String timeStamp, byte[] additionalData);  Vote(Vote vote);  Vote(JsonObject jsonObject); @Override String toString(); @Deprecated void setServiceName(String serviceName); String getServiceName(); @Deprecated void setUsername(String username); String getUsername(); @Deprecated void setAddress(String address); String getAddress(); @Deprecated void setTimeStamp(String timeStamp); String getTimeStamp(); byte[] getAdditionalData(); JsonObject serialize(); @Override boolean equals(Object o); @Override int hashCode();  }