@Test public void testOptFunc() { final Map<String, Integer> nums = new HashMap<>(); final Function<String, Integer> before = nums::get; nums.put("one", 1); nums.put("three", 3); final Function<String, Optional<Integer>> composed = Util.optFunc(before); assertTrue("value for one is present", composed.apply("one").isPresent()); assertFalse("value for two is empty", composed.apply("two").isPresent()); }
@Deprecated public static <T, R> Function<T, Optional<R>> optFunc(final Function<T, R> inputFunc) { return ((Function<R, Optional<R>>) Optional::ofNullable).compose(inputFunc); }
Util { @Deprecated public static <T, R> Function<T, Optional<R>> optFunc(final Function<T, R> inputFunc) { return ((Function<R, Optional<R>>) Optional::ofNullable).compose(inputFunc); } }
Util { @Deprecated public static <T, R> Function<T, Optional<R>> optFunc(final Function<T, R> inputFunc) { return ((Function<R, Optional<R>>) Optional::ofNullable).compose(inputFunc); } private  Util(); }
Util { @Deprecated public static <T, R> Function<T, Optional<R>> optFunc(final Function<T, R> inputFunc) { return ((Function<R, Optional<R>>) Optional::ofNullable).compose(inputFunc); } private  Util(); static Session wrapSessionReadOnly(final Session session); static List<String> getManifestHeaderValues(final Manifest manifest, final String headerName); static String escapeManifestHeaderValue(final @NotNull String... values); static String escapeManifestHeaderValues(final @NotNull List<String> values); static List<URL> resolveManifestResources(final URL manifestUrl, final List<String> resources); static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final ClassLoader classLoader); static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final List<File> files); static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final URL manifestUrl); static Predicate<T> debugFilter(final Logger logger, final String format); static Predicate<T> traceFilter(final Logger logger, final String format); @Deprecated static Function<T, M> composeTry(final Function<R, M> monadUnit,
                                                      final Supplier<M> monadZero,
                                                      final TryFunction<T, R> onElement,
                                                      final BiConsumer<T, Exception> onError); @Deprecated static Function<T, Optional<R>> optFunc(final Function<T, R> inputFunc); @Deprecated static Function<T, R> compose(final Function<T, I> before, final Function<I, R> after); }
Util { @Deprecated public static <T, R> Function<T, Optional<R>> optFunc(final Function<T, R> inputFunc) { return ((Function<R, Optional<R>>) Optional::ofNullable).compose(inputFunc); } private  Util(); static Session wrapSessionReadOnly(final Session session); static List<String> getManifestHeaderValues(final Manifest manifest, final String headerName); static String escapeManifestHeaderValue(final @NotNull String... values); static String escapeManifestHeaderValues(final @NotNull List<String> values); static List<URL> resolveManifestResources(final URL manifestUrl, final List<String> resources); static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final ClassLoader classLoader); static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final List<File> files); static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final URL manifestUrl); static Predicate<T> debugFilter(final Logger logger, final String format); static Predicate<T> traceFilter(final Logger logger, final String format); @Deprecated static Function<T, M> composeTry(final Function<R, M> monadUnit,
                                                      final Supplier<M> monadZero,
                                                      final TryFunction<T, R> onElement,
                                                      final BiConsumer<T, Exception> onError); @Deprecated static Function<T, Optional<R>> optFunc(final Function<T, R> inputFunc); @Deprecated static Function<T, R> compose(final Function<T, I> before, final Function<I, R> after);  }