@Override public int hashCode() { // do not include start as it is not relevant to the settings of the cluster. int result = Arrays.hashCode(nodes); result = 31 * result + (dse ? 1 : 0); result = 31 * result + ipPrefix.hashCode(); result = 31 * result + (version != null ? version.hashCode() : 0); result = 31 * result + createOptions.hashCode(); result = 31 * result + jvmArgs.hashCode(); result = 31 * result + cassandraConfiguration.hashCode(); result = 31 * result + dseConfiguration.hashCode(); result = 31 * result + workloads.hashCode(); return result; } }
@Test(groups = "unit") public void should_treat_same_prerelease_equal() { VersionNumber version1 = VersionNumber.parse("3.0.15-SNAPSHOT"); VersionNumber version2 = VersionNumber.parse("3.0.15-SNAPSHOT"); assertThat(version1).isEqualTo(version2); assertThat(version1.hashCode()).isEqualTo(version2.hashCode()); }
@Override public int hashCode() { // do not include start as it is not relevant to the settings of the cluster. int result = Arrays.hashCode(nodes); result = 31 * result + (dse ? 1 : 0); result = 31 * result + ipPrefix.hashCode(); result = 31 * result + (version != null ? version.hashCode() : 0); result = 31 * result + createOptions.hashCode(); result = 31 * result + jvmArgs.hashCode(); result = 31 * result + cassandraConfiguration.hashCode(); result = 31 * result + dseConfiguration.hashCode(); result = 31 * result + workloads.hashCode(); return result; } }
@Test(groups = "unit") public void should_treat_same_prerelease_equal() { VersionNumber version1 = VersionNumber.parse("3.0.15-SNAPSHOT"); VersionNumber version2 = VersionNumber.parse("3.0.15-SNAPSHOT"); assertThat(version1).isEqualTo(version2); assertThat(version1.hashCode()).isEqualTo(version2.hashCode()); }