package leigh.elements.sdk.actions;

import leigh.elements.sdk.AppScreenInstance;

import java.util.Objects;

public class ModalScreenOpenAction implements ScreenAction {
    private final AppScreenInstance screenInstance;

    public ModalScreenOpenAction(AppScreenInstance popupScreen) {
        screenInstance = popupScreen;
    }

    public AppScreenInstance getScreenInstance() {
        return screenInstance;
    }

    @Override
    public String toString() {
        return "ModalScreenOpenAction{" +
                "screenInstance=" + screenInstance +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ModalScreenOpenAction that = (ModalScreenOpenAction) o;
        return Objects.equals(screenInstance, that.screenInstance);
    }

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