W3cubDocs

/Kotlin

Function

interface Function<out R>

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.

© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-function.html