takeIf method
Kotlin-esque "operator" to take this if condition is true, or else return null.
Implementation
T? takeIf(bool condition) => condition ? this : null;
Kotlin-esque "operator" to take this if condition is true, or else return null.
T? takeIf(bool condition) => condition ? this : null;