Skip to content

Commit 0e24ef1

Browse files
chore: Deprecate obsolete TouchAction helpers (#2199)
1 parent 8a63759 commit 0e24ef1

14 files changed

+11
-551
lines changed

src/e2eAndroidTest/java/io/appium/java_client/android/AndroidAbilityToUseSupplierTest.java

-71
This file was deleted.

src/e2eAndroidTest/java/io/appium/java_client/android/AndroidTouchTest.java

-193
This file was deleted.

src/main/java/io/appium/java_client/AppiumBy.java

+2-24
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package io.appium.java_client;
1818

1919
import com.google.common.base.Preconditions;
20+
import lombok.EqualsAndHashCode;
2021
import lombok.Getter;
2122
import org.openqa.selenium.By;
2223
import org.openqa.selenium.By.Remotable;
@@ -25,10 +26,10 @@
2526

2627
import java.io.Serializable;
2728
import java.util.List;
28-
import java.util.Objects;
2929

3030
import static com.google.common.base.Strings.isNullOrEmpty;
3131

32+
@EqualsAndHashCode(callSuper = true)
3233
public abstract class AppiumBy extends By implements Remotable {
3334

3435
@Getter private final Parameters remoteParameters;
@@ -256,27 +257,4 @@ protected ByIosNsPredicate(String locatorString) {
256257
super("-ios predicate string", locatorString, "iOSNsPredicate");
257258
}
258259
}
259-
260-
@Override
261-
public boolean equals(Object o) {
262-
if (this == o) {
263-
return true;
264-
}
265-
if (o == null || getClass() != o.getClass()) {
266-
return false;
267-
}
268-
if (!super.equals(o)) {
269-
return false;
270-
}
271-
AppiumBy appiumBy = (AppiumBy) o;
272-
return Objects.equals(remoteParameters, appiumBy.remoteParameters)
273-
&& Objects.equals(locatorName, appiumBy.locatorName);
274-
}
275-
276-
@Override
277-
public int hashCode() {
278-
return Objects.hash(super.hashCode(), remoteParameters, locatorName);
279-
}
280260
}
281-
282-

src/main/java/io/appium/java_client/pagefactory/bys/ContentMappedBy.java

+2-21
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@
1616

1717
package io.appium.java_client.pagefactory.bys;
1818

19+
import lombok.EqualsAndHashCode;
1920
import org.openqa.selenium.By;
2021
import org.openqa.selenium.SearchContext;
2122
import org.openqa.selenium.WebElement;
2223

2324
import javax.annotation.Nonnull;
2425
import java.util.List;
2526
import java.util.Map;
26-
import java.util.Objects;
2727

2828
import static io.appium.java_client.pagefactory.bys.ContentType.NATIVE_MOBILE_SPECIFIC;
2929
import static java.util.Objects.requireNonNull;
3030

31+
@EqualsAndHashCode(callSuper = true)
3132
public class ContentMappedBy extends By {
3233
private final Map<ContentType, By> map;
3334
private ContentType currentContent = NATIVE_MOBILE_SPECIFIC;
@@ -62,24 +63,4 @@ public List<WebElement> findElements(SearchContext context) {
6263
public String toString() {
6364
return map.get(currentContent).toString();
6465
}
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-
}
8566
}

src/main/java/io/appium/java_client/touch/ActionOptions.java

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.HashMap;
2020
import java.util.Map;
2121

22+
@Deprecated
2223
public abstract class ActionOptions<T extends ActionOptions<T>> {
2324
/**
2425
* This method is automatically called before building

src/main/java/io/appium/java_client/touch/LongPressOptions.java

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import static java.util.Objects.requireNonNull;
2626
import static java.util.Optional.ofNullable;
2727

28+
@Deprecated
2829
public class LongPressOptions extends AbstractOptionCombinedWithPosition<LongPressOptions> {
2930
protected Duration duration = null;
3031

src/main/java/io/appium/java_client/touch/TapOptions.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import static com.google.common.base.Preconditions.checkArgument;
2424
import static java.util.Optional.ofNullable;
2525

26+
@Deprecated
2627
public class TapOptions extends AbstractOptionCombinedWithPosition<TapOptions> {
2728
private Integer tapsCount = null;
2829

src/main/java/io/appium/java_client/touch/WaitOptions.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import static java.time.Duration.ofMillis;
2424
import static java.util.Objects.requireNonNull;
2525

26+
@Deprecated
2627
public class WaitOptions extends ActionOptions<WaitOptions> {
2728
protected Duration duration = ofMillis(0);
2829

src/main/java/io/appium/java_client/touch/offset/AbstractOptionCombinedWithPosition.java

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import static java.util.Optional.ofNullable;
88

9+
@Deprecated
910
public abstract class AbstractOptionCombinedWithPosition<T extends AbstractOptionCombinedWithPosition<T>>
1011
extends ActionOptions<AbstractOptionCombinedWithPosition<T>> {
1112
private ActionOptions<?> positionOption;

0 commit comments

Comments
 (0)