package com.hubspot.blazar.base;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;

public class BuildConfig {

  private final List<String> cmds;
  private final Map<String, String> env;
  private final List<String> buildDependencies;
  private final List<String> buildDependents;
  private final List<String> webhooks;

  @JsonCreator
  public BuildConfig(@JsonProperty("cmds") List<String> cmds,
                     @JsonProperty("env") Map<String, String> env,
                     @JsonProperty("buildDependencies") List<String> buildDependencies,
                     @JsonProperty("buildDependents") List<String> buildDependents,
                     @JsonProperty("webhooks") List<String> webhooks) {

    this.cmds = Objects.firstNonNull(cmds, ImmutableList.of("runbuildpack"));
    this.env = Objects.firstNonNull(env, Collections.<String,String>emptyMap());
    this.buildDependencies = Objects.firstNonNull(buildDependencies, Collections.<String>emptyList());
    this.buildDependents = Objects.firstNonNull(buildDependents, Collections.<String>emptyList());
    this.webhooks = Objects.firstNonNull(webhooks, Collections.<String>emptyList());
  }

  public static BuildConfig makeDefaultBuildConfig(){
    return new BuildConfig(null, null, null, null, null);
  }


  public List<String> getCmds() {
    return cmds;
  }

  public Map<String, String> getEnv() {
    return env;
  }

  public List<String> getBuildDependencies() {
    return buildDependencies;
  }

  public List<String> getBuildDependents() {
    return buildDependents;
  }

  public List<String> getWebhooks() {
    return webhooks;
  }
}

@@ -325,17 +325,16 @@
 onfig %7B%0A
-%0A
   privat
@@ -442,62 +442,8 @@
 dDep
-endencies;%0A  private final List%3CString%3E buildDependent
 s;%0A 
@@ -669,24 +669,16 @@
 buildDep
-endencie
 s%22) List
@@ -698,100 +698,8 @@
 dDep
-endencies,%0A                     @JsonProperty(%22buildDependents%22) List%3CString%3E buildDependent
 s,%0A 
@@ -946,24 +946,16 @@
 buildDep
-endencie
 s = Obje
@@ -983,115 +983,8 @@
 dDep
-endencies, Collections.%3CString%3EemptyList());%0A    this.buildDependents = Objects.firstNonNull(buildDependent
 s, C
@@ -1200,30 +1200,24 @@
  null, null,
- null,
  null);%0A  %7D%0A
@@ -1217,17 +1217,16 @@
 );%0A  %7D%0A%0A
-%0A
   public
@@ -1367,24 +1367,16 @@
 BuildDep
-endencie
 s() %7B%0A  
@@ -1396,94 +1396,8 @@
 dDep
-endencies;%0A  %7D%0A%0A  public List%3CString%3E getBuildDependents() %7B%0A    return buildDependent
 s;%0A 

Use buildDeps