|
16 | 16 |
|
17 | 17 | package io.appium.java_client.pagefactory.bys;
|
18 | 18 |
|
| 19 | +import lombok.EqualsAndHashCode; |
19 | 20 | import org.openqa.selenium.By;
|
20 | 21 | import org.openqa.selenium.SearchContext;
|
21 | 22 | import org.openqa.selenium.WebElement;
|
22 | 23 |
|
23 | 24 | import javax.annotation.Nonnull;
|
24 | 25 | import java.util.List;
|
25 | 26 | import java.util.Map;
|
26 |
| -import java.util.Objects; |
27 | 27 |
|
28 | 28 | import static io.appium.java_client.pagefactory.bys.ContentType.NATIVE_MOBILE_SPECIFIC;
|
29 | 29 | import static java.util.Objects.requireNonNull;
|
30 | 30 |
|
| 31 | +@EqualsAndHashCode(callSuper = true) |
31 | 32 | public class ContentMappedBy extends By {
|
32 | 33 | private final Map<ContentType, By> map;
|
33 | 34 | private ContentType currentContent = NATIVE_MOBILE_SPECIFIC;
|
@@ -62,24 +63,4 @@ public List<WebElement> findElements(SearchContext context) {
|
62 | 63 | public String toString() {
|
63 | 64 | return map.get(currentContent).toString();
|
64 | 65 | }
|
65 |
| - |
66 |
| - @Override |
67 |
| - public boolean equals(Object o) { |
68 |
| - if (this == o) { |
69 |
| - return true; |
70 |
| - } |
71 |
| - if (o == null || getClass() != o.getClass()) { |
72 |
| - return false; |
73 |
| - } |
74 |
| - if (!super.equals(o)) { |
75 |
| - return false; |
76 |
| - } |
77 |
| - ContentMappedBy that = (ContentMappedBy) o; |
78 |
| - return Objects.equals(map, that.map) && currentContent == that.currentContent; |
79 |
| - } |
80 |
| - |
81 |
| - @Override |
82 |
| - public int hashCode() { |
83 |
| - return Objects.hash(super.hashCode(), map, currentContent); |
84 |
| - } |
85 | 66 | }
|
0 commit comments