public Map<String, IEnvironmentVariable> addEnvironmentVariables(Map<String, String> environmentVariables)
throws OpenShiftException {
Map<String,String>variablesCandidateMap = new HashMap<String,String>();
for(String varCandidateName:environmentVariables.keySet()){
IEnvironmentVariable tempVar = environmentVariablesMap.get(varCandidateName);
if(tempVar != null)
{ if(tempVar.getValue() == environmentVariables.get(varCandidateName))
variablesCandidateMap.put(varCandidateName,environmentVariables.get(varCandidateName));
}
else
variablesCandidateMap.put(varCandidateName, environmentVariables.get(varCandidateName));
}
List<EnvironmentVariableResourceDTO> environmentVariableResourceDTOs = new AddEnvironmentVariablesRequest()
.execute(variablesCandidateMap);
for (EnvironmentVariableResourceDTO dto : environmentVariableResourceDTOs) {
IEnvironmentVariable environmentVariable = new EnvironmentVariableResource(dto, this);
environmentVariablesMap.put(environmentVariable.getName(), environmentVariable);
}
return environmentVariablesMap;
}