public ListConfig findListConfig(String name) { String baseName = getBaseName(name); ListConfig config = lookupByPattern(listConfigs, baseName); if (config != null) { return config.getAsReadOnly(); } return getListConfig("default").getAsReadOnly(); }
public ListConfig getListConfig(String name) { String baseName = getBaseName(name); ListConfig config = lookupByPattern(listConfigs, baseName); if (config != null) { return config; } ListConfig defConfig = listConfigs.get("default"); if (defConfig == null) { defConfig = new ListConfig(); defConfig.setName("default"); addListConfig(defConfig); } config = new ListConfig(defConfig); config.setName(name); addListConfig(config); return config; }
/** @param args */ public static void main(String[] args) { ListConfig cfg = JsonConfig.create(ListConfig.class); double[] da = cfg.getDoubleArray(); Double[] dwa = cfg.getDoubleWrapperArray(); ArrayList<Double> dwl = cfg.getDoubleWrapperList(); cfg.setDoubleArray(new double[] {9.8, 7.6}); cfg.setDoubleWrapperArray(new Double[] {7.6, 5.4}); dwl.add(Math.random()); cfg.setDoubleWrapperList(dwl); System.out.println(da); System.out.println(dwa); System.out.println("SUCCESSFUL"); System.exit(1); }
public Config addListConfig(ListConfig listConfig) { listConfigs.put(listConfig.getName(), listConfig); return this; }