package de.avatic.lcc.model.db.calculations;

import de.avatic.lcc.model.calculation.DestinationInfo;

import java.util.List;

public class CalculationResult {

    private List<DestinationInfo> destinationInfos;
    Integer jobId;

    CalculationJobState state;

    Throwable exception;


    public CalculationResult(Integer jobId, List<DestinationInfo> destinationInfos) {
        this.jobId = jobId;
        this.exception = null;
        this.state = CalculationJobState.VALID;
        this.destinationInfos = destinationInfos;
    }

    public CalculationResult(Integer jobId, Throwable e) {
        this.jobId = jobId;
        this.exception = e;
        this.state = CalculationJobState.EXCEPTION;
    }

    public CalculationJobState getState() {
        return state;
    }

    public void setState(CalculationJobState state) {
        this.state = state;
    }

    public Throwable getException() {
        return exception;
    }

    public void setException(Throwable exception) {
        this.exception = exception;
    }

    public Integer getJobId() {
        return jobId;
    }

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

    public List<DestinationInfo> getDestinationInfos() {
        return destinationInfos;
    }
}
