@Test public void hashCodeTest() { Column column1 = Column.create(1, 10, 65000); Column column2 = Column.create(1, 10, 65000); assertEquals(column1.hashCode(), column2.hashCode()); assertNotEquals(column1.hashCode(), Column.DEFAULT.hashCode()); }
@Override public int hashCode() { if (this.defaultColumn) { return new HashCodeBuilder(31, 47).append(true).toHashCode(); } return new HashCodeBuilder(31, 47) .append(this.rowID) .append(this.columnID) .append(this.rowKey) .append(this.columnKey) .append(this.timestamp) .toHashCode(); }
Column implements Record { @Override public int hashCode() { if (this.defaultColumn) { return new HashCodeBuilder(31, 47).append(true).toHashCode(); } return new HashCodeBuilder(31, 47) .append(this.rowID) .append(this.columnID) .append(this.rowKey) .append(this.columnKey) .append(this.timestamp) .toHashCode(); } }
Column implements Record { @Override public int hashCode() { if (this.defaultColumn) { return new HashCodeBuilder(31, 47).append(true).toHashCode(); } return new HashCodeBuilder(31, 47) .append(this.rowID) .append(this.columnID) .append(this.rowKey) .append(this.columnKey) .append(this.timestamp) .toHashCode(); } private  Column(); }
Column implements Record { @Override public int hashCode() { if (this.defaultColumn) { return new HashCodeBuilder(31, 47).append(true).toHashCode(); } return new HashCodeBuilder(31, 47) .append(this.rowID) .append(this.columnID) .append(this.rowKey) .append(this.columnKey) .append(this.timestamp) .toHashCode(); } private  Column(); static Column create(long rowID, long columnID); static Column create(long rowID, long columnID, long timestamp); static Column create(long rowID, String columnKey); static Column create(long rowID, String columnKey, long timestamp); static Column create(String rowKey, long columnID); static Column create(String rowKey, long columnID, long timestamp); static Column create(String rowKey, String columnKey); static Column create(String rowKey, String columnKey, long timestamp); static Column create(boolean rowBool, long columnID); static Column create(boolean rowBool, long columnID, long timestamp); static Column create(boolean rowBool, String columnKey); static Column create(boolean rowBool, String columnKey, long timestamp); long getRowID(); String getRowKey(); boolean getRowBool(); long getColumnID(); String getColumnKey(); long getTimestamp(); @Override long shard(long shardWidth); @Override int compareTo(Record other); @Override boolean isDefault(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Column implements Record { @Override public int hashCode() { if (this.defaultColumn) { return new HashCodeBuilder(31, 47).append(true).toHashCode(); } return new HashCodeBuilder(31, 47) .append(this.rowID) .append(this.columnID) .append(this.rowKey) .append(this.columnKey) .append(this.timestamp) .toHashCode(); } private  Column(); static Column create(long rowID, long columnID); static Column create(long rowID, long columnID, long timestamp); static Column create(long rowID, String columnKey); static Column create(long rowID, String columnKey, long timestamp); static Column create(String rowKey, long columnID); static Column create(String rowKey, long columnID, long timestamp); static Column create(String rowKey, String columnKey); static Column create(String rowKey, String columnKey, long timestamp); static Column create(boolean rowBool, long columnID); static Column create(boolean rowBool, long columnID, long timestamp); static Column create(boolean rowBool, String columnKey); static Column create(boolean rowBool, String columnKey, long timestamp); long getRowID(); String getRowKey(); boolean getRowBool(); long getColumnID(); String getColumnKey(); long getTimestamp(); @Override long shard(long shardWidth); @Override int compareTo(Record other); @Override boolean isDefault(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final Column DEFAULT; }