protected Map<String, Object> getVariablesConfig() { final Map<String, Object> result = new HashMap<>(); if (variables != null) { for (final VariableXBean item : variables) { result.put(item.getName(), item.getValue()); } } return result; }
protected Map<String, Object> getVariablesConfig() { final Map<String, Object> result = new HashMap<>(); if (variables != null) { for (final VariableXBean item : variables) { result.put(item.getName(), item.getValue()); } } return result; }
protected void validate() { notEmpty(this, "name", getName()); }
protected void validate() { notEmpty(this, "name", getName()); }
public static Map<String, Object> toMap(final List<VariableXBean> variables) { final Map<String, Object> result = new HashMap<>(); if (variables != null) { for (final VariableXBean variable : variables) { variable.validate(); final String variableName = variable.getName(); if (result.containsKey(variableName)) { throw new ConfigurationException("Two variables with the same name " + variableName); } else { result.put(variableName, variable.getValue()); } } } return result; } }
public static Map<String, Object> toMap(final List<VariableXBean> variables) { final Map<String, Object> result = new HashMap<>(); if (variables != null) { for (final VariableXBean variable : variables) { variable.validate(); final String variableName = variable.getName(); if (result.containsKey(variableName)) { throw new ConfigurationException("Two variables with the same name " + variableName); } else { result.put(variableName, variable.getValue()); } } } return result; } }