@Test public void testEquality() { ClockEntry v1 = new ClockEntry((short) 0, 1); ClockEntry v2 = new ClockEntry((short) 0, 1); assertTrue(v1.equals(v1)); assertTrue(!v1.equals(null)); assertEquals(v1, v2); v1 = new ClockEntry((short) 0, 1); v2 = new ClockEntry((short) 0, 2); assertTrue(!v1.equals(v2)); v1 = new ClockEntry(Short.MAX_VALUE, 256); v2 = new ClockEntry(Short.MAX_VALUE, 256); assertEquals(v1, v2); }
@Override public boolean equals(Object o) { if(this == o) return true; if(o == null) return false; if(o.getClass().equals(ClockEntry.class)) { ClockEntry v = (ClockEntry) o; return v.getNodeId() == getNodeId() && v.getVersion() == getVersion(); } else { return false; } }
ClockEntry implements Cloneable, Serializable { @Override public boolean equals(Object o) { if(this == o) return true; if(o == null) return false; if(o.getClass().equals(ClockEntry.class)) { ClockEntry v = (ClockEntry) o; return v.getNodeId() == getNodeId() && v.getVersion() == getVersion(); } else { return false; } } }
ClockEntry implements Cloneable, Serializable { @Override public boolean equals(Object o) { if(this == o) return true; if(o == null) return false; if(o.getClass().equals(ClockEntry.class)) { ClockEntry v = (ClockEntry) o; return v.getNodeId() == getNodeId() && v.getVersion() == getVersion(); } else { return false; } } @JsonCreator  ClockEntry(@JsonProperty("nodeId") short nodeId, 
                      @JsonProperty("version") long version); }
ClockEntry implements Cloneable, Serializable { @Override public boolean equals(Object o) { if(this == o) return true; if(o == null) return false; if(o.getClass().equals(ClockEntry.class)) { ClockEntry v = (ClockEntry) o; return v.getNodeId() == getNodeId() && v.getVersion() == getVersion(); } else { return false; } } @JsonCreator  ClockEntry(@JsonProperty("nodeId") short nodeId, 
                      @JsonProperty("version") long version); @Override ClockEntry clone(); short getNodeId(); long getVersion(); ClockEntry incremented(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
ClockEntry implements Cloneable, Serializable { @Override public boolean equals(Object o) { if(this == o) return true; if(o == null) return false; if(o.getClass().equals(ClockEntry.class)) { ClockEntry v = (ClockEntry) o; return v.getNodeId() == getNodeId() && v.getVersion() == getVersion(); } else { return false; } } @JsonCreator  ClockEntry(@JsonProperty("nodeId") short nodeId, 
                      @JsonProperty("version") long version); @Override ClockEntry clone(); short getNodeId(); long getVersion(); ClockEntry incremented(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }