@Override public Option<String> apply(A a) { return asString(a); } };
/** * Get an optional boolean from a dictionary. */ public static Option<Boolean> getOptCfgAsBoolean(Dictionary d, String key) { return option(d.get(key)).bind(Strings.asString()).map(Strings.toBool); }
/** Get a value from a dictionary. Return none if the key does either not exist or the value is blank. */ public static Option<Integer> getOptCfgAsInt(Dictionary d, String key) { return option(d.get(key)).bind(Strings.asString()).bind(Strings.toInt); }
/** Get a value from a dictionary. Return none if the key does either not exist or the value is blank. */ public static Option<String> getOptCfg(Dictionary d, String key) { return option(d.get(key)).bind(Strings.asString()).bind(Strings.trimToNone); }