@Test public void testEquals() { ColumnSortOption group1Elem1 = new ColumnSortOption("a", false); ColumnSortOption group1Elem2 = new ColumnSortOption("a", false); ColumnSortOption group2Elem1 = new ColumnSortOption("a", true); ColumnSortOption group3Elem1 = new ColumnSortOption("b", false); new EqualsTester() .addEqualityGroup(group1Elem1, group1Elem2) .addEqualityGroup(group2Elem1) .addEqualityGroup(group3Elem1) .testEquals(); }
@Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ColumnSortOption)) { return false; } ColumnSortOption rhs = (ColumnSortOption) obj; return _column.equals(rhs._column) && _reversed == rhs._reversed; }
ColumnSortOption { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ColumnSortOption)) { return false; } ColumnSortOption rhs = (ColumnSortOption) obj; return _column.equals(rhs._column) && _reversed == rhs._reversed; } }
ColumnSortOption { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ColumnSortOption)) { return false; } ColumnSortOption rhs = (ColumnSortOption) obj; return _column.equals(rhs._column) && _reversed == rhs._reversed; } ColumnSortOption(@Nonnull String column, boolean reversed); }
ColumnSortOption { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ColumnSortOption)) { return false; } ColumnSortOption rhs = (ColumnSortOption) obj; return _column.equals(rhs._column) && _reversed == rhs._reversed; } ColumnSortOption(@Nonnull String column, boolean reversed); @Override boolean equals(@Nullable Object obj); @JsonProperty(BfConsts.PROP_COLUMN) @Nonnull String getColumn(); @JsonProperty(BfConsts.PROP_REVERSED) boolean getReversed(); @Override int hashCode(); }
ColumnSortOption { @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof ColumnSortOption)) { return false; } ColumnSortOption rhs = (ColumnSortOption) obj; return _column.equals(rhs._column) && _reversed == rhs._reversed; } ColumnSortOption(@Nonnull String column, boolean reversed); @Override boolean equals(@Nullable Object obj); @JsonProperty(BfConsts.PROP_COLUMN) @Nonnull String getColumn(); @JsonProperty(BfConsts.PROP_REVERSED) boolean getReversed(); @Override int hashCode();  }