package net.northking.cctp.element.mobile.ios.entity;

import net.northking.cctp.element.core.DeviceDriver;
import net.northking.cctp.element.core.IExecuteContext;
import net.northking.cctp.element.core.IStepTarget;

import java.util.List;

public class ElementHandleParam {

    private IExecuteContext context;

    private DeviceDriver deviceDriver;

    private List<IStepTarget> targets;

    private Integer waitTimeout;

    private boolean waitStatus;

    private String swipe;  //0不滑动，left左滑，right右滑，top上滑，down下滑,该参数用于查找控件时选项

    private Integer swipeCount;  //滑动次数

    private String swipeDirection; //0不滑动，left左滑，right右滑，top上滑，down下滑,该参数用于滑动组件

    private Integer swipeSize;  //滑动距离

    private Integer xMove;   //x方向偏移量

    private Integer yMove;   //y方向偏移量

    private boolean clear;   //是否清除文本

    private String inputTextValue;  //输入文本的值

    private String text;  //点击文本时文本、密码输入时输入的密码

    private Integer index;  //第几个

    private String appPackage;  //应用包名

    private String type;  //应用操作类型

    public ElementHandleParam withType(String type) {
        this.setType(type);
        return this;
    }

    public ElementHandleParam withAppPackage(String appPackage) {
        this.setAppPackage(appPackage);
        return this;
    }

    public ElementHandleParam withText(String text) {
        this.setText(text);
        return this;
    }

    public ElementHandleParam withIndex(Integer index) {
        this.setIndex(index);
        return this;
    }

    public String getAppPackage() {
        return appPackage;
    }

    public void setAppPackage(String appPackage) {
        this.appPackage = appPackage;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static ElementHandleParam builder(DeviceDriver deviceDriver){
        return new ElementHandleParam().withDriver(deviceDriver);
    }

    private ElementHandleParam withDriver(DeviceDriver deviceDriver) {
        this.setDeviceDriver(deviceDriver);
        return this;
    }

    public ElementHandleParam withTargets(List<IStepTarget> targets){
        this.setTargets(targets);
        return this;
    }

    public ElementHandleParam waitTimeout(Integer waitTimeout){
        this.setWaitTimeout(waitTimeout);
        return this;
    }

    public ElementHandleParam waitStatus(Boolean waitStatus){
        this.setWaitStatus(waitStatus);
        return this;
    }

    public ElementHandleParam searchSwipeDirection(String searchSwipeDirection){
        this.setSwipe(searchSwipeDirection);
        return this;
    }

    public ElementHandleParam swipeDirection(String swipeDirection){
        this.setSwipeDirection(swipeDirection);
        return this;
    }

    public ElementHandleParam withSwipeCount(Integer swipeCount){
        this.setSwipeCount(swipeCount);
        return this;
    }

    public ElementHandleParam withSwipeSize(Integer swipeSize){
        this.setSwipeSize(swipeSize);
        return this;
    }

    public ElementHandleParam clear(boolean clear){
        this.setClear(clear);
        return this;
    }

    public ElementHandleParam withInputTextValue(String inputTextValue){
        this.setInputTextValue(inputTextValue);
        return this;
    }

    public ElementHandleParam withXMove(Integer xMove){
        this.setxMove(xMove);
        return this;
    }

    public ElementHandleParam withYMove(Integer yMove){
        this.setyMove(yMove);
        return this;
    }

    public ElementHandleParam useContext(IExecuteContext context){
        this.setContext(context);
        return this;
    }

    public IExecuteContext getContext() {
        return context;
    }

    public void setContext(IExecuteContext context) {
        this.context = context;
    }

    public DeviceDriver getDeviceDriver() {
        return deviceDriver;
    }

    public void setDeviceDriver(DeviceDriver deviceDriver) {
        this.deviceDriver = deviceDriver;
    }

    public List<IStepTarget> getTargets() {
        return targets;
    }

    public void setTargets(List<IStepTarget> targets) {
        this.targets = targets;
    }

    public Integer getWaitTimeout() {
        return waitTimeout;
    }

    public void setWaitTimeout(Integer waitTimeout) {
        this.waitTimeout = waitTimeout;
    }

    public boolean isWaitStatus() {
        return waitStatus;
    }

    public void setWaitStatus(boolean waitStatus) {
        this.waitStatus = waitStatus;
    }

    public String getSwipe() {
        return swipe;
    }

    public void setSwipe(String swipe) {
        this.swipe = swipe;
    }

    public Integer getSwipeCount() {
        return swipeCount;
    }

    public void setSwipeCount(Integer swipeCount) {
        this.swipeCount = swipeCount;
    }

    public Integer getxMove() {
        return xMove;
    }

    public void setxMove(Integer xMove) {
        this.xMove = xMove;
    }

    public Integer getyMove() {
        return yMove;
    }

    public void setyMove(Integer yMove) {
        this.yMove = yMove;
    }

    public Integer getSwipeSize() {
        return swipeSize;
    }

    public void setSwipeSize(Integer swipeSize) {
        this.swipeSize = swipeSize;
    }

    public String getSwipeDirection() {
        return swipeDirection;
    }

    public void setSwipeDirection(String swipeDirection) {
        this.swipeDirection = swipeDirection;
    }

    public boolean isClear() {
        return clear;
    }

    public void setClear(boolean clear) {
        this.clear = clear;
    }

    public String getInputTextValue() {
        return inputTextValue;
    }

    public void setInputTextValue(String inputTextValue) {
        this.inputTextValue = inputTextValue;
    }
}
