<parent> <groupId>org.funcish</groupId> <artifactId>funcish-utils-parent</artifactId> <version>1.0.0</version> </parent> import org.funcish.core.fn.Functions; Function<String, String> toUpperCase = Functions.toUpperCase(); String result = toUpperCase.apply("hello funcish"); import org.funcish.core.fn.Strings; import org.funcish.core.util.Strings.Function1; Function1<Boolean, String> filter = Strings.filter(s -> s.length() > 5); Function1<String, String> map = Strings.map(s -> s.toUpperCase()); String result = Strings.fold(filter, map, "", "one", "two", "three", "four", "five"); import org.funcish.core.util.Exceptions; Function1<Integer, Integer> divide = i -> 10 / i; Integer result = Exceptions.tryCatch(() -> divide.apply(0), e -> { return null; });


上一篇:
下一篇:
切换中文