Function

interface Function<out R> (source)

Represents a value of a functional type, such as a lambda, an anonymous function or a function reference.

Parameters

R - return type of the function.

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

Extension Functions

reflect

fun <R> Function<R>.reflect(): KFunction<R>?

This is an experimental API. Given a class for a compiled Kotlin lambda or a function expression, returns a KFunction instance providing introspection capabilities for that lambda or function expression and its parameters. Not all features are currently supported, in particular KCallable.call and KCallable.callBy will fail at the moment.

Inheritors

KFunction

interface KFunction<out R> : KCallable<R>, Function<R>

Represents a function with introspection capabilities.