# Function

# Function

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/Function.java+class:androidx.window.extensions.core.util.function.Function)  
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/Function "View this page in Java")

<br />

```
@FunctionalInterface
interface Function<T, R>
```

<br />

*** ** * ** ***

Represents a function that accepts an argument and produces a result. 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 of the function  |
| `<R>`      | : the type of the output of the function |

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

## Summary

| ### Public functions |
|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `R!`                 | [apply](https://developer.android.com/reference/kotlin/androidx/window/extensions/core/util/function/Function#apply(T))`(t: T!)` Applies this function to the given argument. |

## Public functions

### apply

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

```
fun apply(t: T!): R!
```

Applies this function to the given argument.  

| Parameters |
|------------|-----------------------|
| `t: T!`    | the function argument |

| Returns |
|---------|---------------------|
| `R!`    | the function result |