ifpresent

.ifpresent value:{Dynamic} mapping:{Lambda} -> Any

Maps value to the result of mapping.

Return

the result of mapping executed on value if value is not none, none otherwise

Parameters

value

value to check

mapping

lambda to execute if value is not none. It should accept one argument, which is value, and return a value.

See also