Skip to content

Commit

Permalink
Implement equals() and hashCode() in Select element wrapper (#6617)
Browse files Browse the repository at this point in the history
  • Loading branch information
valfirst authored and shs96c committed Nov 14, 2018
1 parent e82be7d commit fc54cd2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions java/client/src/org/openqa/selenium/support/ui/Select.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.openqa.selenium.WrapsElement;

import java.util.List;
import java.util.Objects;
import java.util.StringTokenizer;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -311,4 +312,18 @@ private void setSelected(WebElement option, boolean select) {
option.click();
}
}

@Override
public boolean equals(Object o) {
if (!(o instanceof Select)) {
return false;
}
Select select = (Select) o;
return Objects.equals(element, select.element);
}

@Override
public int hashCode() {
return Objects.hash(element);
}
}

0 comments on commit fc54cd2

Please sign in to comment.