package be.iminds.ilabt.jfed.call_log_output;

import be.iminds.ilabt.jfed.log.cache.ApiCallDetailsCache;

import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.Collection;
import java.util.Date;

/**
 * User: twalcari
 * Date: 4/10/2015
 * Time: 11:58
 */
@Singleton
public class CallReportFactory {

    private final ApiCallDetailsCache cache;

    @Inject
    public CallReportFactory(ApiCallDetailsCache cache) {
        this.cache = cache;
    }

    public CallReport createCallReport(String initialStateName, String reportTitle, String reportObject)  {
        return new CallReport(initialStateName, reportTitle, reportObject,cache);
    }

    public CallReport createCallReport(String reportTitle, String reportObject){
                         return new CallReport(reportTitle, reportObject, cache);
    }

    CallReport createCallReport(String reportTitle, String reportObject, Collection<CallReport.State> states){
        return new CallReport(reportTitle, reportObject, states, cache);
    }

    public CallReport.State createCallReportState(String name, Date start){
        return new CallReport.State(name, start,cache);
    }

}
