@Test public void empty() { ProcessorConfig pConfig = new ProcessorConfig(Collections.<String>emptyList(), null, config); List<TestNamed> filtered = pConfig.prepareProcessors(getAllTestData(), "test"); assertFalse(contains(filtered, "i2")); assertFalse(contains(filtered, "e1")); assertFalse(contains(filtered, "n1")); }
public <T extends Named> List<T> prepareProcessors(List<T> namedList, String type) { List<T> ret = new ArrayList<>(); Map<String, T> lookup = new HashMap<>(); for (T named : namedList) { lookup.put(named.getName(), named); } for (String inc : includes) { if (use(inc)) { T named = lookup.get(inc); if (named == null) { List<String> keys = new ArrayList<>(lookup.keySet()); Collections.sort(keys); throw new IllegalArgumentException( "No " + type + " with name '" + inc + "' found to include. " + "Please check spelling in your profile / config and your project dependencies. Included " + type + "s: " + StringUtils.join(keys,", ")); } ret.add(named); } } return ret; }
ProcessorConfig { public <T extends Named> List<T> prepareProcessors(List<T> namedList, String type) { List<T> ret = new ArrayList<>(); Map<String, T> lookup = new HashMap<>(); for (T named : namedList) { lookup.put(named.getName(), named); } for (String inc : includes) { if (use(inc)) { T named = lookup.get(inc); if (named == null) { List<String> keys = new ArrayList<>(lookup.keySet()); Collections.sort(keys); throw new IllegalArgumentException( "No " + type + " with name '" + inc + "' found to include. " + "Please check spelling in your profile / config and your project dependencies. Included " + type + "s: " + StringUtils.join(keys,", ")); } ret.add(named); } } return ret; } }
ProcessorConfig { public <T extends Named> List<T> prepareProcessors(List<T> namedList, String type) { List<T> ret = new ArrayList<>(); Map<String, T> lookup = new HashMap<>(); for (T named : namedList) { lookup.put(named.getName(), named); } for (String inc : includes) { if (use(inc)) { T named = lookup.get(inc); if (named == null) { List<String> keys = new ArrayList<>(lookup.keySet()); Collections.sort(keys); throw new IllegalArgumentException( "No " + type + " with name '" + inc + "' found to include. " + "Please check spelling in your profile / config and your project dependencies. Included " + type + "s: " + StringUtils.join(keys,", ")); } ret.add(named); } } return ret; } ProcessorConfig();  ProcessorConfig(List<String> includes, Set<String> excludes, Map<String, TreeMap> config); }
ProcessorConfig { public <T extends Named> List<T> prepareProcessors(List<T> namedList, String type) { List<T> ret = new ArrayList<>(); Map<String, T> lookup = new HashMap<>(); for (T named : namedList) { lookup.put(named.getName(), named); } for (String inc : includes) { if (use(inc)) { T named = lookup.get(inc); if (named == null) { List<String> keys = new ArrayList<>(lookup.keySet()); Collections.sort(keys); throw new IllegalArgumentException( "No " + type + " with name '" + inc + "' found to include. " + "Please check spelling in your profile / config and your project dependencies. Included " + type + "s: " + StringUtils.join(keys,", ")); } ret.add(named); } } return ret; } ProcessorConfig();  ProcessorConfig(List<String> includes, Set<String> excludes, Map<String, TreeMap> config); String getConfig(String name, String key); Map<String, String> getConfigMap(String name); List<T> prepareProcessors(List<T> namedList, String type); boolean use(String inc); static ProcessorConfig cloneProcessorConfig(ProcessorConfig processorConfig); static ProcessorConfig mergeProcessorConfigs(ProcessorConfig ... processorConfigs); }
ProcessorConfig { public <T extends Named> List<T> prepareProcessors(List<T> namedList, String type) { List<T> ret = new ArrayList<>(); Map<String, T> lookup = new HashMap<>(); for (T named : namedList) { lookup.put(named.getName(), named); } for (String inc : includes) { if (use(inc)) { T named = lookup.get(inc); if (named == null) { List<String> keys = new ArrayList<>(lookup.keySet()); Collections.sort(keys); throw new IllegalArgumentException( "No " + type + " with name '" + inc + "' found to include. " + "Please check spelling in your profile / config and your project dependencies. Included " + type + "s: " + StringUtils.join(keys,", ")); } ret.add(named); } } return ret; } ProcessorConfig();  ProcessorConfig(List<String> includes, Set<String> excludes, Map<String, TreeMap> config); String getConfig(String name, String key); Map<String, String> getConfigMap(String name); List<T> prepareProcessors(List<T> namedList, String type); boolean use(String inc); static ProcessorConfig cloneProcessorConfig(ProcessorConfig processorConfig); static ProcessorConfig mergeProcessorConfigs(ProcessorConfig ... processorConfigs); static final ProcessorConfig EMPTY; }