All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.testdroid.api.model.APIDeviceSessionStep Maven / Gradle / Ivy

There is a newer version: 3.34.0
Show newest version
package com.testdroid.api.model;

import com.testdroid.api.APIEntity;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 * @author Michał Szpruta 
 */
@XmlRootElement
public class APIDeviceSessionStep extends APIEntity {

    @XmlType(namespace = "APIDeviceSessionStep")
    public enum Type {
        WAITING,
        PREPARING,
        UNINSTALL,
        INSTALL,
        RUNNING,
        SENDING_RESULTS,
        PROCESSING_RESULTS;

        public String getDisplayName() {
            switch (this) {
                case PREPARING:
                    return "Preparing device";
                case WAITING:
                    return "Waiting for device";
                case UNINSTALL:
                    return "Uninstall apps";
                case INSTALL:
                    return "Install apps";
                case RUNNING:
                    return "Running session";
                case SENDING_RESULTS:
                    return "Sending results";
                case PROCESSING_RESULTS:
                    return "Processing results";
                default:
                    return "";
            }
        }
    }

    private Long deviceSessionId;

    private String failReason;

    private Long finishTimeMS;

    private Type type;

    private Long startTimeMS;

    private String excludeReason;

    public APIDeviceSessionStep() {
    }

    public APIDeviceSessionStep(
            Long id, Long deviceSessionId, String failReason, Long finishTimeMS, Long startTimeMS,
            Type type) {
        super(id);
        this.deviceSessionId = deviceSessionId;
        this.failReason = failReason;
        this.finishTimeMS = finishTimeMS;
        this.startTimeMS = startTimeMS;
        this.type = type;
    }

    public APIDeviceSessionStep(
            Long id, Long deviceSessionId, String failReason, Long finishTimeMS, Long startTimeMS,
            Type type, String excludeReason) {
        this(id, deviceSessionId, failReason, finishTimeMS, startTimeMS, type);
        this.excludeReason = excludeReason;
    }

    public Long getDeviceSessionId() {
        return deviceSessionId;
    }

    public void setDeviceSessionId(Long deviceSessionId) {
        this.deviceSessionId = deviceSessionId;
    }

    public String getFailReason() {
        return failReason;
    }

    public void setFailReason(String failReason) {
        this.failReason = failReason;
    }

    public Long getFinishTimeMS() {
        return finishTimeMS;
    }

    public void setFinishTimeMS(Long finishTimeMS) {
        this.finishTimeMS = finishTimeMS;
    }

    public Type getType() {
        return type;
    }

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

    public Long getStartTimeMS() {
        return startTimeMS;
    }

    public void setStartTimeMS(Long startTimeMS) {
        this.startTimeMS = startTimeMS;
    }

    public String getExcludeReason() {
        return excludeReason;
    }

    public void setExcludeReason(String excludeReason) {
        this.excludeReason = excludeReason;
    }

    @Override
    protected  void clone(T from) {
        APIDeviceSessionStep apiDeviceSessionStep = (APIDeviceSessionStep) from;
        cloneBase(from);
        this.deviceSessionId = apiDeviceSessionStep.deviceSessionId;
        this.failReason = apiDeviceSessionStep.failReason;
        this.startTimeMS = apiDeviceSessionStep.startTimeMS;
        this.finishTimeMS = apiDeviceSessionStep.finishTimeMS;
        this.type = apiDeviceSessionStep.type;
        this.excludeReason = apiDeviceSessionStep.excludeReason;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy