chb0kotlin
01/25/2018, 5:53 AMprivate static final Map<String, Function<DeDup, Consumer<String>>> CMDS = new HashMap<>();
static {
CMDS.put("--root", d -> f -> Optional.of(f).map(File::new).filter(d.isChild.negate()).ifPresent(d.roots::add));
CMDS.put("--type", d -> type -> d.fileTypes.add(type));
CMDS.put("--hash", d -> hash -> d.hashAlgo = hash);
CMDS.put("--help", d -> d::exitHelp);
}
so far I have:
val CMDS:Map<String, Function<DeDup,Consumer<String>> = mapOf("--root" to )
and I don't get it - a function only take one argument: an out param?