Predicate

fun interface Predicate<in T>

Predicate for collection item metadata. Unlike (T) -> Boolean, this compiles to a primitive boolean return and avoids boxing when invoked for every item.

The generic T parameter still erases to Object, so this interface should only be used when T is a reference type. That is true for LazyGrid and LazyList data models, so the input parameter does not box here; only the primitive return type needed specialization.

Functions

Link copied to clipboard
abstract fun test(item: T): Boolean