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

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

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

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.testdroid.api.APIEntity;

import jakarta.xml.bind.annotation.XmlType;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Michał Szpruta 
 */
public class APIFileConfig extends APIEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @XmlType(namespace = "APIFileConfig")
    public enum Action {
        COPY_TO_DEVICE("data"),
        INSTALL("app"),
        RUN_TEST("test");

        private final String fileType;

        Action(String fileType) {
            this.fileType = fileType;
        }

        public String getFileType() {
            return fileType;
        }
    }

    private Action action;

    private List availableActions = new ArrayList<>();

    private APIUserFile file;

    public APIFileConfig() {
    }

    public APIFileConfig(Long id, Action action) {
        super(id);
        this.action = action;
    }

    public Action getAction() {
        return action;
    }

    public void setAction(Action action) {
        this.action = action;
    }

    public List getAvailableActions() {
        return availableActions;
    }

    public void setAvailableActions(List availableActions) {
        this.availableActions = availableActions;
    }

    public APIUserFile getFile() {
        return file;
    }

    public void setFile(APIUserFile file) {
        if (file != null) {
            this.id = file.getId();
        }
        this.file = file;
    }

    @Override
    @JsonIgnore
    protected  void clone(T from) {
        APIFileConfig original = (APIFileConfig) from;
        cloneBase(original);
        this.action = original.action;
        this.availableActions = original.availableActions;
        this.file = original.file;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy