@Test public void testHashCode() { final CategoricalValueSchema valueSchema = new CategoricalValueSchema(false, NOMINAL_VALUES); final CategoricalValueSchema valueSchema2 = new CategoricalValueSchema(false, NOMINAL_VALUES); final CategoricalValueSchema valueSchema3 = new CategoricalValueSchema(true, NOMINAL_VALUES); final Set<String> nominalValues2 = ImmutableSet.of("val0", "val1", "val3"); final CategoricalValueSchema valueSchema4 = new CategoricalValueSchema(false, nominalValues2); assertThat(valueSchema.hashCode()) .isEqualTo(valueSchema.hashCode()) .isEqualTo(valueSchema2.hashCode()) .isNotEqualTo(valueSchema3.hashCode()) .isNotEqualTo(valueSchema4.hashCode()); }
@Override public int hashCode() { return 31 * super.hashCode() + Objects.hash(this.nominalValues); }
CategoricalValueSchema extends AbstractValueSchema { @Override public int hashCode() { return 31 * super.hashCode() + Objects.hash(this.nominalValues); } }
CategoricalValueSchema extends AbstractValueSchema { @Override public int hashCode() { return 31 * super.hashCode() + Objects.hash(this.nominalValues); } CategoricalValueSchema(final boolean allowMissing,
                                  final Set<String> nominalValues); }
CategoricalValueSchema extends AbstractValueSchema { @Override public int hashCode() { return 31 * super.hashCode() + Objects.hash(this.nominalValues); } CategoricalValueSchema(final boolean allowMissing,
                                  final Set<String> nominalValues); SortedSet<String> getNominalValues(); @Override boolean validate(final String value); @Override int hashCode(); @Override boolean equals(final Object obj); }
CategoricalValueSchema extends AbstractValueSchema { @Override public int hashCode() { return 31 * super.hashCode() + Objects.hash(this.nominalValues); } CategoricalValueSchema(final boolean allowMissing,
                                  final Set<String> nominalValues); SortedSet<String> getNominalValues(); @Override boolean validate(final String value); @Override int hashCode(); @Override boolean equals(final Object obj);  }