RFR: 8015317: Optional.filter, map, and flatMap

Henry Jen henry.jen at oracle.com
Fri Jul 5 21:37:41 UTC 2013


Hi,

Please review the webrev at

http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/

Which adds following method to Optional,

public static <T> Optional<T> ofNullable(T value) {}
public Optional<T> filter(Predicate<? super T> predicate) {}
public<U> Optional<U> map(Function<? super T, ? extends U> mapper) {}
public<U> Optional<U> flatMap(Function<? super T, ? extends Optional<U>>
mapper) {}

Also included is some cleanup on javadoc.

Cheers,
Henry



More information about the core-libs-dev mailing list