@Test public void testParseChildren() throws Exception { Function f = FunctionFactory.parseChildren(new ConfigThingy("", ""), funcLib, dialogLib, context); assertNull(f); f = FunctionFactory.parseChildren(new ConfigThingy("", "\"test\", \"test2\""), funcLib, dialogLib, context); assertTrue(f instanceof AndFunction); }
public static Function parseChildren(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { List<Function> andFunction = new ArrayList<>(); for (ConfigThingy func : conf) { Function cons = parse(func, funcLib, dialogLib, context); andFunction.add(cons); } if (andFunction.isEmpty()) { return null; } if (andFunction.size() == 1) { return andFunction.get(0); } return new AndFunction(andFunction); }
FunctionFactory { public static Function parseChildren(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { List<Function> andFunction = new ArrayList<>(); for (ConfigThingy func : conf) { Function cons = parse(func, funcLib, dialogLib, context); andFunction.add(cons); } if (andFunction.isEmpty()) { return null; } if (andFunction.size() == 1) { return andFunction.get(0); } return new AndFunction(andFunction); } }
FunctionFactory { public static Function parseChildren(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { List<Function> andFunction = new ArrayList<>(); for (ConfigThingy func : conf) { Function cons = parse(func, funcLib, dialogLib, context); andFunction.add(cons); } if (andFunction.isEmpty()) { return null; } if (andFunction.size() == 1) { return andFunction.get(0); } return new AndFunction(andFunction); } private  FunctionFactory(); }
FunctionFactory { public static Function parseChildren(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { List<Function> andFunction = new ArrayList<>(); for (ConfigThingy func : conf) { Function cons = parse(func, funcLib, dialogLib, context); andFunction.add(cons); } if (andFunction.isEmpty()) { return null; } if (andFunction.size() == 1) { return andFunction.get(0); } return new AndFunction(andFunction); } private  FunctionFactory(); static Function alwaysTrueFunction(); static Function parseGrandchildren(ConfigThingy conf,
      FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context); static Function parseChildren(ConfigThingy conf, FunctionLibrary funcLib,
      DialogLibrary dialogLib, Map<Object, Object> context); static Function parse(ConfigThingy conf, FunctionLibrary funcLib,
      DialogLibrary dialogLib, Map<Object, Object> context); static FunctionLibrary parseFunctions(ConfigThingy conf,
      DialogLibrary dialogLib, Map<Object, Object> context, FunctionLibrary baselib); static FunctionLibrary parseFunctions(FunctionLibrary funcs,
      ConfigThingy conf, String section, DialogLibrary dialogLib,
      Map<Object, Object> context); static Map<String, Function> parseTrafos(ConfigThingy trafoConf, String nodeName, FunctionLibrary funcLib, DialogLibrary dialogLib,
      Map<Object, Object> context); }
FunctionFactory { public static Function parseChildren(ConfigThingy conf, FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context) { List<Function> andFunction = new ArrayList<>(); for (ConfigThingy func : conf) { Function cons = parse(func, funcLib, dialogLib, context); andFunction.add(cons); } if (andFunction.isEmpty()) { return null; } if (andFunction.size() == 1) { return andFunction.get(0); } return new AndFunction(andFunction); } private  FunctionFactory(); static Function alwaysTrueFunction(); static Function parseGrandchildren(ConfigThingy conf,
      FunctionLibrary funcLib, DialogLibrary dialogLib, Map<Object, Object> context); static Function parseChildren(ConfigThingy conf, FunctionLibrary funcLib,
      DialogLibrary dialogLib, Map<Object, Object> context); static Function parse(ConfigThingy conf, FunctionLibrary funcLib,
      DialogLibrary dialogLib, Map<Object, Object> context); static FunctionLibrary parseFunctions(ConfigThingy conf,
      DialogLibrary dialogLib, Map<Object, Object> context, FunctionLibrary baselib); static FunctionLibrary parseFunctions(FunctionLibrary funcs,
      ConfigThingy conf, String section, DialogLibrary dialogLib,
      Map<Object, Object> context); static Map<String, Function> parseTrafos(ConfigThingy trafoConf, String nodeName, FunctionLibrary funcLib, DialogLibrary dialogLib,
      Map<Object, Object> context);  }