TakeIfExtension<T> extension

Provides a conditional TakeIfExtension.takeIf method on any object.

Enables fluent, expression-based conditional logic similar to Kotlin's takeIf.

on
  • T

Methods

takeIf(bool predicate(T)) → T?

Available on T, provided by the TakeIfExtension extension

Returns this object if it satisfies predicate, or null otherwise.