# Predicate

# Predicate

Artifact:[androidx.window.extensions.core:core](https://developer.android.com/jetpack/androidx/releases/window-extensions-core)  
[View Source](https://cs.android.com/search?q=file:androidx/window/extensions/core/util/function/Predicate.java+class:androidx.window.extensions.core.util.function.Predicate)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/window-extensions-core#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/window/extensions/core/util/function/Predicate "View this page in Java")

<br />

```
@FunctionalInterface
interface Predicate<T>
```

<br />

*** ** * ** ***

Represents a predicate boolean-valued function of one argument. It is used internally to avoid using Java 8 functional interface that leads to desugaring and Proguard shrinking.  

| Parameters |
|------------|----------------------------------------|
| `<T>`      | the type of the input to the predicate |

|                                        See also                                        |
|----------------------------------------------------------------------------------------|---|
| [Predicate](https://developer.android.com/reference/java/util/function/Predicate.html) |   |

## Summary

|                                ### Public functions                                 |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [test](https://developer.android.com/reference/kotlin/androidx/window/extensions/core/util/function/Predicate#test(T))`(t: T!)` Tests the predicate against a given argument. |

## Public functions

### test

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/window-extensions-core#1.0.0)  

```
fun test(t: T!): Boolean
```

Tests the predicate against a given argument.  

| Parameters |
|------------|----------------------------|
| `t: T!`    | the input of the predicate |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | `true`if the input matches the`Predicate`, otherwise,`false` |