addAllWhatIfNotNull

inline fun <T : MutableCollection<E>, E> T.addAllWhatIfNotNull(element: Collection<E>?, whatIf: (T) -> Unit): T

An expression for adding an element and invoking whatIf when the element is not null.

Return

Returns the original target object.

Parameters

element

n collection of elements should be added into the target.

whatIf

An executable lambda function if the element it not null.

inline fun <T : MutableCollection<E>, E> T.addAllWhatIfNotNull(element: Collection<E>?, whatIf: (T) -> Unit, whatIfNot: (T) -> Unit): T

An expression for adding an element and invoking whatIf when the element is not null.

Return

Returns the original target object.

Parameters

element

n collection of elements should be added into the target.

whatIf

An executable lambda function if the element it not null.

whatIfNot

An executable lambda function if the element it null.