@Override public void setConf(AbstractConfig config) { this.config = (ConditionalOperationConfig) config; List<Pair<FilterOperation, List<OperationProcessor>>> cases = new ArrayList<Pair<FilterOperation, List<OperationProcessor>>>(); OperationFactoryFactory off = new OperationFactoryFactory(); for (Condition caze : this.config.getConditions()) { List<OperationProcessor> processorsInCase = new ArrayList<OperationProcessor>(); /* * Create {@OperationProcessor}s from configs */ for (OperationConfig opConfig : caze.getOperations()) { try { processorsInCase.add(new OperationProcessor(off.getFactory(opConfig))); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } FilterOperation filter; try { filter = (FilterOperation) off.getFactory(caze.getCondition()).newInstance(); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } cases.add( new ImmutablePair<FilterOperation, List<OperationProcessor>>(filter, processorsInCase)); } this.cases = cases; }
@Override public void setConf(AbstractConfig config) { this.config = (ConditionalOperationConfig) config; List<Pair<FilterOperation, List<OperationProcessor>>> cases = new ArrayList<Pair<FilterOperation, List<OperationProcessor>>>(); OperationFactoryFactory off = new OperationFactoryFactory(); for (Condition caze : this.config.getConditions()) { List<OperationProcessor> processorsInCase = new ArrayList<OperationProcessor>(); /* * Create {@OperationProcessor}s from configs */ for (OperationConfig opConfig : caze.getOperations()) { try { processorsInCase.add(new OperationProcessor(off.getFactory(opConfig))); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } FilterOperation filter; try { filter = (FilterOperation) off.getFactory(caze.getCondition()).newInstance(); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } cases.add( new ImmutablePair<FilterOperation, List<OperationProcessor>>(filter, processorsInCase)); } this.cases = cases; }