@Test public void testHashCodeEqualsWithSameClass() { JiraVertex testVertex1 = new JiraVertex.Builder("com.actor", "action").withRevisionId("revisionId").markSpecial().build(); JiraVertex testVertex2 = new JiraVertex.Builder("com.actor", "action").withRevisionId("revisionId").markSpecial().build(); int vertex1HashCode = testVertex1.hashCode(); int vertex2HashCode = testVertex2.hashCode(); assertEquals(testVertex1, testVertex2); assertEquals(vertex1HashCode, vertex2HashCode); assertEquals(vertex1HashCode, testVertex1.hashCode()); assertEquals(vertex2HashCode, testVertex2.hashCode()); }
@Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), revisionId); }
JiraVertex extends Vertex { @Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), revisionId); } }
JiraVertex extends Vertex { @Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), revisionId); } @SuppressWarnings("squid:S00107") // private constructor used only in Builder private  JiraVertex(String actor, String action, boolean isSpecial, String filePath, List<Integer> lineNumbers,
                       String location, Date date, String revisionId); }
JiraVertex extends Vertex { @Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), revisionId); } @SuppressWarnings("squid:S00107") // private constructor used only in Builder private  JiraVertex(String actor, String action, boolean isSpecial, String filePath, List<Integer> lineNumbers,
                       String location, Date date, String revisionId); Date getDate(); String getRevisionId(); @Override boolean equals(Object o); @Override int hashCode(); }
JiraVertex extends Vertex { @Override public int hashCode() { return Objects.hash(getActor(), getAction(), isSpecial(), revisionId); } @SuppressWarnings("squid:S00107") // private constructor used only in Builder private  JiraVertex(String actor, String action, boolean isSpecial, String filePath, List<Integer> lineNumbers,
                       String location, Date date, String revisionId); Date getDate(); String getRevisionId(); @Override boolean equals(Object o); @Override int hashCode();  }