ifNotNull

inline fun <T1, T2, R> ifNotNull(t1: T1?, t2: T2?, onNotNull: (T1, T2) -> R): R?

Calls the specified function block with t1 and t2 as its arguments if t1 and t2 are not null. Returns the function block’s result if it was called, and null if it wasn’t.


inline fun <T1, T2, T3, R> ifNotNull(t1: T1?, t2: T2?, t3: T3?, onNotNull: (T1, T2, T3) -> R): R?

Calls the specified function block with t1, t2, and t3 as its arguments if t1, t2, and t3 are not null. Returns the function block’s result if it was called, and null if it wasn’t.