Share via


MethodHandles.Identity(Class) Method

Definition

Produces a method handle which returns its sole argument when invoked.

[Android.Runtime.Register("identity", "(Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;", "", ApiSince=26)]
public static Java.Lang.Invoke.MethodHandle? Identity (Java.Lang.Class? type);
[<Android.Runtime.Register("identity", "(Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;", "", ApiSince=26)>]
static member Identity : Java.Lang.Class -> Java.Lang.Invoke.MethodHandle

Parameters

type
Class

the type of the sole parameter and return value of the desired method handle

Returns

a unary method handle which accepts and returns the given type

Attributes

Remarks

Produces a method handle which returns its sole argument when invoked.

Java documentation for java.lang.invoke.MethodHandles.identity(java.lang.Class<?>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to