ifPresent


Description:

public void ifPresent (owned ConsumerFunc<T> func)

If a value is present, invokes the given function with the value.

Example:

    Optional.of<string> ("hello").ifPresent ((v) => {
print ("%s\n", v);
});

Parameters:

func

the function to invoke.