package com.collective.celos.ci.config;

import com.collective.celos.ci.config.deploy.CelosCiContext;

import java.io.File;
import java.net.URI;

/**
 * Created by akonopko on 9/30/14.
 */
public class CiCommandLine {

    private final URI targetUri;
    private final CelosCiContext.Mode mode;
    private final File deployDir;
    private final String workflowName;
    private final File testCasesDir;
    private final String userName;
    private final boolean keepTempData;

    public CiCommandLine(String targetUri, String mode, String deployDir, String workflowName, String testCasesDir, String userName, boolean keepTempData) {
        this.userName = userName;
        this.keepTempData = keepTempData;
        this.targetUri = URI.create(targetUri);
        this.mode = CelosCiContext.Mode.valueOf(mode);
        this.deployDir = new File(deployDir);
        this.workflowName = workflowName;
        this.testCasesDir = new File(testCasesDir);
    }

    public URI getTargetUri() {
        return targetUri;
    }

    public CelosCiContext.Mode getMode() {
        return mode;
    }

    public File getDeployDir() {
        return deployDir;
    }

    public String getWorkflowName() {
        return workflowName;
    }

    public File getTestCasesDir() {
        return testCasesDir;
    }

    public String getUserName() {
        return userName;
    }

    public boolean isKeepTempData() {
        return keepTempData;
    }
}

@@ -34,16 +34,50 @@
 onfig;%0A%0A
+import com.collective.celos.Util;%0A
 import c
@@ -690,24 +690,44 @@
 rName = 
+Util.requireNonNull(
 userName
 ;%0A      
@@ -714,24 +714,25 @@
 ull(userName
+)
 ;%0A        th
@@ -799,16 +799,36 @@
 .create(
+Util.requireNonNull(
 targetUr
@@ -829,16 +829,17 @@
 rgetUri)
+)
 ;%0A      
@@ -884,13 +884,34 @@
 eOf(
+Util.requireNonNull(
 mode)
+)
 ;%0A  
@@ -942,16 +942,36 @@
 ew File(
+Util.requireNonNull(
 deployDi
@@ -968,24 +968,25 @@
 l(deployDir)
+)
 ;%0A        th
@@ -1003,16 +1003,36 @@
 wName = 
+Util.requireNonNull(
 workflow
@@ -1031,24 +1031,25 @@
 workflowName
+)
 ;%0A        th
@@ -1075,16 +1075,36 @@
 ew File(
+Util.requireNonNull(
 testCase
@@ -1108,16 +1108,17 @@
 asesDir)
+)
 ;%0A    %7D%0A

add Util.requireNonNull