Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Deprecate obsolete TouchAction helpers #2199

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

26 changes: 2 additions & 24 deletions src/main/java/io/appium/java_client/AppiumBy.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.appium.java_client;

import com.google.common.base.Preconditions;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.openqa.selenium.By;
import org.openqa.selenium.By.Remotable;
Expand All @@ -25,10 +26,10 @@

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

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

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

@Getter private final Parameters remoteParameters;
Expand Down Expand Up @@ -256,27 +257,4 @@ protected ByIosNsPredicate(String locatorString) {
super("-ios predicate string", locatorString, "iOSNsPredicate");
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
AppiumBy appiumBy = (AppiumBy) o;
return Objects.equals(remoteParameters, appiumBy.remoteParameters)
&& Objects.equals(locatorName, appiumBy.locatorName);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), remoteParameters, locatorName);
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@

package io.appium.java_client.pagefactory.bys;

import lombok.EqualsAndHashCode;
import org.openqa.selenium.By;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.WebElement;

import javax.annotation.Nonnull;
import java.util.List;
import java.util.Map;
import java.util.Objects;

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

@EqualsAndHashCode(callSuper = true)
public class ContentMappedBy extends By {
private final Map<ContentType, By> map;
private ContentType currentContent = NATIVE_MOBILE_SPECIFIC;
Expand Down Expand Up @@ -62,24 +63,4 @@ public List<WebElement> findElements(SearchContext context) {
public String toString() {
return map.get(currentContent).toString();
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
ContentMappedBy that = (ContentMappedBy) o;
return Objects.equals(map, that.map) && currentContent == that.currentContent;
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), map, currentContent);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.HashMap;
import java.util.Map;

@Deprecated
public abstract class ActionOptions<T extends ActionOptions<T>> {
/**
* This method is automatically called before building
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static java.util.Objects.requireNonNull;
import static java.util.Optional.ofNullable;

@Deprecated
public class LongPressOptions extends AbstractOptionCombinedWithPosition<LongPressOptions> {
protected Duration duration = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Optional.ofNullable;

@Deprecated
public class TapOptions extends AbstractOptionCombinedWithPosition<TapOptions> {
private Integer tapsCount = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import static java.time.Duration.ofMillis;
import static java.util.Objects.requireNonNull;

@Deprecated
public class WaitOptions extends ActionOptions<WaitOptions> {
protected Duration duration = ofMillis(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import static java.util.Optional.ofNullable;

@Deprecated
public abstract class AbstractOptionCombinedWithPosition<T extends AbstractOptionCombinedWithPosition<T>>
extends ActionOptions<AbstractOptionCombinedWithPosition<T>> {
private ActionOptions<?> positionOption;
Expand Down
Loading
Loading