package com.bocloud.cmp.model.hmc;

import java.util.Date;
import java.util.List;

public class HmdJobResponseModel {
    private Long jobId;
    private String targetUuid;
    private Date start;
    private Date complete;
    private String status;
    private HmdJobRequestModel request;
    private float progress;
    private int code;
    private List<String> histories;

    public Long getJobId() {
        return jobId;
    }

    public void setJobId(Long jobId) {
        this.jobId = jobId;
    }

    public String getTargetUuid() {
        return targetUuid;
    }

    public void setTargetUuid(String targetUuid) {
        this.targetUuid = targetUuid;
    }

    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public Date getComplete() {
        return complete;
    }

    public void setComplete(Date complete) {
        this.complete = complete;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public HmdJobRequestModel getRequest() {
        return request;
    }

    public HmdJobRequestModel newRequest() {
        this.request = new HmdJobRequestModel();
        return request;
    }

    public void setRequest(HmdJobRequestModel request) {
        this.request = request;
    }

    public float getProgress() {
        return progress;
    }

    public void setProgress(float progress) {
        this.progress = progress;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public List<String> getHistories() {
        return histories;
    }

    public void setHistories(List<String> histories) {
        this.histories = histories;
    }

    @Override
    public String toString() {
        return String.format("%d: %s %d %f%%", jobId, status, code, progress * 100);
    }
}
