takeIf

kotlin-stdlib / kotlin / takeIf
 

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1) 

inline fun <T> T.takeIf(predicate: (T) -> Boolean): T? 
 Returns this value if it satisfies the given predicate or null, if it doesn't. 


    
{'path': 'public/docs/kotlin~1.4/api/latest/jvm/stdlib/kotlin/take-if.html', 'source': 'DevDocs.IO'}