filter


Description:

public Optional<G> filter (Predicate<G> pred)

If a value is present and matches the given predicate, returns an optional containing the value, otherwise returns an empty optional.

Returns:

an optional containing the value if a value is present, otherwise an empty optional