# Function

# Function

Artifact:[androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/util/Function.kt+class:androidx.core.util.Function)  
Added in[1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

*** ** * ** ***

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

<br />

```
fun interface Function<T : Any?, R : Any?>
```

<br />

*** ** * ** ***

Compat version of[java.util.function.Function](https://developer.android.com/reference/java/util/function/Function.html)  

|                                       Parameters                                       |
|----------------------------------------------------------------------------------------|----------------------------------------|
| `<T : `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?>` | the type of the input to the operation |
| `<R : `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?>` | the type of the output of the function |

## Summary

| ### Public functions |
|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `R`                  | [apply](https://developer.android.com/reference/kotlin/androidx/core/util/Function#apply(kotlin.Any))`(value: T)` Applies the function to the argument parameter. |

## Public functions

### apply

Added in[1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)  

```
fun apply(value: T): R
```

Applies the function to the argument parameter.  

| Parameters |
|------------|-------------------------------|
| `value: T` | the argument for the function |

| Returns |
|---------|------------------------------------|
| `R`     | the result after applying function |